- 博客(129)
- 收藏
- 关注
原创 linux常用命令
linux 常用命令:查看日志tailheadcattail -f filename 监视filename文件的尾部内容(默认10行,相当于增加参数 -n 10)tail -n 20 filename显示filename最后20行。tail -r -n 10 filename 倒序显示filename最后10行。head -n 10 test.log 查询日志文件中的头10行日志;head -n -10 test.log 查询日志文件除了最后10行的其他所有日...
2021-05-27 16:39:21
151
原创 版本更新
//banbengengxin <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_...
2018-08-29 14:37:53
211
原创 解决RecyclerView 布局显示不全问题
View inflate = LayoutInflater.from(context).inflate(R.layout.title_zi, viewGroup, false);
2018-07-16 17:47:49
4179
原创 自定义圆形图片 圆角
public class CircleImageView extends ImageView { //画笔 private Paint mPaint; //圆形图片的半径 private int mRadius; //图片的宿放比例 private float mScale; public CircleImageView(Context...
2018-07-13 11:16:42
211
原创 项目上传到码云
https://blog.youkuaiyun.com/lei_notes/article/details/53287447 git remote -v 查看远程库信息 git remote rm origin 删除远程库 git push -u origin master git remote add origi
2018-04-18 16:39:34
223
原创 Umeng多渠道打包
https://blog.youkuaiyun.com/chenliguan/article/details/51066933https://blog.youkuaiyun.com/small_technical/article/details/72782671https://blog.youkuaiyun.com/mynameishuangshuai/article/details/51783303<meta-data an...
2018-04-11 14:08:05
481
原创 获取sha1码
//这个是获取SHA1的方法 public static String getCertificateSHA1Fingerprint(Context context) { //获取包管理器 PackageManager pm = context.getPackageManager(); //获取当前要获取SHA1值的包名,也可以用其他的包名,但需要注意
2018-04-11 08:38:10
897
原创 依赖
compile 'io.reactivex.rxjava2:rxjava:2.0.1' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson
2018-04-07 11:54:06
182
原创 图片放大缩小
https://blog.youkuaiyun.com/lmj623565791/article/details/49300989/https://blog.youkuaiyun.com/u011710991/article/details/52219648
2018-04-07 11:44:28
446
原创 上传文件的工具类
compile 'io.reactivex.rxjava2:rxjava:2.0.1' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson
2018-04-06 14:56:42
433
原创 报错解决
https://www.2cto.com/kf/201803/726719.htmlhttps://blog.youkuaiyun.com/sparkleyn/article/details/79027796java.lang.NoClassDefFoundError: android.support.v4.animation.AnimatorCompatHelper解决: 把这个放到app build...
2018-04-05 17:38:11
278
原创 参考
@Overridepublic void jisuan() { double he=0; int count = 0; for (int i = 0; i <data.size() ; i++) { List<Cart_bean.DataBean.ListBean> list = data.get(i).getList(); ...
2018-04-05 17:05:06
129
原创 图片选择器photopicker
http://blog.youkuaiyun.com/u010046908/article/details/50767904http://blog.youkuaiyun.com/a2978157/article/details/74644414
2018-03-20 18:37:13
1541
原创 购物车
v层代码public class Showcart extends Baseactivity implements Ishowcart{ @BindView(R.id.bianji) TextView bianji; @BindView(R.id.edlist) ExpandableListView edlist; @BindView(R.id
2018-03-04 21:53:25
258
原创 使用BigDecimal类处理高精度计算
Java在java.math包中提供的API类BigDecimal,用来对超过16位有效位的数进行精确的运算。双精度浮点型变量double可以处理16位有效数,但在实际应用中,可能需要对更大或者更小的数进行运算和处理。一般情况下,对于那些不需要准确计算精度的数字,我们可以直接使用Float和Double处理,但是Double.valueOf(String) 和Float.valueOf(Strin
2018-03-04 13:28:24
227
原创 Banner屏幕适配
// 502/185f为网络图片的宽高比float ratio=502/185f;//banner为Banner的idViewGroup.LayoutParams layoutParams = banner.getLayoutParams(); layoutParams.width = getResources().getDisplayMetrics().widthPix
2018-03-03 23:07:12
1417
原创 倒计时代码
public class MainActivity extends AppCompatActivity { private long time=10000; Handler handler=new Handler(); private TextView miaosha_time_hour; private TextView miaosha_time_minu
2018-03-03 19:39:31
411
原创 自定义购物车加减控件
public class Jiajian extends LinearLayout implements View.OnClickListener {private Button tvDecrease;private Button tvIncrease;private Button etNumber;private Context context;//定一个商品默认数量privat
2018-03-02 23:12:24
243
原创 自定义留声机
public class GramophoneView extends View { /** * 尺寸计算设计说明: * 1、唱片有两个主要尺寸:中间图片的半径、黑色圆环的宽度。 * 黑色圆环的宽度 = 图片半径的一半。 * 2、唱针分为“手臂”和“头”,手臂分两段,一段长的一段短的,头也是一段长的一段短的。 * 唱针四个部分
2018-03-02 22:39:21
174
原创 自定义Banner
compile 'com.github.bumptech.glide:glide:3.7.0'public class Banner extends FrameLayout implements ViewPager.OnPageChangeListener { private final int DELAY_TIME = 5000;//自动轮播时间 private
2018-03-02 10:00:25
325
原创 仿京东上拉详情展示Webview
compile 'com.android.support:design:22.2.1' xml version="1.0" encoding="utf-8"?>com.example.webxiangqing.PageContainer android:id="@+id/container" android:layout_width="match_parent" andr
2018-02-11 14:04:53
311
原创 xrecyclerview状态栏渐变
private int mDistanceY;f1_frag为标题栏 也就是搜索栏的idxrc.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
2018-02-09 12:33:59
268
原创 京东快报
xml version="1.0" encoding="utf-8"?>LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main"
2018-02-09 12:28:58
914
原创 倒计时代码
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" xmlns:tools="http://schemas.and
2018-02-09 11:14:22
351
原创 双击图片放大缩小
package com.example.administrator.jingdong.view;import android.content.Context;import android.graphics.Matrix;import android.graphics.RectF;import android.graphics.drawable.Drawable;import andro
2018-02-09 10:51:49
199
转载 5分钟实现Android中更换头像功能
下面我们直接看看完整吧:public class UserActivity extends BaseActivity implements OnClickListener { private ImageView iv_photo; private Bitmap head;// 头像Bitmap private static String path = "/sdcar
2018-02-05 19:09:44
1135
原创 Retrofit+RxJava上传文件和头像
compile 'io.reactivex.rxjava2:rxjava:2.0.1' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson
2018-02-02 00:20:52
1728
原创 Retrofit+RxJava+Okhttp拦截器
compile 'io.reactivex.rxjava2:rxjava:2.0.1' compile 'io.reactivex.rxjava2:rxandroid:2.0.1' compile 'com.squareup.retrofit2:retrofit:2.3.0' compile 'com.squareup.retrofit2:converter-gson
2018-01-30 21:39:19
854
原创 RecyclerView多条目加载
//泛型必须为RecyclerView.ViewHolderpublic class Myadapter extends RecyclerView.Adapter { //定义常量 确定多条目加载类型 final static int TYPE_ONE=1; final static int TYPE_TWO=2; final static int TYPE_T
2018-01-28 22:23:27
245
原创 retrofit
compile 'com.squareup.retrofit2:retrofit:2.0.2'compile 'com.squareup.retrofit2:converter-gson:2.0.2'//自定义接口 存放uri串public interface Getnet { //retrofit要求有一个根地址,此处我们用主机域名作为根地址,/严格要求必须有
2018-01-27 16:43:53
176
原创 greendao
在project里面导入classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'然后在module的gradle文件中添加greenDAO的插件,并引入相关类库,apply plugin: 'org.greenrobot.greendao'compile 'org.greenrobot:greenda
2018-01-26 22:00:01
383
原创 ButterKnife
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'在project里面配置build.gradle module里面配置以下两个apply plugin: 'com.jakewharton.butterknife'compile 'com.jakewha
2018-01-25 20:47:58
269
原创 EventBus
compile 'org.greenrobot:eventbus:3.0.0' //第一种传值 回调传值 相当于startActivityForResult(); 回调传值在要接受消息的页面注册EventBus.getDefault().register(this);在要接受消息的页面取消注册 @Overr
2018-01-25 19:39:03
160
原创 android注解与反射
5. 限定注解的使用范围@TargetTYPE: 用于类,接口,枚举但不能是注解 FIELD: 字段上,包括枚举值 METHOD: 方法,不包括构造方法 PARAMETER: 方法的参数 CONSTRUCTOR: 构造方法 LOCAL_VARIABLE: 本地变量或catch语句 ANNOTATION_TYPE: 注解类型(无数据) PACKAGE: Java包
2018-01-24 21:20:50
309
原创 购物车切换练习
//MainActivity类public class MainActivity extends AppCompatActivity implements Iview,View.OnClickListener{ private XRecyclerView xrc; private Myadapter myadapter; private Presenter p
2018-01-17 14:43:34
272
原创 ScrollView+RecyclerView优雅的解决滑动冲突问题
ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">android.support.v4.widget.NestedScrollView xm
2018-01-15 22:45:00
1068
原创 Android--------使用BottomTabBar实现底部导航页
注:详细见链接http://www.jianshu.com/p/ade8485a16be1.导依赖compile 'com.hjm:BottomTabBar:1.1.1'2.在XML中定义一下该控件com.hjm.bottomtabbar.BottomTabBar android:id="@+id/bottom_tab_b
2018-01-15 19:49:39
244
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人