- 博客(45)
- 收藏
- 关注
原创 倒计时
public class MainActivity extends AppCompatActivity { private TextView time; private MyHandler myHandler=new MyHandler(); @Override protected void onCreate(Bundle savedInstanceState) ...
2018-07-30 07:25:22 148
原创 (仿)京东首页+详情(Fragment)
//主页面布局<com.scwang.smartrefresh.layout.SmartRefreshLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ScrollView ...
2018-07-29 20:00:44 227
原创 RetrofitManager+RXjava(MVP+抽基类)
//IViewpublic interface IView { Context cotext();}//BasePresenterpublic abstract class BasePresenter<V extends IView> { protected CompositeDisposable compositeDisposable = new CompositeDis...
2018-07-15 19:30:14 367
原创 Retrofit的简单使用与上传头像
//Apipublic interface ILoginApi { @GET("login") Call<LoginBean> loginByMap(@Query("mobile") String mobile, @Query("password") String password); @GET("login") Call<LoginBean> lo
2018-07-15 19:24:05 459
原创 (Fragment)XRecyclerView上下拉刷新加载+GreenDao(缓存,查看)
//FragmentActivitypublic class HomeFragment extends Fragment { private static final String TAG = "HomeFragment"; private OkUtils okUtils; private int page = 3; private XRecyclerView xRecyc...
2018-07-08 21:06:21 298
原创 GreenDao简单使用
//Person@Entity(nameInDb = "person")public class Person { @Id(autoincrement = true) private Long id; @Property(nameInDb = "name") private String name1; private int age; @Transient ...
2018-07-08 20:58:55 149
原创 Fresco图片加载
//布局<com.facebook.drawee.view.SimpleDraweeView app:viewAspectRatio="2" app:fadeDuration="2000" app:roundingBorderColor="@color/colorPrimary" app:roundingBorderWidth="10d...
2018-07-08 20:55:40 142
原创 xRecyclerView刷新加载(MVP)
public class MainActivity extends BaseActivity<NewsPresenter> implements NewsView { private int a=1; private XRecyclerView recyclerView; private NewsAdapter adapter; private sta...
2018-07-08 20:51:28 127
原创 点击加加瀑布流
//布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layo...
2018-07-01 16:00:09 135
原创 mvp+购物车(fragment)
//M层public class ShoppingModel { private static final String TAG = "ShoppingModel"; public void login(final ModelView modelView){ String url="https://www.zhaoapi.cn/product/getCarts?uid=7...
2018-06-30 10:01:40 221
原创 抽基类(Fragment)
//接口public interface IView { Context context();}//P层public abstract class BasePresenter<V extends IView> { protected V view; public BasePresenter(V view) { this.view ...
2018-06-30 09:38:49 211
原创 mvp+分类(Fragment)
//主布局 <android.support.v7.widget.RecyclerView android:id="@+id/recycler" android:layout_width="100dp" android:layout_height="match_parent"></android.support.v7.widget....
2018-06-30 09:36:35 1565
原创 RecyclerView(多条目)+点击删除,长按动画(MVP格式)
//MainActivitypublic class MainActivity extends BaseActivity<MainPresenter> implements MainView { private RecyclerView recyclerView; @Override protected void initData() { p...
2018-06-24 20:52:47 678
原创 recyclerview(单条目)+点击删除
//MainActivitypublic class MainActivity extends AppCompatActivity { List<String> list = new ArrayList<>(); private RecyclerView recyClerView; @Override protected void onCreate(...
2018-06-24 20:49:41 872
原创 属性动画
public class MainActivity extends AppCompatActivity implements View.OnClickListener { private View contentRl; @Override protected void onCreate(Bundle savedInstanceState) { super.onCre...
2018-06-24 20:46:28 91
原创 OK工具类
public class OkHttpUtils { private static OkHttpUtils okHttpUtils; private final Handler mhandler; private OkHttpClient client; private OkHttpUtils(){ mhandler = new Handler(Lo...
2018-06-24 20:41:43 549
原创 OkHttpUtils拦截器
public class OkhtttpUtils { private static OkhtttpUtils mOkhtttpUtils; private OkHttpClient mOkHttpClien; private final Handler mHandler; private OkhtttpUtils() { HttpLoggingInterce...
2018-06-19 21:06:01 384
原创 自定义view简单使用
public class FlowLayout extends ViewGroup { public FlowLayout(Context context) { super(context); } public FlowLayout(Context context, AttributeSet attrs) { this(context, attrs, ...
2018-06-18 20:17:04 114
原创 抽基类
//接口public interface IView { Context context();}//BasePresenterpublic abstract class BasePresenter<V extends IView> { protected V view; public BasePresenter(V view){ this.vi...
2018-06-18 18:32:14 115
原创 (抽基类)mvp分包+二维码
//布局<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="登录" android:textSize="26dp" android:gravity="center" android:layout_marg..
2018-06-18 18:29:52 387
原创 OkHttpClient工具类及调用
//OkHttpClientpublic class OkHttpUtils { private static OkHttpUtils okHttpUtils; private final Handler myHandler; private OkHttpClient client; private OkHttpUtils(){ myHandler...
2018-06-14 20:36:46 2567
原创 二维码
//布局<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFF" android...
2018-06-11 20:41:34 114
原创 自定义View动画(基础+圆形变动)
//自定义Viewpublic class MyView extends View{ int width=00; int height=00; int speedX=50; int speddY=20; int x=100; int y=100; private Paint mpaint; public MyView(Context context)...
2018-06-10 21:04:42 100
原创 自定义View双梯形布局+自定义标题栏(点击事件)
//自定义标题栏public class MyTitleView extends LinearLayout implements View.OnClickListener{ public MyTitleView(Context context) { super(context); } public MyTitleView(Context context, @Null...
2018-06-10 18:57:50 198
原创 (Fragfment)ListView+无限轮播
public class TwoFragment extends Fragment { private static final String TAG = "TwoFragment"; private View view; private PullToRefreshScrollView pull; private ViewPager viewPager; p...
2018-05-30 20:07:21 119
原创 MyApp磁盘缓存
public class MyApp extends Application { private Context context; @Override public void onCreate() { super.onCreate(); context = this; File file = new File(Environment.ge...
2018-05-30 19:47:52 112
原创 无限轮播+ListView
//布局主布局 <com.handmark.pulltorefresh.library.PullToRefreshScrollView android:id="@+id/pull_to_refresh_scrollview" android:layout_width="fill_parent" android:layout_height="fi...
2018-05-27 19:39:02 230
原创 GridView上下拉刷新+Fragment
//布局主布局<com.handmark.pulltorefresh.library.PullToRefreshGridView android:id="@+id/pull_to_refresh_gridview" android:layout_width="fill_parent" android:layout_height="fill_paren...
2018-05-27 19:34:28 191
原创 Http工具类+MyApp图片加载
//HttpUtilspublic class HttpUtils { private static final String TAG = "HttpUtils---"; private MyHandler myHandler = new MyHandler(); private static final int SUCCESS = 0; private static fi...
2018-05-27 19:30:08 173
原创 PullToRefreshListView+ListView数据请求+Fragment
//布局主页面<com.handmark.pulltorefresh.library.PullToRefreshListView android:id="@+id/pull_to_refresh_listview" android:layout_width="fill_parent" android:layout_height="fill_paren...
2018-05-27 19:25:27 281
原创 TabLayout+Fragment
//布局<android.support.design.widget.TabLayout android:id="@+id/sy_tablayout" android:layout_width="match_parent" android:layout_height="40dp"></android.support.design.widg...
2018-05-27 19:17:25 363
原创 ViewPager+DrawerLayout
//布局<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android....
2018-05-27 19:13:02 341
原创 HorizontalScrollView
//MainActivitypublic class MainActivity extends AppCompatActivity { private String[] pindao = new String[]{ "关注", "热点", "推荐", "北京", "视频", "社会", "少儿频道", "农业频道", &q
2018-05-23 16:52:14 68
原创 轮播
//MainActivitypublic class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity----"; private String image1 = "http://img2.imgtn.bdimg.com/it/u=783340072,1312...
2018-05-22 20:06:08 83
原创 pulltorefresh上拉,下拉
//布局<LinearLayout android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schem...
2018-05-22 13:48:40 82
原创 (Fragment)Xlistview多条目加载 + 上拉下拉
//当前Fragmentpublic class SheHuiFragment extends Fragment implements XListView.IXListViewListener { // ?key=48a7d7193e11bd2dd4a683b6e2f90a4f&num=10 private static final String TAG = "SheHuiFr...
2018-05-18 14:46:31 227
原创 xlistview 下拉刷新,上拉加载
//MainActivitypublic class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity---"; //?keywords=笔记本&page=1 private static String goods_url = "https://...
2018-05-17 14:50:50 128
原创 listview多条目加载
//MainActivitypublic class MainActivity extends AppCompatActivity { private String newsUrl = "http://v.juhe.cn/toutiao/index?type=&key=2f41498b35e69877fc56dc96776e5d1f"; private ListView mai...
2018-05-17 14:47:42 124
原创 左侧拉动
public class MainActivity extends AppCompatActivity implements DrawerLayout.DrawerListener{ private static final String TAG = "MainActivity---"; private String[] names = new String[]{"baby", "尼古...
2018-05-17 14:12:44 172
原创 图片加载
//MainActivity页面public class MainActivity extends AppCompatActivity { private static String pic_url = "http://pic22.photophoto.cn/20120113/0036036848061774_b.jpg"; private static String pic1="ht...
2018-05-14 20:46:41 129
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人