- 博客(21)
- 收藏
- 关注
原创 连续点击两次退出应用
这两年的app都采用了连点两次再退出的方式,几乎所有应用开发都会用到,所以在这里记录下来,以便使用我们只要在主页的Activity里写下如下方法即可 private long exitTime = 0; @Override public void onBackPressed() { if(System.currentTimeMillis() - exitT...
2019-02-14 19:14:40 401 1
原创 广告页倒计时跳转
布局<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools=...
2019-01-20 11:32:50 456
原创 首次登陆欢迎页
布局<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools=...
2019-01-20 11:18:13 566
原创 腾讯Bugly,友盟统计,
腾讯Bugly在依赖库中导入implementation 'com.tencent.bugly:crashreport:latest.release'在MyApp中的启动方法里写CrashReport.initCrashReport(getApplicationContext(), "注册时申请的APPID", false); 建议在测试阶段建议设置成true,发布时设置为...
2019-01-19 08:57:08 824
原创 ListView吸顶效果
吸顶效果最重要的在布局上首先把几个布局写下activity_main<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.an...
2019-01-13 19:32:26 750
原创 Fresco展示图片缓存,Retrofit+OKHttp请求数据,greenDao数据库展示数据
在app的build.gradle依赖implementation 'com.squareup.retrofit2:retrofit:2.5.0'implementation 'com.squareup.okhttp3:okhttp:3.12.1' implementation 'com.jakewharton:butterknife:8.8.1' annotationPr...
2019-01-01 21:07:42 1156
原创 购物车续
上个博客的框架条目布局cart2_group_item<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"android:la...
2018-12-21 11:35:45 89
原创 Android属性动画实现数字自增长
ValueAnimator animator = ValueAnimator.ofInt(mStartValue, mEndValue); animator.setDuration(duration); animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListen...
2018-12-21 09:55:05 2078 1
原创 仿饿了么购物车
上个博客的依赖和包导入图片.颜色Bean包里Goodshttp://www.zhaoapi.cn/product/getCarts?uid=71 data里的 public class Goods implements Serializable{ private double bargainPrice; private String createtime; ...
2018-12-20 15:05:46 377
原创 购物车二
条目布局cart2_group_item&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width=&quo
2018-12-19 21:22:04 124
原创 购物车1
上个博客的依赖和包导入图片.颜色Bean包里Goodshttp://www.zhaoapi.cn/product/getCarts?uid=71data里的public class Goods implements Serializable{private double bargainPrice;private String createtime;private String d...
2018-12-19 21:09:13 273
原创 电商XRecyclerView展示,搜索,布局切换
加入权限<uses-permission android:name="android.permission.INTERNET"/><uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permission android:name="android.per...
2018-12-16 20:18:29 203
原创 属性动画,网络登录,RecyclerView多条目展示
加入网络权限<uses-permission android:name="android.permission.INTERNET"/>导入依赖implementation 'com.squareup.okhttp3:okhttp:3.12.0'implementation 'com.github.bumptech.glide:glide:3.8.0'implementat...
2018-12-14 16:00:42 190 1
原创 RecyclerView线性布局,表格布局,瀑布流,OKHTTP访问网络图片
1加入联网权限 <uses-permission android:name="android.permission.INTERNET"/>2.搜索添加依赖 import android.support.v7.widget.RecyclerView;3在build.gradle加入glide 进行图片的解析compile 'com.github.bumptech.glid...
2018-12-12 14:14:50 408
原创 MVP登录展示项目初版
这个项目包含了,mvp框架,自动登录,数据库记住密码,多条目展示,轮播图,二维码展示等等,导入jar包ImageLode.jar,zing.jar黄油刀implementation ‘com.jakewharton:butterknife:8.8.1’annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’清单文件...
2018-12-08 13:09:45 257
原创 超简单获取APP异常,写入SD卡文档
首先看看结构心里有点数,没错就写两个类就好先写CrashHandlerpublic class CrashHandler implements Thread.UncaughtExceptionHandler {private static CrashHandler sInstance = null;private Thread.UncaughtExceptionHandler mDef...
2018-12-05 20:18:18 197
原创 超简单ZXing扫描二维码条形码
首先在build.gradle写上方法repositories {mavenCentral()maven { url "http://dl.bintray.com/journeyapps/maven"}}然后还是在这个文件内加上依赖implementation 'com.journeyapps:zxing-android-embedded:2.0.1@aar'im...
2018-12-03 20:47:25 581
原创 流式布局+SQLite存储,历史记录的存储和删除
1.先解决流式布局的FrameLayout,以方便拉入布局界面public class FlowLayout extends FrameLayout {private final static int H_DISTANCE=20;//水平间距20private final static int V_DISTANCE=20;//竖直间距20public FlowLayout(@NonNull...
2018-12-01 10:47:29 653
原创 自定义View画板
PointViewpublic class PaintView extends View {private Paint mPaint;//画笔工具private Path mPath;//路径public PaintView(Context context) { super(context); init();}public PaintView(Context con...
2018-11-29 21:27:31 158
原创 自定义View转盘
FanViewpublic class FanView extends View implements View.OnClickListener {private Paint mFanPaint,mTextPaint;//扇形画笔和文字画笔private ArrayList<Fan> mFanList = new ArrayList<>();private Rota...
2018-11-29 21:03:56 172
原创 自定义View画表格
布局界面&lt;com.baidu.tast1.MyView android:id="@+id/myView" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="8"/&a
2018-11-29 19:11:38 504
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人