自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(35)
  • 收藏
  • 关注

原创 Android 关于模块化

MainModule是写mainactivity中viewpager+三个按钮的那个,它是个modulecommonsdk是用来归类底层library(utillibrary、widgetlibrary,baselibrary)的,它是个modulecommonsdk拿它放color属性,图片资源,等基本上所有要用的依赖都放这里,但前面不能用implement,都用api,api就相当于pu...

2019-02-20 21:17:30 388

原创 Android 每次进入Fragment都进行刷新

在网上看了很多了帖子,像在Fragment中定义一个布尔类型的值用来标识,在onCreateAnimation的方法里进行判断,但在我这没有什么卵用,一共分为三种我都贴出来,万一在你那有点卵用呢.第一种,使用onCreateAnimation方法private boolean isGetData=false; @Overridepublic Animation onCreateAnima...

2019-01-19 08:44:19 5668 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 258

原创 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 167

原创 封装成JSON数据

2019-01-12 09:23:10 530 1

原创 Android 简单实现XBanner无限轮播

在项目build.gradle maven { url 'https://jitpack.io' }在model中的build.gradle导入依赖 implementation 'com.github.xiaohaibin:XBanner:1.6.1'布局文件: <com.stx.xhb.xbanner.XBanner android:id="@+...

2019-01-11 20:06:42 828

原创 Android webview加载HTML后缀的数据

2019-01-09 14:52:31 212

原创 Android Retrofit+Rxjava实现上传头像

2019-01-01 20:53:58 611

原创 Android 时间戳与时间互转换

把时间戳转换成时间 /* * 将时间戳转换为时间 * * s就是时间戳 */ public static String stampToDate(String s){ String res; SimpleDateFormat simpleDateFormat = new SimpleDateFor...

2018-12-26 21:35:28 5955

原创 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 895

原创 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 284

原创 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 214

原创 Android调取相机相册上传头像

布局文件:<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 238

原创 Android高德地图最详细步骤简单显示地图和蓝点定位

在高德开放平台创建一个新应用填写应用名称和选择好类型之后应用就创建完毕了然后需要给应用添加Key,点击加号,就出来如下图了SHA1码获取:## 找到你项目如下点击即可,控制台就会输出你的SHA1码包名获取:提交完成之后应用的key就有了外部的东西咱们就搞完了,接下来就是在AS里操作了首先还是导入依赖 implementation'com.amap.api:3dmap:la...

2018-12-20 16:41:41 3633

原创 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 1288

原创 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 383

原创 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 2625

原创 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 214

原创 Android MVP实现购物车

采用的是MVP方式的购物车//主布局 <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical&

2018-11-22 16:02:05 197

原创 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=&quot

2018-11-22 11:35:40 402

原创 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 119

原创 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 1017 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 208

原创 用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 297

原创 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 166

原创 Android仿京东商品分类

布局文件:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent&

2018-11-22 10:37:49 1055

原创 Android 扫描二维码和生成二维码

*//导入ZXing依赖包*//导入依赖compile 'pub.devrel:easypermissions:0.2.0'//必须要实现这个EasyPermissions.PermissionCallbackspublic class MainActivity extends AppCompatActivity implements EasyPermissions.Permissio...

2018-11-11 21:07:31 734

原创 自定义全局异常捕捉

//导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 203

原创 Android 判断网络连接

//封装一个判断网络的类public class HttpNet {public static boolean isNetConnected(Context context){ boolean isNetConnected; //获得网络服务 ConnectivityManager manager = (ConnectivityManager) context.ge...

2018-11-02 11:57:48 283

原创 Android 自定义WaveView 图片随着WaveView 滑动

xml布局:<?xml version="1.0" encoding="utf-8"?><RelativeLayout android:background="#f00"

2018-11-01 14:00:06 233

原创 Android中简单实现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.com/tools”...

2018-10-25 18:10:07 244

原创 Android Fragment+Viewpager实现左右滑动和点击 实现DrawerLayout

xml布局代码:<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 219

原创 封装网络请求 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 250

原创 PullToRefreshListView 实现上拉刷新下拉加载

xml布局代码:<com.handmark.pulltorefresh.library.PullToRefreshListViewandroid:id="@+id/pullToRefreshListView"android:layout_width=“match_parent”android:layout_height=“match_parent”>&amp

2018-10-25 16:09:40 182

原创 XListView 上拉刷新下拉加载

xml布局代码:<com.bawei.xlistviewlibrary.XListView android:id="@+id/xListView" android:layout_width="match_parent&amp

2018-10-25 15:55:25 153

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除