自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 收藏
  • 关注

原创 MVP+Retrofit+RXJAVA(新)

APi public interface Api { @GET io.reactivex.Observable getData(@Url String url); } Retrofit public class OkHttpRetrofit { public final Api api; private OkHttpRetrofit(){ final Retrofit build=new...

2019-04-07 11:48:36 201

原创 购物车-逻辑(全选+价格联动)

先写网络封装+工具类 APi public interface Api { @GET(“ks/product/getCarts?uid=51”) Observable getgouwuche(); } Retrofit public class Ulit { public Api api; private static final Ulit ULIT = new Ulit(); public U...

2019-04-07 11:42:59 439

原创 Switch+Notification实现推送(简单)

Switch控件 黄油刀绑定 @BindView(R.id.ts_switch) Switch tsSwitch; ButterKnife.bind(this); //拿到Notification NotificationManager notificationManager= (NotificationManager) getSystemService(Context.NOTIFICATI...

2019-03-29 11:51:45 296

原创 适配器

public class ShopAdapter extends RecyclerView.Adapter<ShopAdapter.ViewHolder> { MainActivity mainActivity; private List<ShopBean.ResultBean> list; public ShopAdapter(MainActivity mainActiv...

2019-03-25 07:42:30 178

原创 Retrofit+RXJAVA+MVP网络请求框架

首先写一个工具类: @GET Observable get(@Url String url); 网络请求封装: public final APi aPi; private OkUtilsRetrofit(){ final Retrofit retrofit = new Retrofit.Builder() .addCallAdapterFactory(RxJava...

2019-03-25 07:38:12 155

原创 GreenDao实现无网展示数据库

先写一个数据库的Bean 添加注解@Entity @id 添加自己需要的数据 生成三个类 判断网络的类 Work //判断网络 public static boolean newwork(Context context) { ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CO...

2019-03-17 21:27:30 229

原创 自定义View实现波浪

新建一个工具类 继承View实现 onMeasure() onLayout() OnDraw()三个方法 具体实现如下: public class Views extends View { private Paint paint; private Path path; float A=8f; float w; float k=0f; float f; float y; private Paint...

2019-03-14 15:29:35 294

原创 购物车

public class MainActivity extends AppCompatActivity implements IMainView { private ExpandableListView expandble; private TextView zong; private CheckBox quanxuan; private ShopPresenter shopPresenter; ...

2019-03-08 13:28:24 173

原创 线程异常捕获(超简单)

第一步: 新建一个异常捕获类; 第二步: public class YCBHactivity implements Thread.UncaughtExceptionHandler { @Override public void uncaughtException(Thread t, Throwable e) { Log.i(“AA”,“线程”+t.getName()+“错误”+e.getMess...

2019-03-08 10:01:11 465

原创 JS交互(本地)

第一步: 现在main下面新建一个assets文件夹; 第二步: 存一个本地的HTML文件; 第三步: //点击按钮 webView = findViewById(R.id.webview); button = findViewById(R.id.btn); button.setOnClickListener(new View.OnClickListener() ...

2019-03-08 08:54:35 504

原创 二级列表(适配器)

public class ShoppingCartAdapter extends BaseExpandableListAdapter { private Context mContext; private ShoppingCartBean mShoppingCartBean; public ShoppingCartAdapter(Context context){ this.mContext = ...

2019-03-07 20:31:13 226

原创 全局捕获异常(完整)

public class UnCatchExceptionHandler implements Thread.UncaughtExceptionHandler { private Context mContext; private Thread.UncaughtExceptionHandler mHandler; // 保存手机信息和异常信息 private Map&lt;String, Stri...

2019-03-07 19:05:59 1337

原创 三级列表展示加联动(仿京东)

写三个接口: public interface IBanintenter { void getyou(String s); } public interface IManintenter { void getview(String s); } public interface IMZintrnter { void getstring(String s); } presenter 左右 ...

2019-03-04 08:07:54 696

原创 新!!!登录

public class MainActivity extends AppCompatActivity implements IManintenter { private String path=“http://172.17.8.100/small/user/v1/login”; private EditText name; private EditText pwd; private Button...

2019-02-25 20:25:11 134

原创 展示数据的适配器

package com.example.zh.week2.view.adapter; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater;...

2019-02-25 19:55:44 167

原创 (初学)注册

MVP接口回调的方式实现 //View public class ZhuChe extends AppCompatActivity implements IManintenter { private Button zcbutton; private EditText name; private EditText pwd; private String path = "http://172.17.8...

2019-02-25 19:54:52 117

原创 OkHttp网络封装(登录,注册,请求数据)

public class Okhttp { //单例 private final static Okhttp OKHTTP = new Okhttp(); public Okhttp() { } public static Okhttp getdanli() { return OKHTTP; } // get请求接口数据 public void get(String url, fin...

2019-02-25 19:10:51 617

原创 简单登录

Activity public class MainActivity extends AppCompatActivity implements LoginView { @BindView(R.id.edit_name) EditText editName; @BindView(R.id.edit_pwd) EditText editPwd; @BindView(R.id.but_login) Bu...

2019-01-20 10:34:07 231

原创 购物车详情

购物车 详情 第一步 依赖权限 implementation ‘com.google.code.gson:gson:2.8.5’ implementation ‘com.squareup.okhttp3:okhttp:3.7.0’ implementation ‘com.squareup.okio:okio:1.12.0’ implementation ‘com.jakewharton:butte...

2019-01-18 20:53:00 147

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除