- 博客(36)
- 收藏
- 关注
原创 全选全不选+商家选中子条目选中+联动价格
定义一个接口public interface CartCallback {void notifyCartItem(boolean isChecked,int position);void notifynum();}在定义一个接口public interface CartUICallback {void notifyCart();}二级适配器public class CartsA...
2019-04-07 11:43:53
193
原创 6.0动态权限+上传头像+相机+相册+弹框
主页面图片的点击事件里面//6.0动态权限@OnClick(R.id.simp_img)public void onViewClicked() {simpImg.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {if (Build.VERSION.SDK_INT &...
2019-04-07 10:12:05
192
原创 购物车二级列表+全选全不选+联动价格
二级适配器public class CartsAdapter extends RecyclerView.Adapter<CartsAdapter.ViewHolder> {private Context context;private List<CartBean.DataBean.ListBean> cartsdata;public CartsAdapter(Con...
2019-04-07 09:49:50
315
原创 6.0动态权限+打开相册上传
在主页面给图片一个点击事件//6.0动态权限@OnClick(R.id.simp_img)public void onViewClicked() {simpImg.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {if(Build.VERSION.SDK_INT&g...
2019-04-07 09:40:13
180
原创 EventBus详情+搜索
适配器public class SreachAdapter extends RecyclerView.Adapter<SreachAdapter.ViewHolder> {private Context context;private List<SreachBean.ResultBean> sreachdata;public SreachAdapter(Contex...
2019-04-07 09:37:02
155
原创 EventBus详情
适配器//详情接口private HomeItemOnClick homeItemOnClick;public void setHomeItemOnClick(HomeItemOnClick homeItemOnClick){this.homeItemOnClick=homeItemOnClick;}public interface HomeItemOnClick{void Oncl...
2019-04-06 19:53:12
125
原创 自定义流式布局
主页面public class MainActivity extends AppCompatActivity {private EditText viewShu;private Button viewShou;private LiuShiView history;@Overrideprotected void onCreate(Bundle savedInstanceState) {...
2019-04-06 19:07:34
135
原创 EventBus
Adapter中设置条目点击事件viewHolder.itemView.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) { EventBus.getDefault().postSticky(pzshdata.get(i).getCommodityNa...
2019-03-17 21:19:06
126
原创 XRecyclerView刷新加载
首先实现XRecyclerView会生成两个方法在initView写上//加载更多xrv1.setLoadingMoreEnabled(true);//加载刷新监听xrv1.setLoadingListener(this);生成的方法@Overridepublic void onRefresh() {//停止刷新xrv1.refreshComplete();}@Overr...
2019-03-17 21:12:32
204
原创 高德地图
首先在高德地图上注册配置导入依赖//3D地图so及jarimplementation ‘com.amap.api:3dmap:latest.integration’//定位功能implementation ‘com.amap.api:location:latest.integration’//搜索功能implementation ‘com.amap.api:search:late...
2019-03-07 16:45:09
370
原创 购物车+全选+计算总价+加减按钮
RetrofitUtilspublic class RetrofitUtils {private MyService myService;private RetrofitUtils(){ HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(); interceptor.setLevel(HttpLo...
2019-03-04 08:18:32
1121
原创 Fresco动画
依赖/fresco依赖/implementation ‘com.facebook.fresco:fresco:1.5.0’// 支持 GIF 动图,需要添加implementation ‘com.facebook.fresco:animated-gif:1.5.0’主布局<LinearLayout xmlns:android="http://schemas.android.com...
2019-02-17 20:25:11
326
原创 Retrofit+Fresco+MVP展示
RestrofitUtilspublic class RestrofitUtils {private final MyApiService myApiService;private RestrofitUtils(){ //日志拦截器 HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(...
2019-02-17 20:20:34
223
原创 FlyBanner+RecyclerView显示+MVP
HomeOkHttpUtilspublic class HomeOkHttpUtils {private Handler handler=new Handler();private static HomeOkHttpUtils mInstance;private OkHttpClient okHttpClient;//私有构造private HomeOkHttpUtils(){ ...
2019-01-20 13:23:24
141
原创 XRecyclerView+MVP+全选全不选+局部选择+计算总价+刷新
ShowOkHttpUtilspublic class ShopOkHttpUtils {private Handler handler=new Handler();private static ShopOkHttpUtils mInstance;private OkHttpClient okHttpClient;//私有构造private ShopOkHttpUtils(){ ...
2019-01-20 10:25:48
305
原创 XRecyclerView+MVP+glide显示
OkHttpUtilspublic class OkHttpUtils {private Handler handler=new Handler();private static OkHttpUtils mInstance;private OkHttpClient okHttpClient;//私有构造private OkHttpUtils(){ //日志拦截 Http...
2019-01-20 09:52:06
159
原创 XRecyclerView+MVP+全选全不选+接口回调+购物车二级列表
//OkHttpUtilspublic class OkHttpUtils {private Handler handler=new Handler();private OkHttpClient okHttpClient;private static OkHttpUtils mInstance;/** * 私有构造 */private OkHttpUtils(){ Http...
2019-01-16 20:53:41
282
1
原创 全选全不选
//全选全不选checkbox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {@Overridepublic void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {if (isChecked){for (C...
2019-01-16 19:49:08
310
原创 扫一扫+生成二维码
//权限<uses-feature android:name="android.hardware.camera" /><uses-feature android:name="android.hardware.camera.autofocus" /><uses-permission android:name="android.permission.VIBRA...
2019-01-14 16:19:45
185
原创 二维码扫一扫
//导依赖//二维码implementation ‘cn.yipianfengye.android:zxing-library:2.2’//apppublic class APP extends Application {@Overridepublic void onCreate() {super.onCreate();ZXingLibrary.initDisplayOpinion...
2019-01-14 14:12:49
370
原创 MVP登录
//OkHttpUtilspublic class OkHttpUtils {private Handler handler=new Handler();private OkHttpClient okHttpClient;private static OkHttpUtils mInstance;/*** 私有构造*/private OkHttpUtils(){HttpLoggin...
2019-01-13 19:45:24
142
原创 二维码
首先导依赖//如果导完这个包报错就把上面的minSdkVersion 改为16implementation ‘com.github.yuzhiqiang1993:zxing:2.1.4’implementation ‘com.android.support:design:28.0.0’//在根build.grand里面添加 maven { url ‘https://jitpack.io...
2019-01-12 14:50:32
166
原创 动画+RecyclerView+fragment+viewpager联动
//main2Activitypublic class Main2Activity extends AppCompatActivity {private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener = new BottomNavigationVie...
2019-01-06 19:36:49
775
原创 RecyclerView
//mainpublic class MainActivity extends AppCompatActivity implements DataView {private RecyclerView main_recyclerView;private Adapter adapter;@Overrideprotected void onCreate(Bundle savedInstanc...
2019-01-01 20:30:08
108
原创 pulltorefresh+Imageloader+数据库+判断网络
//mian主页面import android.os.AsyncTask;import android.os.Bundle;import android.support.annotation.NonNull;import android.support.annotation.Nullable;import android.support.v4.app.Fragment;import a...
2018-12-20 11:01:41
149
原创 PulltoRefresh上拉下拉双页面+Imageloader
//mian主页面import android.graphics.pdf.PdfDocument;import android.os.AsyncTask;import android.os.Bundle;import android.support.annotation.NonNull;import android.support.annotation.Nullable;import ...
2018-12-19 19:33:34
128
原创 PulltoRefresh上拉下拉+Imageloader
//mian主页面import android.graphics.pdf.PdfDocument;import android.os.AsyncTask;import android.os.Bundle;import android.support.annotation.NonNull;import android.support.annotation.Nullable;import ...
2018-12-19 19:13:18
122
原创 Handler倒计时
//main主页面import android.content.Intent;import android.os.Handler;import android.os.Message;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.widget.TextView...
2018-12-19 19:05:38
117
原创 Bnaner+pulltorfresh
//mian布局<?xml version="1.0" encoding="utf-8"?><com.recker.flybanner.FlyBanner android:id="@+id/banner" android:layout_width="match_parent" android:layout_height="200dp"&a
2018-12-17 08:01:39
120
原创 Base基类+侧拉+ViewPager
//mian主页面import android.support.annotation.NonNull;import android.support.design.widget.BottomNavigationView;import android.support.v4.app.Fragment;import android.support.v4.app.FragmentPagerAdapt...
2018-12-16 19:56:47
171
原创 ViewPager+侧拉
//mian主页面package com.example.tablatout.activity;import android.os.Bundle;import android.support.annotation.NonNull;import android.support.design.widget.BottomNavigationView;import android.support...
2018-12-14 15:36:41
134
原创 Tablayout
//布局<?xml version="1.0" encoding="utf-8"?><android.support.design.widget.TabLayoutandroid:id="@+id/tab"android:layout_width=“match_parent”android:layout_height=“0dp”android:layout_weig...
2018-12-14 15:32:13
165
原创 Bnaner轮播图+XListview
//布局<com.recker.flybanner.FlyBannerandroid:id="@+id/banner"android:layout_width=“match_parent”android:layout_height=“200dp”></com.recker.flybanner.FlyBanner><me.maxwin.view.XListVi...
2018-12-13 10:39:40
192
原创 多条目+XListview+上拉+下拉
mian主页package com.example.weektwo;import android.os.AsyncTask;import android.os.Bundle;import android.support.annotation.NonNull;import android.support.annotation.Nullable;import android.support...
2018-12-09 19:08:09
127
原创 侧拉
侧拉<android.support.v4.view.ViewPagerandroid:id="@+id/viewpager"android:layout_width=“match_parent”android:layout_height=“0dp”android:layout_weight=“9”></android.support.v4.view.ViewPag...
2018-12-09 19:01:36
143
原创 **HTTPURLConnection网络请求**
MainActivity.javapackage com.example.week02;import android.os.AsyncTask;import android.support.v7.app.AppCompatActivity;import android.os.Bundle;import android.view.View;import android.widget.Li...
2018-12-05 20:12:11
168
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人