- 博客(19)
- 收藏
- 关注
原创 MVP+Retrofit+RXJAVA(新)
APipublic interface Api {@GETio.reactivex.Observable getData(@Url String url);}Retrofitpublic class OkHttpRetrofit {public final Api api;private OkHttpRetrofit(){ final Retrofit build=new...
2019-04-07 11:48:36
152
原创 购物车-逻辑(全选+价格联动)
先写网络封装+工具类APipublic interface Api {@GET(“ks/product/getCarts?uid=51”)Observable getgouwuche();}Retrofitpublic class Ulit {public Api api;private static final Ulit ULIT = new Ulit();public U...
2019-04-07 11:42:59
390
原创 Switch+Notification实现推送(简单)
Switch控件黄油刀绑定@BindView(R.id.ts_switch)Switch tsSwitch;ButterKnife.bind(this);//拿到NotificationNotificationManager notificationManager= (NotificationManager) getSystemService(Context.NOTIFICATI...
2019-03-29 11:51:45
240
原创 适配器
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
131
原创 Retrofit+RXJAVA+MVP网络请求框架
首先写一个工具类:@GETObservable get(@Url String url);网络请求封装:public final APi aPi;private OkUtilsRetrofit(){ final Retrofit retrofit = new Retrofit.Builder() .addCallAdapterFactory(RxJava...
2019-03-25 07:38:12
107
原创 GreenDao实现无网展示数据库
先写一个数据库的Bean添加注解@Entity @id添加自己需要的数据生成三个类判断网络的类Work//判断网络public static boolean newwork(Context context){ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CO...
2019-03-17 21:27:30
191
原创 自定义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
246
原创 购物车
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
140
原创 线程异常捕获(超简单)
第一步:新建一个异常捕获类;第二步:public class YCBHactivity implements Thread.UncaughtExceptionHandler {@Overridepublic void uncaughtException(Thread t, Throwable e) {Log.i(“AA”,“线程”+t.getName()+“错误”+e.getMess...
2019-03-08 10:01:11
399
原创 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
439
原创 二级列表(适配器)
public class ShoppingCartAdapter extends BaseExpandableListAdapter {private Context mContext;private ShoppingCartBean mShoppingCartBean;public ShoppingCartAdapter(Context context){this.mContext = ...
2019-03-07 20:31:13
178
原创 全局捕获异常(完整)
public class UnCatchExceptionHandler implements Thread.UncaughtExceptionHandler {private Context mContext;private Thread.UncaughtExceptionHandler mHandler;// 保存手机信息和异常信息private Map<String, Stri...
2019-03-07 19:05:59
1266
原创 三级列表展示加联动(仿京东)
写三个接口: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
624
原创 新!!!登录
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
97
原创 展示数据的适配器
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
120
原创 (初学)注册
MVP接口回调的方式实现//Viewpublic 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
78
原创 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
571
原创 简单登录
Activitypublic 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
175
原创 购物车详情
购物车 详情第一步 依赖权限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
106
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人