- 博客(54)
- 收藏
- 关注
原创 网络状态码
事件 错误码 含义 SDK处理方式 建议业务方处理方式200 成功joinRoom/token/reconnected 400 数据格式错误,非json数据 调试信息,正常版本100%不可能出现这种情况 401 没有携带authorization字段500 rpc 错误 重试3次,如果还失败,向业务方报warning:BRERR_JOIN_ROOM_WARNING,继续重试,无限重试...
2019-12-29 23:54:06
1044
原创 12
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#0000"/> <stroke android:width="1dp" ...
2019-06-03 13:04:41
182
原创 1圆
导入依赖把image改成 <com.facebook.drawee.view.SimpleDraweeViewandroid:layout_width=“150dp”android:layout_height=“150dp”fresco:roundAsCircle=“true”android:id="@+id/my_image"/>## 适配器 String image...
2019-06-03 13:03:20
251
原创 GlideCaChe
@GlideModulepublic class GlideCache extends AppGlideModule {@Overridepublic void applyOptions(Context context, GlideBuilder builder) {int diskCacheSizeBytes = 1024 * 1024 * 100; // 100 MB//手机app路...
2019-06-03 10:19:08
2128
原创 二级分类porowindow
第一步定义布局 定义两个布局 RecyclerView展示页面首页package com.bawei.moni;import android.graphics.Color;import android.graphics.drawable.ColorDrawable;import android.support.v7.app.ActionBar;import android.sup...
2019-06-02 21:57:35
229
原创 photoView
//控件<uk.co.senab.photoview.PhotoViewandroid:id="@+id/image_mian2"android:layout_width=“wrap_content”android:layout_height=“wrap_content”android:layout_gravity=“center”android:src="@drawable/i...
2019-06-02 21:27:41
178
原创 PopWindow弹框三级列表
public class MainActivity extends AppCompatActivity implements Contract.Iview {private Presenter presenter;private RecyclerView recycler_frist;private SouView sou_view;private ImageView image_list...
2019-06-02 21:22:58
272
原创 详情
package com.bawei.article520.commoditytab;import android.content.Intent;import android.util.Log;import android.view.View;import android.webkit.WebView;import android.webkit.WebViewClient;import...
2019-05-26 21:57:54
140
原创 登录 注册
**## 登录package com.bawei.article520.tab;import android.content.Context;import android.content.Intent;import android.content.SharedPreferences;import android.os.Bundle;import android.support.anno...
2019-05-26 21:39:49
187
原创 MainActivity页面
public class MainActivity extends AppCompatActivity implements Contract.Iview, View.OnClickListener {private TextView title;private RecyclerView recycler_view;private Presenter presenter;private C...
2019-05-19 20:43:34
454
原创 商家的适配器
public class ShowAdapter extends RecyclerView.Adapter<ShowAdapter.ViewHolder> {private List<DataBean> list;private Context context;public ShowAdapter(List<DataBean> list, Context ...
2019-05-19 20:41:20
166
原创 商品的适配器
public class ListAdapter extends RecyclerView.Adapter<ListAdapter.ViewHolder> {private List<ListBean> list;private Context context;private ShopListCallBack mlisenterShop;private int nu...
2019-05-19 20:40:26
139
原创 购物车加减器
public class Adder extends LinearLayout {public AdderListener lisener;public TextView et_num;public TextView del;public TextView add;//对外提供一个点击的回调接口public interface AdderListener{ void onAtt...
2019-05-19 20:25:19
153
原创 greenDao
在bean类中添加一个主键例: @Id(autoincrement = true,可写可不写)private Long pid;自动生成:DaoMaster,DaoSession,(ResultBean//与Bean类名称相同)Daoprivate void initDB() {DaoMaster.DevOpenHelper helper = new DaoMaster.DevOpenH...
2019-05-19 20:12:54
168
原创 Retrofit+RxJava
public class RetrofitUtil {private static final RetrofitUtil ourInstance = new RetrofitUtil();private final Apis apis;public static RetrofitUtil getInstance() { return ourInstance;}private f...
2019-05-19 20:02:22
151
原创 动态背景选择器
在colors.xml中写入你要使用的两个颜色#E6BACA#B9DFF3在drawable中新建一个 xml页面在Bean类中添加boolean的值private boolean isSelect=false;在适配器中写入获取Bean类中的isSletect的值viewHolder.itemView.setSelected(list.get(i).getIsSelect()...
2019-05-19 19:53:38
159
原创 加减器
新建class类package com.bawei.goshop.AddDow;import android.content.Context;import android.util.AttributeSet;import android.view.LayoutInflater;import android.view.View;import android.widget.Button;...
2019-05-18 15:38:48
131
原创 tablayout跳转和EventBus传值
第一依赖//EventBus依赖 implementation'org.greenrobot:eventbus:3.0.0'在MainActivity写 这是跳转获取数据 public void Jump(){ pager.setCurrentItem(1); }在Adapter里面写点击事件发送传值 //接口 onClink onClink;...
2019-05-12 21:33:20
247
原创 电商二上拉刷新和下拉加载
在展示页面写首先定义有个handler private Handler handler=new Handler();用一个数据名 //刷新 xRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() { @Override public voi...
2019-05-12 21:22:59
123
原创 OKHttp网络框架
package com.bawei.a512.app;import android.os.Handler;import java.io.IOException;import java.util.Map;import java.util.concurrent.TimeUnit;import okhttp3.Call;import okhttp3.Callback;import o...
2019-05-12 21:14:03
262
原创 跳转传值
在点击跳转按钮的页面写Intent intent = new Intent();String name = list.get(potion).getCommodityName();String pic = list.get(potion).getMasterPic();int price = list.get(potion).getPrice();intent.putExtra(“nam...
2019-05-05 20:31:13
160
原创 首页fragment
public class MainActivity extends AppCompatActivity {private BottomTabBar bottom;@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setConten...
2019-05-05 20:17:11
118
原创 异常捕获
public class YiChang implements Thread.UncaughtExceptionHandler {private static YiChang yiChang=new YiChang();public YiChang(){}public static synchronized YiChang getInstance(){ if (yiChang=...
2019-05-05 15:48:57
77
原创 二级联动
public class Main2Activity extends AppCompatActivity implements Cantract.Iview {private RecyclerView recycler_left;private RecyclerView recycler_right;private Presenter presenter;private String ur...
2019-05-05 15:38:24
110
转载 属性动画
translationX和translationY:增量控制view从它布局容器左上角坐标偏移ObjectAnimator.ofFloat(imageView, “translationX”, 300f);rotation、rotationX、rotationY:控制view绕支点进行2D或3D旋转ObjectAnimator.ofFloat(imageView, “rotation”, 3...
2019-05-05 14:20:05
79
原创 画圆
public class Yuan extends View {private Paint paint;public Yuan(Context context) { super(context);}public Yuan(Context context, AttributeSet attrs) { super(context, attrs);}public Yu...
2019-05-05 11:31:18
109
原创 折线图+自定义属性
public class ZheView extends View {private Paint paint;private final static int textSize=20;private final static int startX=100;private final static int startY=800;private Path path;private int ...
2019-05-05 11:19:54
134
原创 xRecyclerView
导入依赖implementation ‘com.android.support:recyclerview-v7:28.0.0’implementation ‘com.jcodecraeer:xrecyclerview:1.3.2’//xrecyclerview的依赖编译出错问题implementation ‘com.android.support:design:28.0.0’//写完列表...
2019-05-05 10:39:56
119
原创 js交互点击按钮
public class FragTwo extends Fragment {private Button btn;@Nullable@Overridepublic View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanc...
2019-05-04 20:53:45
582
原创 搜索+流式布局+RecyclerView
流式布局,继承ViewGrouppublic class LiuView extends ViewGroup {public LiuView(Context context) { super(context);}public LiuView(Context context, AttributeSet attrs) { super(context, attrs);}p...
2019-04-27 19:28:43
213
原创 折线图
//新建一个类,继承Viewpublic class ZheView extends View {private Paint paint;private Path path;private final static int textSize=20;private final static int startX=100;private final static int startY=80...
2019-04-27 19:17:39
86
原创 xbanner+RecyclerView的Activity
public class MainActivity extends AppCompatActivity implements Contract.Iview {private Presenter presenter;private String url="http://172.17.8.100/small/commodity/v1/commodityList";private String...
2019-04-20 17:08:25
335
原创 子Adapter
public class RxxpAdapter extends RecyclerView.Adapter<RxxpAdapter.ViewHolder> {RecyBean.ResultBean.RxxpBean rxxpBean;Context context;public RxxpAdapter(RecyBean.ResultBean.RxxpBean rxxpBean,...
2019-04-20 17:07:06
233
原创 recyclerViewAdapter
public class ShowAdapter extends RecyclerView.Adapter {Context context;RecyBean showBean;XbannerBean xbannerBean;int XbannerType=0;int RxxpType=1;int MlssType=2;int PzshType=3;private RecyBean...
2019-04-20 17:06:06
1938
原创 登录
Activity页面public class Main2Activity extends AppCompatActivity implements LogContract.ILogview {private LogPresenter logPresenter;private EditText phone;private EditText pwd;private Button login;...
2019-04-20 17:04:02
223
原创 RecyView多条目
public class ShowAdapter extends RecyclerView.Adapter {int XbnnerType=0;int RxxpType=1;int PzshType=2;int MlssType=3;private Context context;private RecyBean showBean;private BannerBean showxba...
2019-04-20 09:40:22
213
原创 RecyclerAdapter
public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder> { List<RecyclerBean.ResultBean> list; Context context;private View view;public MyAdapter(List<RecyclerBean...
2019-04-17 21:05:10
378
原创 RecyclerActivity
public class MainActivity extends AppCompatActivity implements Contract.Iview {private Presenter presenter;private String url="http://172.17.8.100/movieApi/movie/v1/findReleaseMovieList?page=1&c...
2019-04-17 21:01:48
117
原创 Volley的Contract+Model+Presenter
//Contractpublic interface Contract {//Iviewinterface Iview{void getRequest(String data);}//Imodelinterface Imodel{void getShow(Context context,String url,CallBack scallBack);interface CallBa...
2019-04-17 20:57:37
131
原创 Volley框架
//创建一个类,继承Addlicationpublic class MyApp extends Application {private static RequestQueue queue;@Overridepublic void onCreate() { super.onCreate(); queue = Volley.newRequestQueue(getApplica...
2019-04-17 20:19:28
452
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人