- 博客(14)
- 收藏
- 关注
原创 上传文件简单写法
RequestBody body = RequestBody.create(MediaType.parse("application/otcet-stream"),file); MultipartBody.Part part = MultipartBody.Part.createFormData("image", file.getName(), body); @Override...
2019-05-06 13:45:39
627
原创 判断网络
//判断网络public static boolean isNetUtils(Context context){ ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); ...
2019-04-15 00:23:36
107
原创 自定义缓存路径
private static int DiskSize = 30*ByteConstants.MB; //缓存大小final DiskCacheConfig diskCacheConfig = DiskCacheConfig.newBuilder(this).setBaseDirectoryPath(Environment.getExternalStorageDirectory()).set...
2019-04-15 00:11:51
173
原创 自定义加减器
public class SubAndButton extends LinearLayout {public TextView jiajianqi_jia;public TextView jiajianqi_jian;public TextView jiajianqi_tv;private onNumChangeListener onnumchanglistener;public ...
2019-04-07 12:58:29
160
原创 流式布局
public class Zidingyi extends ViewGroup {public Zidingyi(Context context) { super(context);}public Zidingyi(Context context, AttributeSet attrs) { super(context, attrs);}public Zidingy...
2019-04-07 12:52:52
140
原创 异常捕获
Context contex;private static T t;private T(){}//单例public static T GetInstance(){if (t==null){t = new T();}return t;}public void init(Context context){ this.contex = context; Thread...
2019-04-06 20:17:19
100
原创 波浪线
Paint paint = new Paint();Path path = new Path();float mt;public WaterView2(Context context) { super(context); paint.setAntiAlias(true);}public WaterView2(Context context, AttributeSet ...
2019-04-06 20:16:15
213
原创 流式布局的详细介绍
package com.bwei.liulayout;import android.content.Context;import android.util.AttributeSet;import android.view.ViewGroup;public class Liu extends ViewGroup {int mleftMagin=20;int mtopMagin=20;p...
2019-03-25 08:22:23
322
原创 自定义view
package com.bawei.demo.myapplication;import android.content.Context;import android.os.Build;import android.support.annotation.RequiresApi;import android.util.AttributeSet;import android.view.Layo...
2019-03-25 08:21:07
131
原创 判断记住密码
sp = getSharedPreferences(“login”, Context.MODE_PRIVATE); boolean check = sp.getBoolean("check", false); if (check) { String phone1 = sp.getString("phone", ""); String pwd1 = s...
2019-03-25 08:09:53
121
原创 画圈与画线
Paint paint = new Paint();paint.setStrokeWidth(5);paint.setColor(Color.BLACK);paint.setStyle(Paint.Style.FILL);canvas.drawCircle(66,66,66,paint);canvas.drawLine(-150,0,300,300,paint);
2019-03-25 08:06:01
250
原创 动画
xuanzhuan = findViewById(R.id.xuanzhuan);suofang = findViewById(R.id.suofang);pingyi = findViewById(R.id.pingyi);jianbian = findViewById(R.id.jianbian);object = findViewById(R.id.object);value = ...
2019-03-25 08:04:21
97
原创 适配器
package com.bawei.demo.lianxi2.adapter;import android.content.Context;import android.support.annotation.NonNull;import android.support.v7.widget.RecyclerView;import android.view.LayoutInflater;im...
2019-03-17 21:06:50
97
原创 okhttp
package com.bawei.demo.lianxi2.okhttp;import android.os.Environment;import android.os.Handler;import android.util.Log;import com.google.gson.Gson;import java.io.File;import java.io.IOException;...
2019-03-17 21:04:22
99
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人