- 博客(25)
- 收藏
- 关注
原创 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 193
原创 兴趣树
自定义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 156
原创 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 680
原创 高德地图简单的逆定理编码
具体的参考高德开发平台Activity:public class MainActivity extends AppCompatActivity implements GeocodeSearch.OnGeocodeSearchListener { private MapView mMapView; AMap aMap; MyLocationStyle myLocatio...
2018-12-21 10:22:10 347
原创 简单的自定义进度条
自定义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 84
原创 二级联动
Activity:/** * 二级联动 */public class ShopTypeActivity extends AppCompatActivity implements IView { private IPresenterImpl mIPresenterImpl; private ShopTypeAdapter mShopTypeAdapter; priva...
2018-12-21 09:26:49 73
原创 线性和网格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 353
原创 自定义拦截器
自定义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 99
原创 处理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 3215
原创 购物车的简单逻辑
Activity:public class ShopCarActivity extends AppCompatActivity implements IView, View.OnClickListener { private ShopAdapter mShopAdapter; private CheckBox mIvCircle; private List<Shop...
2018-12-20 19:07:18 140
原创 属性动画
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 86
原创 动画递归
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 415
原创 瀑布流布局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 145
原创 网格布局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 354
原创 线性布局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 280
原创 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 471
原创 第三方登录
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 182
原创 记住密码和自动登录
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 461
原创 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 461
原创 异常捕获
UnCatchHandler:/** * 全局捕获异常类,实现Thread.UncaughtExceptionHandler * @author hasee */public class UnCatchHandler implements Thread.UncaughtExceptionHandler { private static UnCatchHandler mUnCatc...
2018-12-06 20:53:29 194
原创 二维码
导包: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 158
原创 测量式流式布局02
drawable文件夹下的shape:bg_bd.xml:<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"><solid android:color="#00000000"/>&a
2018-12-02 20:44:30 117
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人