- 博客(35)
- 收藏
- 关注
原创 zl_Refresh
//成功@Overridepublic void success(Object obj) {final CircleBean circleBean= (CircleBean) obj;if (page==1){ circleAdapter.setList(circleBean.getResult());}else{ circleAdapter.addList(circle...
2019-04-07 09:06:11
109
原创 自定义View
自定义View加减器public class MinView extends LinearLayout {private TextView jian,jia;private EditText ed_names;private int num=1;public MinView(Context context) { this(context,null);}public MinV...
2019-04-07 08:57:45
95
原创 Android6.0权限
private static String[] PERMISSIONS_STORAGE = { Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE };private static int REQUEST_PERMISSION_CODE = 1;privat...
2019-04-06 20:16:11
92
原创 购物车
//首先定义2个接口public interface CarCallback {void notifyCarItem(boolean isCheck,int postion);void notifyNum();}public interface CarUIcallback {void notifyCar(); //通知价格联动}//一级适配器public class YiAd...
2019-04-06 16:17:38
120
原创 Fragment懒加载
//懒加载public class HomeFragment extends Fragment{private boolean isInitView = false;private boolean isVisible = false;@Nullable@Overridepublic View onCreateView(@NonNull LayoutInflater inflater, ...
2019-03-31 21:39:38
86
原创 Toolbar
Activity@Overridepublic boolean onOptionsItemSelected(MenuItem item) {switch (item.getItemId()) { case R.id.menu1: break; case R.id.menu2: startActivity(new Intent(MainActiv...
2019-03-24 20:10:01
80
原创 有网无网判断
有无网public boolean hasNetWork(){ConnectivityManager cm = (ConnectivityManager) this.getSystemService(Context.CONNECTIVITY_SERVICE);NetworkInfo activeNetworkInfo = cm.getActiveNetworkInfo();return a...
2019-03-18 07:47:50
237
原创 GreenDao的单例
public class GreenUtil {private static GreenUtil instance;//单例模式public static GreenUtil getInstance(){ if (instance==null){ synchronized (GreenUtil.class){ if (instance==nul...
2019-03-18 07:42:51
272
原创 图片缓存
//设置磁盘缓存 DiskCacheConfig builder = DiskCacheConfig.newBuilder(this) &
2019-03-08 08:22:35
87
原创 多条目
public class HomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements ItemPAdapter.HomeoneItemclick,ItemMAdapter.HomeoneItemclick,ItemRAdapter.HomeoneItemclick {private fina...
2019-03-08 08:20:54
84
原创 购物车全选
private void zprice() {double zprice = 0;for (ShopCarBean.ResultBean resultBean : carBean.result) { if (resultBean.ischelick) { zprice += resultBean.num * resultBean.price; }}hj.se...
2019-03-08 08:17:42
84
原创 日志拦截器
public class HeaderInterceptor implements Interceptor {@Overridepublic Response intercept(Chain chain) throws IOException { Request request=chain.request();//请求对象,原始对象,用户名密码 Request.Builder...
2019-03-04 08:01:59
130
原创 RetrofitUtils工具类+MVP
Retrofitpublic class RetrofitUtils {private static RetrofitUtils instence;private final Retrofit retrofit;//单例模式public static RetrofitUtils getInstence() { if (instence==null){ synch...
2019-02-18 08:12:17
190
原创 Fragment2
public class FragmentTwo extends Fragment implements ShowContract.ShowView,NotfyNum {private TextView fan;private XRecyclerView xr;private CheckBox checkbox;private TextView zong;private Button j...
2019-01-20 11:26:36
179
原创 点击购物车
public class ShowAdapter extends XRecyclerView.Adapter<ShowAdapter.ShViewHolder> {private Context context;private List<SouBean.DataBean> list;public ShowAdapter(Context context) { ...
2019-01-20 08:53:49
165
原创 Api
/*查询*/public static String SELTE="http://www.zhaoapi.cn/product/getCarts";/*搜索*/public static String SER="http://www.zhaoapi.cn/product/searchProducts";/*加入购物车*/public static String ADD="http:...
2019-01-20 08:51:13
102
原创 多条目Fragment
public class HomeFragment extends Fragment implements IContract.IView {private XRecyclerView rv;private IProAdapter iProAdapter;private Ipresenter ipresenter;@Nullable@Overridepublic View onCre...
2019-01-20 08:47:21
96
原创 多条目适配器
public class IProAdapter extends XRecyclerView.Adapter<XRecyclerView.ViewHolder> {private Context context;private List<IBean.DataBean.BannerBean> bannerBeans;private List<IBean.DataB...
2019-01-20 08:45:18
83
原创 Mainactivity
public class MainActivity extends AppCompatActivity implements CarContract.CarView,MNotifyNum {private XRecyclerView rv;private CheckBox checkbox;private CarPresenter carPresenter;private CarAdapt...
2019-01-19 21:01:47
113
原创 自定义View
public class AddView extends LinearLayout {private TextView jian;private EditText edNum;private TextView add;private int num;public AddView(Context context) { this(context, null);}public ...
2019-01-19 20:55:36
77
原创 适配器
一级适配器public class CarAdapter extends XRecyclerView.Adapter&amp;lt;CarAdapter.CarViewHolder&amp;gt; implements Carcheck {private Context context;private List&amp;lt;CarBean.Data&amp;gt; data;private MNotifyNum mNo...
2019-01-19 20:50:48
100
原创 OkHttpUtils工具类
public class OkHttpUtils {private OkHttpClient okHttpClient;private static OkHttpUtils instance;//单例模式public static OkHttpUtils getInstance() { if (instance==null){ synchronized (OkHt...
2019-01-19 20:47:28
1364
原创 契约类+MVP
Contract层public interface CarContract {//定义一个Presenter的类public abstract class CarPresenter{ public abstract void show(String path, HashMap<String,String>map);}//定义一个Model层public interf...
2019-01-19 20:45:25
313
原创 轮播
public class BannerActivity extends BaseMvpActivity<ProductContract.ProductModel,ProductContract.ProductPresenter> implements ProductContract.ProductView {private XBanner mXBanner;private List...
2019-01-14 08:29:20
79
原创 MVP封装 契约类
Contract层public interface ClsContract {//定义一个抽象类 P层public abstract class ClsPresenter{ public abstract void getLeftList(HashMap<String,String>map); public abstract void getRightList(H...
2019-01-06 20:08:21
528
原创 Fragment
public class ClsFragment extends Fragment implementsClsContract.IClsView,LeftAdapter.ItemClickListener {private RecyclerView leftRv,rightRv;private LeftAdapter leftmadapter;private RightAdapter ri...
2019-01-06 19:54:35
115
原创 动画属性
public class MainActivity extends AppCompatActivity {private ImageView iv;@Overrideprotected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R...
2019-01-06 19:53:04
133
原创 有无网
package com.example.yue.sqlite;import android.content.Context;import android.net.ConnectivityManager;import android.net.NetworkInfo;public class NetUtil {public boolean has(Context context){ ...
2018-12-21 08:22:46
129
原创 PullToRefreshListView多条目
适配器public class MyAdapter extends BaseAdapter {private Context context;private List<GsonBean.DataBean> list;public MyAdapter(Context context) { this.context = context; list=new Arra...
2018-12-20 19:33:37
86
原创 ImageLoaderConfiguration全局配置类
ImageLoaderConfigurationpublic class MyApp extends Application {@Overridepublic void onCreate() { super.onCreate(); //全局显示 DisplayImageOptions options=new DisplayImageOptions.Builde...
2018-12-19 20:34:05
155
原创 数据库+PullToRefreshListView
列表展示+数据库主页面public class TabFragment extends Fragment {private PullToRefreshListView pul;private MyAdapter madapter;private MovieBean gson;private List&lt;MovieBean.ResultBean&gt; list=new ArrayLi...
2018-12-19 20:30:13
86
原创 Handler倒计时
handler倒计时public class MainActivity extends AppCompatActivity {private SharedPreferences sharedPreferences;private SharedPreferences.Editor editor;private TextView miao;private int ss=5;//定义倒计时/...
2018-12-19 20:10:49
99
原创 Viewpager+侧拉
main主函数//一定要继承 implements View.OnClickListenerpublic class Main2Activity extends AppCompatActivity implements View.OnClickListener{private BottomNavigationView.OnNavigationItemSelectedListener mOnN...
2018-12-19 20:08:27
75
原创 Tablayout +pulltorefresh
适配器public class MAdapter extends BaseAdapter {private Context context;private List&lt;InBean.ResultBean&gt; list;public MAdapter(Context context) { this.context = context; list=new ArrayL...
2018-12-16 20:05:49
157
原创 viewpager轮播+PullToRefreshListView
一、抽取基类public abstract class Baseactivity extends AppCompatActivity {@Overridepublic void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //加载视图 setContentVie...
2018-12-16 19:59:34
124
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人