studo
文章平均质量分 66
小明同学z
这个作者很懒,什么都没留下…
展开
-
获取网络WIFI还是流量 或者有没有网
//需要添加的权限 <uses-permission android:name="android.permission.INTERNET"></uses-permission> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permissi...原创 2018-07-10 15:15:11 · 404 阅读 · 0 评论 -
展示商品列表
private Handler handler = new Handler(){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); } }; private ProductBean productBean; @Override protected vo...原创 2018-08-11 16:24:58 · 633 阅读 · 0 评论 -
正则表达式验证手机号
public class RegexValidateUtil { static boolean flag = false; static String regex = ""; public static boolean check(String str, String regex) { try { Pattern pattern ...原创 2018-08-13 08:17:52 · 397 阅读 · 0 评论 -
XrecyclerView 多条目
public class Home_ShowAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private Banner banner; private Context context; private ShowBean bean; private final int...原创 2018-08-16 20:21:05 · 320 阅读 · 0 评论 -
XrecyclerView 正常展示布局
ublic class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.MyViewHolder>{ private Context context; private List<ProductBean.Product> list; public ProductAdapter(...原创 2018-08-16 20:25:12 · 257 阅读 · 0 评论 -
购物车二级适配器
public class ProductAdapter extends RecyclerView.Adapter<ProductAdapter.CartViewHolder> { private Context mContext; private List<CartBean.DataBean.ListBean> listBeanList; priv...原创 2018-08-23 11:34:10 · 204 阅读 · 0 评论 -
自定义购物车加减器
public class MyJIaJianView extends LinearLayout{ private TextView jiaTv,jiantv; private EditText numEt; private int num = 1; public MyJIaJianView(Context context) { this(co...原创 2018-08-23 11:38:55 · 195 阅读 · 0 评论 -
全选 反选 以及总价的计算
@Override public void notifyAllCheckboxStatus() { StringBuilder stringBuilder = new StringBuilder(); if (cartAdapter != null) { for (int i = 0; i < cartAdapter.getC...原创 2018-08-23 11:44:39 · 379 阅读 · 0 评论 -
okHttputils二次封装
OkHttpUtols public class OkHttpUtils { private static OkHttpUtils okHttpUtils; private OkHttpClient okHttpClient; private OkHttpUtils(){ //创建拦截器对象 HttpLoggingInterceptor httpLoggin...原创 2018-08-23 11:55:31 · 281 阅读 · 0 评论 -
购物车一级适配器
public class CartAdapter extends RecyclerView.Adapter<CartAdapter.CartViewHolder> implements CartCheckListener { private Context mContext; private List<CartBean.DataBean> cartList...原创 2018-08-23 19:34:33 · 265 阅读 · 0 评论 -
XrecyclerView自定义接口回调事件
public interface OnItemClickLisner{ void onitemclick(String pscid); } public void SetonItemClickLisner(OnItemClickLisner onItemClickLisner){ this.onItemClickLisner= onItemClickLisner; } ...原创 2018-08-21 08:59:19 · 272 阅读 · 0 评论 -
安卓打开相册 拍照 并裁剪
拍照并裁剪,,,回显 */ public class MainActivity extends Activity { private ImageView img; private String path = Environment.getExternalStorageDirectory() + "/pics.jpg"; @Override ...原创 2018-09-11 19:00:05 · 336 阅读 · 0 评论 -
获取数据 mvp契约 Retrofit实现,Rxjava请求回调
API 契约 Model Presenter层原创 2018-09-09 19:02:09 · 234 阅读 · 0 评论 -
秒杀
<ViewFlipper android:layout_weight="8" android:layout_width="0dp" android:layout_gravity="center" android:autoStart="true" android:layout_marginLeft="10dp" android:inAnimati..原创 2018-09-10 19:42:46 · 258 阅读 · 2 评论 -
流式布局
package com.example.lenovo.yd1603b0806demo1_test; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.Tex...原创 2018-08-07 09:12:01 · 282 阅读 · 0 评论 -
仿京东登录代码
OkHttpUtols public class OkHttpUtils { private static OkHttpUtils okHttpUtils; private OkHttpClient okHttpClient; private OkHttpUtils(){ okHttpClient= new OkHttpClient.Builder...原创 2018-08-11 11:39:01 · 2164 阅读 · 0 评论 -
仿京东注册接口
注册model public class RegisterModel { private Handler handler=new Handler(){ @Override public void handleMessage(Message msg) { super.handleMessage(msg); } ...原创 2018-08-11 10:07:01 · 685 阅读 · 0 评论 -
AsnsTask获取图片或集合
获取图片public class MyAsyncTask extends AsyncTask<String ,Integer ,Bitmap>{ @Override protected void onPostExecute(Bitmap bitmap) { super.onPostExecute(bitmap); imgview....原创 2018-07-10 15:20:22 · 210 阅读 · 0 评论 -
侧滑栏
SlidingMenu menu = new SlidingMenu(this); //设置左侧滑 menu.setMode(SlidingMenu.LEFT); //设置触摸屏幕的模式 menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN); //设置阴影的宽度 //设置阴影颜色 menu.setShadowDrawable(R.co...原创 2018-07-18 09:50:48 · 344 阅读 · 0 评论 -
Xlistview解析 图片
DisplayImageOptions options = new DisplayImageOptions.Builder() //设置图片加载期间的图片 .showImageForEmptyUri(R.mipmap.ic_launcher_round) //图片是否缓存在SD .cacheOnDisk(true) ...原创 2018-07-13 16:17:12 · 195 阅读 · 0 评论 -
最简单解析
String uri = "http://gank.io/api/data/%E7%A6%8F%E5%88%A9/10/1"; AsyncHttpClient client = new AsyncHttpClient(); client.get(this, uri, new TextHttpResponseHandler() { @Override public void o...原创 2018-07-13 21:25:57 · 229 阅读 · 0 评论 -
网络获取图片轮播
package bwei.com.viewpager; import android.os.Handler; import android.os.Message; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v7.app...原创 2018-07-20 08:42:21 · 202 阅读 · 0 评论 -
Tablayou 关联 fragment
tabs = new ArrayList<String>(); tabs.add("tab01"); tabs.add("tab02"); tabs.add("tab03"); tabs.add("tab04"); tab_layout.setTabMode(TabLayout.MODE_FIXED);...原创 2018-07-21 09:09:46 · 252 阅读 · 0 评论 -
创建数据库以及dao方法使用
public class NewsSqliteOpenHelper extends SQLiteOpenHelper { public NewsSqliteOpenHelper(@Nullable Context context) { super(context, "news.db", null, 1); } @Override public...原创 2018-07-29 19:05:27 · 598 阅读 · 0 评论 -
pullListview添加头布局并轮播
bannerOper(); } //添加头部轮播 private void bannerOper() { //添加头部 View head = View.inflate(getActivity(), R.layout.layout_head, null); ListView refreshableView = pu...原创 2018-07-29 19:21:38 · 197 阅读 · 0 评论 -
HttpClient网络封装工具类
* 从网络获取数据 * * @param url */ public void getDataFromServer(String url, HttpUtilsCallback callback) { // 开启异步任务 new LoadDataTask(callback).execute(url); } ...原创 2018-07-26 15:05:23 · 282 阅读 · 0 评论 -
pulltorefresh加载
//设置刷新有效 prlv.setPullToRefreshEnabled(true); prlv.setMode(PullToRefreshBase.Mode.BOTH); //设置刷新监听 prlv.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<...原创 2018-07-22 19:16:59 · 393 阅读 · 0 评论 -
Httputils使用
instance = HttpUtils.getInstance(); httpUtis = new ListHttpUtis(); instance.getDataFromServer(url,httpUtis); listAdapter = new MyListAdapter(getActivity(),andrioBeans); ...原创 2018-07-27 16:09:07 · 1133 阅读 · 0 评论 -
判断是否有网
*/ public static boolean isNetConnect(Context context) { ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ne...原创 2018-07-28 09:41:02 · 146 阅读 · 0 评论 -
日期控件
birthdayTv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new DatePickerDialog(getActivity(), new DatePickerDialog.On...原创 2018-09-24 19:34:47 · 316 阅读 · 0 评论