- 博客(6)
- 收藏
- 关注
原创 Android二维码生成与识别
导入依赖implememtation 'com.google.zxing:core:3.4.1'public class QrCodeUtil { public static String decode(Context context, Uri uri) { try { Bitmap bmp= MediaStore.Images.Media.getBitmap(context.getContentResolver(), uri); return decode(bmp); } cat
2021-11-16 23:11:20 1389
原创 BaseFragmentStatePagerAdapter
public class BaseFragmentStatePagerAdapter extends FragmentStatePagerAdapter { private FragmentManager mFragmentManager; private List<Fragment> mFragments=new ArrayList<>(); public BaseFragmentStatePagerAdapter(FragmentManager fm){ supe
2021-06-29 11:25:15 109
原创 动态删除Fragment
@Overridepublic int getItemPosition(Object object) { if (!((Fragment) object).isAdded() || !mFragments.contains(object)) { return PagerAdapter.POSITION_NONE; } return mFragments.indexOf(object);}@Overridepublic Object instantiateItem(
2021-06-28 23:02:54 388
原创 BaseRecyclerView
BaseViewHolderimport android.view.View;import androidx.recyclerview.widget.RecyclerView;import android.widget.TextView;import android.util.SparseArray;public class BaseViewHolder extends RecyclerView.ViewHolder { private View mRootView; private Sp
2021-01-08 09:16:54 169 1
原创 BaseFragment
import android.os.Bundle;import android.util.SparseArray;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import androidx.fragment.app.Fragment;public abstract class BaseFragment extends Fragment{ boolean
2021-01-08 08:48:36 104
原创 RvUtil
import android.content.Context;import androidx.recyclerview.widget.RecyclerView;import androidx.recyclerview.widget.LinearLayoutManager;import androidx.recyclerview.widget.GridLayoutManager;import androidx.recyclerview.widget.StaggeredGridLayoutManager
2021-01-08 08:45:11 95
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人