- 博客(13)
- 收藏
- 关注
![](https://csdnimg.cn/release/blogv2/dist/pc/img/listFixedTop.png)
原创 studio=C
fragment懒加载protected View mView;//页面是否可见protected boolean isViewInitiated;//页面是否加载过protected boolean isVisibleToUser;//是不是加载过protected boolean isDataInitiated;@Nullable@Overridepublic View...
2020-02-17 21:08:30
163
原创 studio显示隐藏Fragment
MyBaseActivityprivate List<Fragment> list = new ArrayList<>();private RadioGroup mRg;private FragmentManager mFragment;private HomeFragment homeFragment;private MovieFragment movieFr...
2019-12-30 20:47:53
162
原创 studio购物车左右视图
HomeFragmentpublic class HomeFragment extends BaseFragment { @Override protected void startCoding() { mPresenter.getStart(BaseUrl.DisplayData, StudentBean.class); oneBaseAdap...
2019-12-23 11:21:56
155
原创 studio之自定义View搜索框
MyView层public class MyVIew extends LinearLayout { protected Context mContext; private EditText editName; private Button sousuo; public MyVIew(Context context, @Nullable AttributeSet...
2019-12-19 10:04:09
142
原创 studio购物车之订单
NetUtil层public class NetUtil { private ApiService apiService; private NetUtil() { HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); loggingInterceptor...
2019-12-15 20:11:23
179
原创 studio购物车
NetUtil工具类public class NetUtils { private ApiService apiService; private NetUtils() { HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); interceptor.setLevel...
2019-12-06 18:27:52
239
原创 自定义View搜索框
自定义类继承xml的布局extends LinearLayout重写它的方法在这个方法里进行找控件public MyView(Context context, @Nullable AttributeSet attrs) {设置接口回调向Activity中传值public interface Cilck { void onSetCilck(String name);}priv...
2019-11-25 10:44:57
112
原创 Glide缓存之SD卡缓存
首先自定义类实现GlideModuleimplements GlideModule记住一定要实现import com.bumptech.glide.module.GlideModule;这个包下的GlideModule不然重写的方法会不一样重写GlideModule类的两个方法@Overridepublic void applyOptions(@NonNull Context conte...
2019-11-22 19:45:21
366
2
原创 studio简易流式布局
public class MyView extends ViewGroup { private Context context; public MyView(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; } ...
2019-11-21 14:08:52
135
原创 RecyclerView的点击事件
在BaseAdapter中自定义一个接口public interface Cilck { void onSetCilck(View v, int p);}private Cilck cilck;public void setItemCilck(Cilck cilck) { this.cilck = cilck;}在BaseAdapter赋值中调用holder.it...
2019-11-21 14:06:40
136
原创 全局异常捕获
首先自定义一个类实现Thread.UncaughtExceptionHandlerpublic class CrashHandler implements Thread.UncaughtExceptionHandler先在本类写一个静态单例private CrashHandler(){}private static class CrashHolder{ private st...
2019-11-20 21:07:41
157
原创 studio简易WebView
MainActivity代码import androidx.appcompat.app.AppCompatActivity;import android.annotation.SuppressLint;import android.os.Bundle;import android.view.View;import android.webkit.JavascriptInterface;...
2019-11-19 19:36:55
951
1
原创 studio简易折线图
Android Studio简易折线图先进行dp和px的转换public static int getDptoPx(Context context, int dpValue) { float density = context.getResources().getDisplayMetrics().density; int pxValue = (int) (dpValue * d...
2019-11-15 16:34:58
363
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人