- 博客(35)
- 收藏
- 关注
原创 Android 关于模块化
MainModule是写mainactivity中viewpager+三个按钮的那个,它是个modulecommonsdk是用来归类底层library(utillibrary、widgetlibrary,baselibrary)的,它是个modulecommonsdk拿它放color属性,图片资源,等基本上所有要用的依赖都放这里,但前面不能用implement,都用api,api就相当于pu...
2019-02-20 21:17:30
449
原创 Android 每次进入Fragment都进行刷新
在网上看了很多了帖子,像在Fragment中定义一个布尔类型的值用来标识,在onCreateAnimation的方法里进行判断,但在我这没有什么卵用,一共分为三种我都贴出来,万一在你那有点卵用呢.第一种,使用onCreateAnimation方法private boolean isGetData=false; @Overridepublic Animation onCreateAnima...
2019-01-19 08:44:19
5826
2
原创 ijkplayer 视频播放
导入依赖 implementation 'com.dou361.ijkplayer:jjdxm-ijkplayer:1.0.5'AndroidManifest.xml加入权限 <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="a...
2019-01-18 15:16:18
287
原创 Toast工具类
public class ToastUtil { public static void showToast(String msg){ if (TextUtils.isEmpty(msg)){ return; } Toast.makeText(App.context,msg,Toast.LENGTH_SHORT).sh...
2019-01-17 15:29:25
203
原创 Android 简单实现XBanner无限轮播
在项目build.gradle maven { url 'https://jitpack.io' }在model中的build.gradle导入依赖 implementation 'com.github.xiaohaibin:XBanner:1.6.1'布局文件: &lt;com.stx.xhb.xbanner.XBanner android:id="@+...
2019-01-11 20:06:42
878
原创 Android 时间戳与时间互转换
把时间戳转换成时间 /* * 将时间戳转换为时间 * * s就是时间戳 */ public static String stampToDate(String s){ String res; SimpleDateFormat simpleDateFormat = new SimpleDateFor...
2018-12-26 21:35:28
6590
原创 Android Sp工具类封装
/**spUtil工具*/public class SpUtil {private static final String file_name = "sp_name";private static final int sp_mode = Context.MODE_PRIVATE;private static Context mcontext = App.mcontext;publi...
2018-12-24 20:33:28
954
原创 Advanced electric dealer 所用的依赖
绑定控件(ButterKnife)的依赖implementation ‘com.jakewharton:butterknife:8.8.1’annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1’网络请求框架(Retrofit,RxJava)的依赖implementation ‘com.squareup.retrofi...
2018-12-24 20:31:50
330
原创 Android Retrofit搭配RxJava进行网络请求
创建一个接口,根据请求方式改变注解Retrofit用单例模式public class CircleRetro { private static CircleRetro instance; private final Retrofit retrofit; public static CircleRetro getInstance(){ if (inst...
2018-12-20 20:23:40
259
原创 Android调取相机相册上传头像
布局文件:&lt;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" a
2018-12-20 20:09:49
294
原创 Android高德地图最详细步骤简单显示地图和蓝点定位
在高德开放平台创建一个新应用填写应用名称和选择好类型之后应用就创建完毕了然后需要给应用添加Key,点击加号,就出来如下图了SHA1码获取:## 找到你项目如下点击即可,控制台就会输出你的SHA1码包名获取:提交完成之后应用的key就有了外部的东西咱们就搞完了,接下来就是在AS里操作了首先还是导入依赖 implementation'com.amap.api:3dmap:la...
2018-12-20 16:41:41
3788
原创 Android 自定义OkHttp请求日志拦截器和自带的日志拦截器
//请求日志拦截器public class OkLogInterceptor implements Interceptor { @Override public Response intercept(Chain chain) throws IOException { Request request = chain.request(); String...
2018-12-18 11:11:26
1364
原创 Android Fresco的封装
public class FrescoUtils {/** * 加载基本图片 * * @param url * @param simpleDraweeView */public static void showBasicPic(String url, SimpleDraweeView simpleDraweeView) { Uri uri = Uri.parse(url);...
2018-12-09 18:53:07
454
原创 Android用RecyclerView实现商品分类
//三个个RecyclerView实现//左边的布局 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="50dp" android:orientatio...
2018-11-22 21:25:25
2696
原创 Android 简单实现流式布局
xml: <com.ww.wangwei.flowview.FlowLayout android:id="@+id/flowLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margi...
2018-11-22 20:10:43
237
原创 Android MVP实现购物车
采用的是MVP方式的购物车//主布局 &amp;amp;lt;LinearLayout android:layout_width=&amp;quot;match_parent&amp;quot; android:layout_height=&amp;quot;match_parent&amp;quot; android:orientation=&amp;quot;vertical&
2018-11-22 16:02:05
225
原创 Android中使用mvp实现登录以及SharedPreferences记住密码
布局文件:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="
2018-11-22 11:35:40
426
原创 Android 使用mvp实现登录
IBaseViewpublic interface IBaseView { void onDataSuccess(); void onDataFailer(); void show(); void hide();}BaseBizpublic class BaseBiz {}BasePresenterpublic abstract class B...
2018-11-22 11:25:14
134
原创 Android 自定义view 实现转盘抽奖
实现效果:布局文件<?xml version="1.0" encoding="utf-8"?><android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.androi...
2018-11-22 11:14:31
1116
2
原创 Android中实现跑马灯效果
效果:布局文件:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:to...
2018-11-22 11:03:39
250
原创 用SearchView实现搜索框
效果布局文件: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xml...
2018-11-22 10:55:09
326
原创 OKHttp的封装
首先导依赖 implementation 'com.squareup.okhttp3:okhttp:3.10.0'新建classpublic class OkHttpUtils { public OkHttpUtils get(String path){ OkHttpClient okHttpClient = new OkHttpClient(); ...
2018-11-22 10:47:04
182
原创 Android仿京东商品分类
布局文件:&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent&
2018-11-22 10:37:49
1095
原创 Android 扫描二维码和生成二维码
*//导入ZXing依赖包*//导入依赖compile 'pub.devrel:easypermissions:0.2.0'//必须要实现这个EasyPermissions.PermissionCallbackspublic class MainActivity extends AppCompatActivity implements EasyPermissions.Permissio...
2018-11-11 21:07:31
757
原创 自定义全局异常捕捉
//导ndk和SDK的依赖 ndk { // 设置支持的SO库架构 abiFilters 'armeabi','x86','armeabi-v7a','x86_64','arm64-v8a' } implementation 'com.tencent.bugly:crashreport:latest.release' //其中late...
2018-11-09 18:56:13
219
原创 Android 判断网络连接
//封装一个判断网络的类public class HttpNet {public static boolean isNetConnected(Context context){ boolean isNetConnected; //获得网络服务 ConnectivityManager manager = (ConnectivityManager) context.ge...
2018-11-02 11:57:48
312
原创 Android 自定义WaveView 图片随着WaveView 滑动
xml布局:&amp;amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;amp;gt;&amp;amp;lt;RelativeLayout android:background=&amp;quot;#f00&amp;quot;
2018-11-01 14:00:06
261
原创 Android中简单实现DrawerLayout
&lt;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.com/tools”...
2018-10-25 18:10:07
275
原创 Android Fragment+Viewpager实现左右滑动和点击 实现DrawerLayout
xml布局代码:&amp;lt;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.c...
2018-10-25 16:26:00
248
原创 封装网络请求 HttpUrlConnection+AsyncTask
public class HttpConUtils {//创建一个静态方法public void getpath(String path) { MyAsyncTask myAsyncTask = new MyAsyncTask(); myAsyncTask.execute(path);}//自定义一个asyncTaskpublic class MyAsyncTask e...
2018-10-25 16:13:02
276
原创 PullToRefreshListView 实现上拉刷新下拉加载
xml布局代码:&amp;lt;com.handmark.pulltorefresh.library.PullToRefreshListViewandroid:id=&quot;@+id/pullToRefreshListView&quot;android:layout_width=“match_parent”android:layout_height=“match_parent”&amp;gt;&amp
2018-10-25 16:09:40
215
原创 XListView 上拉刷新下拉加载
xml布局代码:&amp;amp;amp;amp;amp;lt;com.bawei.xlistviewlibrary.XListView android:id=&amp;amp;amp;amp;quot;@+id/xListView&amp;amp;amp;amp;quot; android:layout_width=&amp;amp;amp;amp;quot;match_parent&amp;amp
2018-10-25 15:55:25
177
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人