AndroidStudio
¥程序小菜鸟¥
这个作者很懒,什么都没留下…
展开
-
在Retrofit中使用OKHttp拦截器 及添加缓存路径
public class RetrofitUtils { OkHttpClient okHttpClient; Retrofit retrofit; private static RetrofitUtils utils; private RetrofitUtils(){ //2、添加Http日志拦截 HttpLoggingInte...原创 2019-05-05 10:28:48 · 287 阅读 · 1 评论 -
可拖动按钮
.xml <Button android:layout_width="100dp" android:layout_height="50dp" android:id="@+id/button_id" android:text="我是按钮"/> .Java public class MainActivity extends ...原创 2019-04-28 20:50:23 · 604 阅读 · 0 评论 -
GreenDao简单使用
添加依赖 //在包的build.gradle中 buildscript{ mavenCentral() } dependencies{ classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' } //在model的build.gradle中 apply plugin: 'org.greenrobot.greendao' implement...原创 2019-04-14 20:52:57 · 120 阅读 · 0 评论 -
fresco图片加载框架
添加依赖 implementation 'com.facebook.fresco:fresco:0.14.1' app继承Application初始化fresco private void fresco() { //构建磁盘高速缓存配置 DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder(th...原创 2019-04-14 20:45:18 · 188 阅读 · 0 评论 -
MVP封装Retrofit加RxJava网络请求类
创建Api接口类 public interface Api { @GET public Observable<ResponseBody> doGet(@Url String url); } RetrofitUtils类封装 public class RetrofitUtils { public final OkHttpClient client; p...原创 2019-04-21 23:24:35 · 146 阅读 · 0 评论 -
recycler列表展示 搜索框 自定义流式布局
public interface MInterface { public void getRequest(String url, Map<String,String> map); public void postrequest(String url, String phone, String pwd); } public interface PInterface { ...原创 2019-03-24 21:06:06 · 202 阅读 · 0 评论 -
封装OkHttp
public class OkHttpUtils { public static OkHttpUtils utils; private final OkHttpClient okHttpClient; private OkHttpUtils(){ okHttpClient = new OkHttpClient.Builder().addIntercepto...原创 2019-03-24 20:55:42 · 108 阅读 · 0 评论 -
自定义View制作简单的流式布局(搜索历史记录)
public class View3 extends ViewGroup { private int hsize; private int wsize; private int childh; private int childw; public View3(Context context) { super(context); } ...原创 2019-03-24 20:43:44 · 160 阅读 · 0 评论 -
MVP登录注册 RecycleView列表展示
BaseInterface package com.bawei.myapplication.application; public interface BaseInterface { //P public interface PresenterInterface { public void toLogin(String phone, String pwd); pub...原创 2019-03-17 21:12:02 · 133 阅读 · 0 评论 -
使用View绘制可以移动的坐标轴
public class view extends View { private Paint paint; //中心点坐标 private float pointX = 500; private float pointY =800; //控制是否可以移动的变量 true的时候可以移动 private boolean xmovetrue; ...原创 2019-05-28 11:59:28 · 394 阅读 · 0 评论