- 博客(75)
- 收藏
- 关注
原创 设置默认地址
设置默认地址在适配器里写这个方法修改并再次查询地址后调用这个方法//改变默认值 public void setAllunCheck(int position) { int size = list.size(); for (int i=0;i<size;i++){ if(i==position){ ...
2019-01-20 11:51:42
2403
原创 Retrofit+RxJava+Okhttp
BaseApis:/** * * @详情 RXjava的被观察者 * * @创建日期 2018/12/29 15:00 * */public interface ObservedApis { @GET Observable<ResponseBody> get(@Url String url); @POST Observable<...
2019-01-20 11:42:09
237
原创 照相与相册裁剪 bitmap转file
private String path=Environment.getExternalStorageDirectory()+"/header_image.png";Intent intent_takePhoto=new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (hasSdcard()){//判断SD卡是否可用 ...
2019-01-20 11:20:47
181
原创 商家适配器
public class JiaAdapter extends RecyclerView.Adapter&lt;JiaAdapter.ViewHolder&gt; {private List&lt;ShopBean.DataBean&gt; list;private Context context;public JiaAdapter(Context context) { this.c...
2019-01-14 00:32:51
132
原创 webview
webView.loadDataWithBaseURL(null,result.getDetails(),“text/html”,“utf-8”,null);
2019-01-14 00:24:27
177
原创 吸附效果
自定义RecyclerView:public class MyRecyclerView extends RecyclerView { private BaseDecoration mDecoration; public MyRecyclerView(Context context) { super(context); } public MyR...
2019-01-13 18:46:25
398
原创 Android 内存泄漏分析利器——leakcanary
https://www.cnblogs.com/fuyaozhishang/p/7753013.html
2019-01-12 09:11:33
212
原创 时间转换格式
String times = new SimpleDateFormat("yyyy-MM-dd").format( new java.util.Date(item.getOrderTime())); task_text_time.setText(times);
2019-01-11 13:52:32
252
原创 第二个网络请求
RetrofitUtils:public class RetrofitUtils { private static RetrofitUtils instance; private OkHttpClient client; private final String BASE_URL="http://172.17.8.100/small/"; private Bas...
2019-01-01 23:31:34
154
原创 Retrofit
BaseApis:public interface BaseApis<T> { @GET Observable<ResponseBody> get(@Url String url); @POST Observable<ResponseBody> post(@Url String url, @QueryMap Map<St...
2019-01-01 15:31:58
142
原创 递归截取字符串
//递归截取字符串public void cc(String images){//找到 | 的位置int index=images.indexOf("|");if (index&gt;=0){String pian=images.substring(0,index);list.add(pian);cc(images.substring(index+1,images.length())...
2019-01-01 14:41:27
550
原创 Butterknife
Butterknife:1.使用前首先是在项目的Project的build.gradle的dependencies{ }中加入一句话:dependencies {classpath 'com.android.tools.build:gradle:3.0.1'//Butterknifeclasspath 'com.jakewharton:butterknife-gradle-plugin:...
2018-12-28 08:17:53
207
原创 兴趣树
自定义View:CustomView:public class CustomView extends LinearLayout { private Paint mPaint; public CustomView(Context context) { super(context); init(); } public CustomV...
2018-12-21 10:37:50
171
原创 Recyclerview删除子条目的属性动画
在Adapter里写一个删除的方法Adapter: public void del(final View view , final int position){ final float f = view.getX(); ObjectAnimator animator=ObjectAnimator.ofFloat(view,"translationX",0...
2018-12-21 10:24:08
699
原创 高德地图简单的逆定理编码
具体的参考高德开发平台Activity:public class MainActivity extends AppCompatActivity implements GeocodeSearch.OnGeocodeSearchListener { private MapView mMapView; AMap aMap; MyLocationStyle myLocatio...
2018-12-21 10:22:10
367
原创 简单的自定义进度条
自定义View:public class Jindutiao extends View { private Context context; private Paint paint; public Jindutiao(Context context) { super(context); this.context=context; ...
2018-12-21 09:33:51
102
原创 二级联动
Activity:/** * 二级联动 */public class ShopTypeActivity extends AppCompatActivity implements IView { private IPresenterImpl mIPresenterImpl; private ShopTypeAdapter mShopTypeAdapter; priva...
2018-12-21 09:26:49
85
原创 线性和网格Recyclerview的切换
Activity:public class MainActivity extends AppCompatActivity implements IView, View.OnClickListener { private static final int SPAN_COUNT = 2; private IPresenterImpl mIPresenterImpl; pri...
2018-12-20 19:42:43
375
原创 自定义拦截器
自定义View:CustomIn:public class CustomIn implements Interceptor { @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); Respo...
2018-12-20 19:13:36
110
原创 处理OkHttp的异常
OkUtil:public class OkUtil { private static OkUtil instance; private OkHttpClient mClient; private Handler handler=new Handler(Looper.getMainLooper()); public static OkUtil getInstanc...
2018-12-20 19:10:14
3301
原创 购物车的简单逻辑
Activity:public class ShopCarActivity extends AppCompatActivity implements IView, View.OnClickListener { private ShopAdapter mShopAdapter; private CheckBox mIvCircle; private List&amp;amp;amp;lt;Shop...
2018-12-20 19:07:18
150
原创 属性动画
activity_animation.xml:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:lay...
2018-12-14 21:09:03
97
原创 动画递归
activity_main.xml:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" ...
2018-12-12 19:38:33
443
原创 瀑布流布局Recyclerview
导依赖: implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0' implementation 'com.google.code.gson:gson:2.8.5' implementatio...
2018-12-11 20:48:33
159
原创 网格布局Recyclerview
导依赖: implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0' implementation 'com.google.code.gson:gson:2.8.5' implementatio...
2018-12-11 20:47:53
380
原创 线性布局RecyclerView
导依赖: implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0' implementation 'com.google.code.gson:gson:2.8.5' implementatio...
2018-12-11 20:47:20
301
原创 OKHttp
public class OkHttpUtils {private static volatile OkHttpUtils mInstance;private OkHttpClient mClient;private Handler mHandler = new Handler(Looper.getMainLooper());/** * 第一步,写一个单例,这里用的懒汉式,也可以使用...
2018-12-10 21:06:14
503
原创 第三方登录
AndroidManifest.xml:<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.umeng.soexample"> <!-- 1.添加以下权限
2018-12-09 20:18:23
219
原创 记住密码和自动登录
activity_main.xml:<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas...
2018-12-09 20:14:44
494
原创 bugly
导包:implementation 'com.tencent.bugly:crashreport:latest.release'权限: &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt; &lt;uses-permission android:name="android.pe...
2018-12-06 20:55:32
490
原创 异常捕获
UnCatchHandler:/** * 全局捕获异常类,实现Thread.UncaughtExceptionHandler * @author hasee */public class UnCatchHandler implements Thread.UncaughtExceptionHandler { private static UnCatchHandler mUnCatc...
2018-12-06 20:53:29
231
原创 二维码
导包:build:implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.4'activity_main.xml:&amp;amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;amp;gt;&amp;amp;lt;an
2018-12-03 20:28:48
172
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人