- 博客(32)
- 收藏
- 关注
原创 bundle
bundle传集合//String datas = new Gson().toJson(list);转成jsonlong time = list.get(i).getCreateTime();//转换Date date = new Date(time);//用Date构造方法,将long转DateSimpleDateFormat format = new SimpleDateForm...
2019-04-06 19:08:49
144
原创 weektwo002
依赖//sqlclasspath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin//三方 maven { url "https://jitpack.io" }dependencies下依赖 //butterknife implementation 'com.jakewharton:butterkn...
2019-03-17 21:16:40
155
原创 简单_联动
//activitypublic class MainActivity extends AppCompatActivity implements IMainView { @BindView(R.id.recycle) RecyclerView recycle; @BindView(R.id.check_All) CheckBox checkAll; @...
2019-03-07 20:57:30
167
原创 圆形头像
public class CircleHeaderView extends android.support.v7.widget.AppCompatImageView { private int radius; public CircleHeaderView(Context context) { super(context); } publi...
2019-03-04 20:21:05
340
原创 简单友盟
Activitypublic class MainActivity extends AppCompatActivity { @BindView(R.id.m_Nomian) Button mNomian; @BindView(R.id.m_mian) Button mMian; @BindView(R.id.m_Log) Button mLog...
2019-02-27 20:54:22
195
原创 weekone
依赖//gson implementation 'com.google.code.gson:gson:2.8.5' //okhttp implementation 'com.squareup.okhttp3:okhttp:3.7.0' //recyclerview implementation 'com.android.support:recyclervi...
2019-02-17 20:26:22
159
原创 购物车逻辑:
依赖//MetrialDesign:Design库 implementation 'com.android.support:design:28.+' //Butterknife:根据反射注入框架 implementation 'com.jakewharton:butterknife:8.8.1' annotationProcessor 'com.jakewhart...
2019-01-19 14:59:47
241
原创 SharedPreferences记住密码
private SharedPreferences.Editor editor; private SharedPreferences pref; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
2019-01-19 14:46:24
241
原创 简单的流式布局
//依赖implementation 'com.hyman:flowlayout-lib:1.1.2'//实现public class MainActivity extends AppCompatActivity {//控件 @BindView(R.id.m_ed) EditText mEd; @BindView(R.id.m_but_add) Butt...
2019-01-19 14:38:04
196
原创 设置动画
//这是根据Xml 设置///////给控件设置动画Animator animator = AnimatorInflater.loadAnimator(this, R.animator.textview_animator); animator.setTarget(tvTitle); animator.start()这是Xml<?xml versio...
2019-01-06 19:34:19
263
1
原创 okhttp拦截器
//这样使用public class OkUtil { public static OkUtil okUtil; private final OkHttpClient okHttpClient; //私有构造函数 private OkUtil(){ okHttpClient = new OkHttpClient.Builder() ...
2019-01-06 19:20:05
324
原创 OkHttp--OkGo
//OkHttp 异步 //创建OKHttp OkHttpClient client = new OkHttpClient.Builder().build(); //获取表单请求题 FormBody formBody = new FormBody.Builder().build(); //获取Request对象 ...
2019-01-01 19:07:16
1097
原创 RecyclerView
RecyclerView//MVp解析的数据 ArrayList&lt;HomeBean.DataBean&gt; beanList = (ArrayList&lt;HomeBean.DataBean&gt;) homeBean.getData(); //布局管理 //①线性 LinearLayoutManager //②网格 Gri...
2019-01-01 18:55:25
98
原创 解析 引导页
//解析回来的数据 final ArrayList<YDaoBean.DataBean> list = (ArrayList<YDaoBean.DataBean>) yDaoBean.getData(); //适配器 MyPageAdapter adapter = new MyPageAdapter(); adapter....
2019-01-01 18:50:21
128
原创 动画加载
//动画加载 Animation animation = AnimationUtils.loadAnimation(context, R.anim.set); mTv.setAnimation(animation); mTv.startAnimation(animation); animation.setAnimationList...
2019-01-01 18:46:20
143
原创 MVP框架
框架//契约类public interface ImainContract { //V public interface ImainView{ //数据显示 public void showData(); } //P public interface ImainPresenter&amp;amp;lt;ImainView&amp;amp;gt;{ ...
2019-01-01 18:45:43
114
原创 轮播图
bannerpublic class Frag03 extends Fragment { private ViewPager viewPager; private RadioGroup radioGroup; private Banner banner; String[] urls = {"http://img.my.csdn.net/uploads/2014...
2018-12-20 14:50:14
87
原创 频道管理
Banner 轮播图public class Frag03 extends Fragment { private ViewPager viewPager; private RadioGroup radioGroup; private Banner banner; String[] urls = {&quot;http://img.my.csdn.net/uploa...
2018-12-20 14:13:55
85
原创 依赖 -- 权限
依赖/////Gson依赖implementation 'com.google.code.gson:gson:2.8.2'//Imageloader依赖implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'//自己写的Xlistview依赖implementation pr...
2018-12-16 18:51:27
189
原创 PullToRefreshListView____handler
PullToRefreshListViewhandler解析public class Ffarg03 extends Fragment { String baseUrl = "http://api.expoon.com/AppNews/getNewsList/type/1/p/"; private PullToRefreshListView listView; Arra...
2018-12-16 18:40:36
90
原创 tabLayout和viewPager
tabLayout和viewPager基础public class Frag01 extends Fragment { private TabLayout tabLayout; private ViewPager viewPager; //放标题 ArrayList&lt;String&gt; titleList = new ArrayList&lt;Strin...
2018-12-16 18:37:23
223
原创 PullToRefreshListView
PullToRefreshListView异步解析public class Ffarg01 extends Fragment { String baseUrl = "http://api.expoon.com/AppNews/getNewsList/type/1/p/"; private int page; private PullToRefreshListView ...
2018-12-16 18:36:14
98
原创 DrawerLayout侧拉 和 xlistView 以及布局
public class Frag01 extends Fragment { private String uri = "http://api.expoon.com/AppNews/getNewsList/type/1/p/"; private XListView xListView; private ArrayList<JsonBean.DataBean> l...
2018-12-08 10:50:21
99
原创 Fragment
public class MainActivity extends AppCompatActivity { private RadioGroup radioGroup; private FragmentManager manager; private Frag01 frag01; private Frag02 frag02; private Frag03 ...
2018-12-08 10:48:24
91
原创 多条目
listview多条目public class MyListAdapter extends BaseAdapter {//调用ImageLoader ImageLoader instance = ImageLoader.getInstance(); private Context context; private ArrayList<JsonBean.Data...
2018-12-08 10:43:01
101
原创 ImageLoader应用
请求网络图片必须继承Application 和一个依赖:implementation ‘com.nostra13.universalimageloader:universal-image-loader:1.9.5’在MainActivity中得到ImageLoader instance = ImageLoader.getInstance();public class MyApp ext...
2018-12-02 18:43:15
120
原创 listview适配器
listview适配器List itemprivate Context context;private ArrayList&amp;lt;Jsonbean.DataBean&amp;gt; list;private ImageLoader imginstance;String urlBitmap = “http://img.my.csdn.net/uploads/201407/26/14063832...
2018-12-02 18:42:30
103
原创 工作类
我的工作类 :MyNewWorkpublic class MyNewWork {//网络获取Jsonpublic static String getUrlString(String urlString){ try { URL url = new URL(urlString); HttpURLConnection urlConnection = (Ht...
2018-12-02 18:41:58
106
原创 sql
数据库MySql 继承SQLiteOpenHelperpublic class MySql extends SQLiteOpenHelper {public MySql(Context context) {super(context, “bw.db”, null, 1);}@Overridepublic void onCreate(SQLiteDatabase db) {//创建表...
2018-12-02 18:41:44
83
原创 Viewpager
Viewpage的写法public class MainActivity extends AppCompatActivity { private ViewPager viewPager; private RadioGroup radioGroupoup; public String urlString = "http://api.expoon.com/AppNews/g...
2018-12-02 18:41:18
122
原创 判断是否有网 和 AsyncTask异步
判断是否有网 和 AsyncTask异步public class Frag01 extends Fragment { public String urlString = &quot;http://api.expoon.com/AppNews/getNewsList/type/1/p/1&quot;; String urlBitmap = &quot;http://img.my.csdn.net/uploads...
2018-12-02 18:40:51
215
原创 判断是否有网 没有从数据库中取值
判断是否有网 没有从数据库中取值public class Frag02 extends Fragment { private ArrayList&lt;JsonBean.DataBean&gt; list = new ArrayList&lt;JsonBean.DataBean&gt;(); private Dao dao; private ListView List...
2018-12-01 11:51:39
122
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人