自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 资源 (3)
  • 问答 (1)
  • 收藏
  • 关注

原创 关于悬浮控件

悬浮控件可以用帧布局FrameLayout实现一个布局写主要布局另一个现实悬浮按钮<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <FrameLay...

2019-05-07 09:29:39 215

原创 波浪控件自定义

1.首先我们需要做的就是一个波浪形的组件,并且需要不停的流动怎么样才能有一个波浪形的效果,我们在android绘图的api里面没有提供绘制一个正弦或者余弦的方法,但是在Path里面提供了绘制贝塞尔曲线的方法quadTo();利用这个方法我们可以绘制出一个波浪形的曲线出来.public class WaveView extends View { private int mWidth ,mH...

2018-04-24 19:59:54 164

原创 如何加快HTML页面加载速度

1、页面精简:去掉html页面不必要的空格、注释,尽量将script和css写在外部文件中。可以借用第三方工具对页面进行加速。2、减少文件数量减少页面上引用的文件数量可以减少HTTP连接数许多JavaScript、CSS文件可以合并最好合并,人家财帮子都把自己的JavaScript.functions和Prototype.js合并到一个base.js文件里去了3、减少外部域名文件的引用4、优化页面...

2018-04-16 23:16:43 1983

原创 排序

冒泡排序在要排序的一组数中,对当前还未排好序的范围内的全部数,自上而下对相邻的两个数依次进行比较和调整,让较大的数往下沉,较小的往上冒。即:每当两相邻的数比较后发现它们的排序与排序要求相反时,就将它们互换。void bubbleSort(int a[], int n){      for(int i =0 ; i        for(int j = 0; j      

2018-01-22 17:07:53 154

转载 Android:控件WebView显示网页

WebView可以使得网页轻松的内嵌到app里,还可以直接跟js相互调用。webview有两个方法:setWebChromeClient 和 setWebClientsetWebClient:主要处理解析,渲染网页等浏览器做的事情setWebChromeClient:辅助WebView处理Javascript的对话框,网站图标,网站title,加载进度等 WebVi

2017-12-25 17:44:24 338

转载 自定义滑动开关按钮-SwitchButton-进阶

之前写过这样一个简单的控件,详情可见:[ 自定义滑动开关按钮-SwitchButton](http://blog.csdn.net/u012424449/article/details/51678311)发现还是有点不方便,存在一些问题: 1.字体没有居中显示 2.图片和字都是固定的,不灵活于是在这基础上进行了改良,效果如下,和上次效果几乎一样。本来是有点击事件的,但是这录屏

2017-12-25 17:09:45 2595 1

转载 底部弹出PopupWindow并且背景变为半透明效果

来自:http://blog.csdn.net/LANG791534167/article/details/48985101先来看看运行效果图  [方式一]实现从底部弹出PopupWindow原理:定义一个高度为wrap_content的PopupWindow布局文件,根据屏幕底部的位置显示在Bottom1.首先定义一个高度为wrap

2017-12-25 17:03:27 858

转载 Android Popuwindow 使用方法 背景色

本人安卓新手,如有错误,请大神们指正!!app 中常见的popuwindow 分享页面popuwindow 背景色  以及点击背景popuwindow消失布局 代码:Version:0.9StartHTML:-1EndHTML:-1StartFragment:0000000111EndFragment:0000004086RelativeLayout

2017-12-25 17:01:00 284

转载 Android开发辅助工具类

文章转自http://blog.csdn.net/smartbetter/article/details/52709446本篇用于分享Android开发辅助工具类,用于快速开发,以便减少做重复的工作,提高开发效率。项目代码长期更新于Github:https://github.com/smartbetter/Android-UtilsLibrary1.AppUtils(App

2017-12-25 16:56:58 463

转载 SwitchButton 开关按钮 的多种实现方式 (附源码DEMO

switchbutton 刚开始接触开关样式的按钮是在IOS系统上面,它的切换以及滑动十分帅气,深入人心。所谓的开关按钮,就是只有2个状态:on和off,下图就是系统IOS 7上开关按钮效果。起初我在android上我只会使用CheckBox去满足对应的功能。后来,查看开发文档发现,android也有了自己的原生态开关控件

2017-12-25 16:43:29 5297

转载 Android 实现视屏播放器、边播边缓存功能、外加铲屎(IJKPlayer)

hello,大家好,我就是那个会掀桌子的话唠,刚刚结束两篇关于音频播放与录制的文章,旧坑未埋就挖新坑,还望多多关照。最近累趴了,周末果断休假。快看,用力戳它:https://github.com/CarGuo/GSYVideoPlayer 。项目是翻改至JieCaoVideoPlayer,本文特长,看官请耐心,妹子会有的。效果开源播放器选择Android上最为人熟知

2017-12-22 17:01:20 559

转载 利用百度地图实现支付宝“到位”功能(地图模式)

今天我们要说的,支付宝的“到位”功能。新版支付宝上方第四个tab,传闻丈母娘足不出户,同城招女婿的神兵利器。反正上面那些一块钱看看花、逛逛街、喝喝酒的服务好单纯好不做作我是DEMO: https://github.com/CarGuo/LbsMap 用力戳♂起来。到位的主要特色是地图加LBS功能,搜索周边的服务和帮忙,既然是地图,我们就站在百度的肩膀来开车吧:百度地图的基本功

2017-12-22 16:56:47 843

转载 Android MP3录制,波形显示,音频权限兼容与播放

我又来掀桌子了(ノಠ益ಠ)ノ彡┻━┻,这次是MP3录制和显示声音波形的一个故事。Demo :https://github.com/CarGuo/RecordWave先看看效果┑( ̄Д  ̄)┍21 MP3录制的逻辑过程就忽略了(真的不是因为懒(。・・)ノ),这里用的是开源的AndroidMP3Recorder,不过大神太忙了,表示停止维护了,录制效果还不错,站

2017-12-22 16:49:28 954

转载 Execution failed for task ':app:transformNative_libsWithStripDebugSymbolForRelease'.

最近在项目中突然碰到这个问题,查了好多资料,感觉最有用的就是这个方法,做个笔记!Error:Execution failed for task ':app:transformNative_libsWithStripDebugSymbolForRelease'.> Java.lang.NullPointerException (no error message)在对应项目的 

2017-12-22 16:35:28 182

转载 实现ViewPager中的Fragment无感知动态替换

最近在做某项目,其中有个功能是通过viewPager 和Fragment左右切换,但是因为要根据数据类型实现某一个Framgent可以在滑动动作停止后播放视频。之前我们是通过根据数据类型实现不同种类的fragment实例化即可。但是大家都知道ViewPager不显示区域可能也会有fragment,如果我们数据连续项都需要播放视频的话,测试中发现遇到会同时播放多个视频的情况,虽然最终通过某中手段屏蔽

2017-12-22 16:31:38 1292

转载 WifiManager(Wifi服务框架介绍)

本文简要介绍WIFI服务的主要框架以及运作机制。        WIFI框架主要涉及到以下几个对象:WifiService、WifiManager、WifiServiceImpl、WifiStateMachine等。下面来介绍这四个对象的内在联系。一、WIFI服务的初始化        WIFI服务的初始化分为两个部分,WifiService的初始化

2017-12-22 16:28:42 4636 2

转载 手把手教你写一个基于RxJava的扩展框架

近日消息,由于央行不再新设第三方支付机构,互联网企业们只能买买买。最近有通知称,中国人民银行同意一九付变更主要出资人,由高阳捷迅将一九付100%股份转让给由滴滴出行旗下的上海时园科技有限公司。作者简介本篇来自 Zackratos 的投稿,分享了一个基于RxJava的自定义框架——RxToast 的实现,希望大家会喜欢!Zackratos 的博客地址:

2017-12-22 16:23:59 267

转载 Android APP 性能优化的一些思考

基于DataBinding框架,MVVM设计模式的一套快速开发库,整合Okhttp+RxJava+Retrofit+Glide等主流库,满足日常开发需求。使用该框架可以快速开发一个Android应用https://github.com/goldze/MVVMHabit本文作者作者:斜杠Allen链接:http://

2017-12-22 16:19:03 243

转载 Activity中的状态保存与恢复,这些是你应该知道的

“水滴直播”官网现在只剩下一则永久关闭公告。水滴直播是360旗下的直播平台,公告周三上午发出,360称因为“内部业务调整”,水滴直播从即日起停止运营,之后360智能摄像机只保留安防监控功能。这是发酵了一周的直播风波的最终结果。12月12日,一篇署名陈菲菲的文章《一位92年女生致周鸿祎:别再盯着我们看了》在朋友圈传播,称安装在几家餐厅中的360智能相机不间断拍摄来往的人群,顾客会在毫不知情的情况下就

2017-12-22 16:16:16 277

原创 边播放遍缓冲

视频播放一般用hls协议  (http live stream) .m3u8 格式  一般.ts     在播放视频时把网络请求到的m3u8文件分割成多个小段  通过多线程 把一部分保存到本地  另一部分通过播放器播放出来.如果快进直接从目的位置开始,播放和存储,中间部分文件会按照顺序请求并保存本地.插入广告在指定位置添加,视频整体不会受影响 ,播放长度会增加.视频播放自定义的添加广告相对

2017-12-22 15:39:24 631

转载 android popuwindow点击外部窗口不消失的实例,popuwindow的用法 [复制链接]

网上大多数都是说如何监听点击外部消失,但我遇到的问题是点击外面不让其消失,如下是我的解决方案,关键是:popupmenu.setbackgrounddrawable(null);popupmenu.setfocusable(false);popupmenu = new popupwindow(view, keylinearlayout.getwidth(), layoutparams.wr

2017-12-21 17:53:39 183

原创 android 动态控制状态栏显示和隐藏的方法实例

这篇文章主要介绍了方法一:(经试验无效,但网上广为流传,也许是我使用方法不当,有待进一步验证……) android想要应用运行时全屏有一种方法是在activity的onCreat方法中加入如下代码:getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,                 Wind

2017-12-21 17:16:27 189

转载 工具类

https://github.com/vondear

2017-12-21 16:40:17 148

BaiduTrace_AndroidSDK_v3_1_2_Sample.zip

百度鹰眼定位轨迹,使用前请配置ak,鹰眼是一套轨迹管理服务,提供各端SDK和API供开发者便捷接入,追踪您所管理的车辆/人员等运动物体。基于鹰眼提供的接口和云端服务,开发者可以迅速构建一套完全属于您自己的完整、精准且高性能的轨迹管理系统,可应用于车队管理、人员管理等领域。鹰眼Android SDK是鹰眼系列产品的一部分,用于在AndroidAPP中集成鹰眼服务,实现轨迹追踪。

2019-10-12

LCRapidDevelop-master

# RapidDevelop-Android快速开发框架 - 框架持续更新中 - 这个框架是从平时项目里用的比较多的框架里整合而来 - 对本项目感兴趣的可以一起研究喜欢的朋友欢迎star - 同时也欢迎大家的宝贵意见issues - 如果大家对MVP模式的开发 网络爬虫以及缓存策略感兴趣的话可以看看我最新写的[Freebook](https://github.com/80945540/FreeBook) - 邮箱:[email protected] - [API地址](http://mylance.top/index.html) - [下载APK](http://fir.im/LCRapidDevelop) ###[English](README_EN.md) -------- ##功能说明 - 异常崩溃统一管理 - retrofit rxjava okhttp rxcache------------------------------网络请求以及网络缓存 - Demo采用MVP模式开发------------------------------------数据逻辑复用,便于维护升级 - 下拉刷新 上拉加载 及自动加载---------------------------实现监听方便快捷 - RecyclerView设配器------------------------------------------再也不需要写ViewHolder - RecyclerView item加载动画--------------------------------多种动画效果一行代码解决 - 页面状态统一管理 加载中 无数据 无网络-------------所有页面均可添加 - 图片显示与缓存 GIF图片显示 - Tab+Fragment快速实现 - 视频播放(仿QQ空间,秒拍等List播放) -------- ##效果图展示 ![下拉刷新](image/image1.gif) ![动画](image/image2.gif) ![](image/image3.gif) ![多布局](image/image4.gif) ![视频播放](image/image5.gif) ![状态页面](image/image6.gif)![状态页面](image/image7.gif) -------------- ##使用说明 导入 lcrapiddeveloplibrary 到项目 在 build.gradle 的 dependencies 添加: dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') .... compile project(':lcrapiddeveloplibrary') } ##轻松实现异常统一管理 MyApplication里面初始化就可以了 ``` public class MyApplication extends Application { @Override public void onCreate() { super.onCreate(); //初始化异常管理工具 Recovery.getInstance() .debug(true)//关闭后 在错误统一管理页面不显示异常数据 .recoverInBackground(false) .recoverStack(true) .mainPage(WelcomeActivity.class)//恢复页面 .init(this); } } ``` ##轻松实现 状态页面 下拉刷新 自动加载 item动画 首先layout.xml里面的编写啦 列表页面基本都是这个套路 ``` &lt;!--ProgressActivity用于状态页的控制 比如加载中 网络异常 无数据 适合任何页面--&gt; <com.xiaochao.lcrapiddeveloplibrary.viewtype.ProgressActivity xmlns:progressActivity="http://schemas.android.com/apk/res-auto" android:id="@+id/progress" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > &lt;!--SpringView下拉刷新--&gt; <com.xiaochao.lcrapiddeveloplibrary.widget.SpringView android:id="@+id/springview" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FFFFFF" > <android.support.v7.widget.RecyclerView android:id="@+id/rv_list" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#eeeeee"/> </com.xiaochao.lcrapiddeveloplibrary.widget.SpringView> </LinearLayout> </com.xiaochao.lcrapiddeveloplibrary.viewtype.ProgressActivity> ``` 然后就是Activity里面的编写了 这个例子里使用MVP模式编写感兴趣的看我最新写的[Freebook](https://github.com/80945540/FreeBook) ``` public class ListvViewActivity extends AppCompatActivity implements BaseQuickAdapter.RequestLoadMoreListener,SpringView.OnFreshListener,SchoolListView { RecyclerView mRecyclerView; ProgressActivity progress; private Toolbar toolbar; private BaseQuickAdapter mQuickAdapter; private int PageIndex=1; private SpringView springView; private SchoolListPresent present; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_listv_view); initView(); } private void initView() { present = new SchoolListPresent(this); mRecyclerView = (RecyclerView) findViewById(R.id.rv_list); springView = (SpringView) findViewById(R.id.springview); //设置下拉刷新监听 springView.setListener(this); //设置下拉刷新样式 springView.setHeader(new RotationHeader(this)); //springView.setFooter(new RotationFooter(this));mRecyclerView内部集成的自动加载 上啦加载用不上 在其他View使用 progress = (ProgressActivity) findViewById(R.id.progress); //设置RecyclerView的显示模式 当前List模式 mRecyclerView.setLayoutManager(new LinearLayoutManager(this)); //如果Item高度固定 增加该属性能够提高效率 mRecyclerView.setHasFixedSize(true); //设置页面为加载中.. progress.showLoading(); //设置适配器 mQuickAdapter = new ListViewAdapter(R.layout.list_view_item_layout,null); //设置加载动画 mQuickAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN); //设置是否自动加载以及加载个数 mQuickAdapter.openLoadMore(6,true); //将适配器添加到RecyclerView mRecyclerView.setAdapter(mQuickAdapter); //设置自动加载监听 mQuickAdapter.setOnLoadMoreListener(this); //请求网络数据 present.LoadData(PageIndex,12,false); } //自动加载 @Override public void onLoadMoreRequested() { PageIndex++; present.LoadData(PageIndex,12,true); } //下拉刷新 @Override public void onRefresh() { PageIndex=1; present.LoadData(PageIndex,12,false); } /* * MVP模式的相关状态 * * */ @Override public void showProgress() { progress.showLoading(); } @Override public void hideProgress() { progress.showContent(); } @Override public void newDatas(List<UniversityListDto> newsList) { //进入显示的初始数据或者下拉刷新显示的数据 mQuickAdapter.setNewData(newsList);//新增数据 mQuickAdapter.openLoadMore(10,true);//设置是否可以下拉加载 以及加载条数 springView.onFinishFreshAndLoad();//刷新完成 } @Override public void addDatas(List<UniversityListDto> addList) { //新增自动加载的的数据 mQuickAdapter.notifyDataChangedAfterLoadMore(addList, true); } @Override public void showLoadFailMsg() { //设置加载错误页显示 progress.showError(getResources().getDrawable(R.mipmap.monkey_cry), Constant.ERROR_TITLE, Constant.ERROR_CONTEXT, Constant.ERROR_BUTTON, new View.OnClickListener() { @Override public void onClick(View v) { PageIndex=1; present.LoadData(PageIndex,12,false); } }); } @Override public void showLoadCompleteAllData() { //所有数据加载完成后显示 mQuickAdapter.notifyDataChangedAfterLoadMore(false); View view = getLayoutInflater().inflate(R.layout.not_loading, (ViewGroup) mRecyclerView.getParent(), false); mQuickAdapter.addFooterView(view); } @Override public void showNoData() { //设置无数据显示页面 progress.showEmpty(getResources().getDrawable(R.mipmap.monkey_cry),Constant.EMPTY_TITLE,Constant.EMPTY_CONTEXT); } } ``` ##轻松实现视频列表播放 列表部分和上面的一样就不说了,我这边主要描叙视频播放的部分 是在不懂得可以clone到本地仓库跑一边 item_layout.xml ``` <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" android:orientation="vertical"> <com.xiaochao.lcrapiddeveloplibrary.Video.JCVideoPlayerStandard android:id="@+id/video_list_item_playr" android:layout_width="match_parent" android:layout_height="wrap_content"/> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:padding="5dp" android:gravity="center_vertical"> <ImageView android:id="@+id/video_list_item_image" android:layout_width="100dp" android:layout_height="70dp" android:src="@mipmap/def_head"/> <LinearLayout android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_marginLeft="15dp" android:layout_marginTop="5dp" android:layout_marginBottom="5dp" android:layout_marginRight="10dp" android:orientation="vertical"> <TextView android:id="@+id/video_list_item_text_title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#666666" android:text="标题" android:textSize="15dp"/> <TextView android:id="@+id/video_list_item_text_context" android:layout_width="wrap_content" android:layout_marginTop="5dp" android:textColor="#999999" android:textSize="13dp" android:text="内容" android:lines="3" android:ellipsize="end" android:layout_height="wrap_content"/> </LinearLayout> </LinearLayout> </LinearLayout> ``` 然后就是adapter里面对视频控件的赋值处理 ``` public class VideoLisViewAdapter extends BaseQuickAdapter&lt;VideoListDto&gt; { public VideoLisViewAdapter(int layoutResId, List&lt;VideoListDto&gt; data) { super(layoutResId, data); } public VideoLisViewAdapter(List&lt;VideoListDto&gt; data) { super(data); } public VideoLisViewAdapter(View contentView, List&lt;VideoListDto&gt; data) { super(contentView, data); } @Override protected void convert(BaseViewHolder helper, VideoListDto item) { helper.setText(R.id.video_list_item_text_title,item.getTitle()).setText(R.id.video_list_item_text_context,item.getIntroduction()); //Glide加载图片 并且支持gif动图 Glide.with(mContext) .load(item.getPictureUrl()) .crossFade() .placeholder(R.mipmap.def_head) .into((ImageView) helper.getView(R.id.video_list_item_image)); //对视频的赋值 添加视频播放地址(使用原地址 .mp4之类的 这个要注意)和标题 ((JCVideoPlayerStandard)helper.getView(R.id.video_list_item_playr)).setUp(item.getAppVideoUrl(),item.getTitle()); Glide.with(mContext) .load(item.getPictureUrl()) .crossFade() .placeholder(R.mipmap.main_mini_m) .into((((JCVideoPlayerStandard) helper.getView(R.id.video_list_item_playr)).thumbImageView)); } } ``` ###Tab+Fragment快速实现 还是原来的配方 layout.xml ``` &lt;?xml version="1.0" encoding="utf-8"?&gt; <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical" tools:context="com.xiaochao.lcrapiddevelop.UI.Tab.TabActivity"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> &lt;!--显示头部滑块--&gt; &lt;FrameLayout android:id="@+id/tab" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#fff" /&gt; <android.support.v4.view.ViewPager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent" /> </LinearLayout> ``` 然后就是头部的xml编写了 ``` <com.xiaochao.lcrapiddeveloplibrary.SmartTab.SmartTabLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/viewpagertab" android:layout_width="match_parent" android:layout_height="40dp" android:background="#FFFFFF" app:stl_defaultTabTextColor="@color/custom_tab" app:stl_distributeEvenly="true" app:stl_defaultTabTextHorizontalPadding="5dp" app:stl_indicatorColor="@color/title_bag" app:stl_indicatorCornerRadius="0dp" app:stl_indicatorInterpolation="smart" app:stl_indicatorThickness="3dp" app:stl_defaultTabTextSize="13dp" app:stl_dividerColor="@color/bag_gray" app:stl_dividerThickness="1dp" app:stl_overlineColor="@color/bag_gray" app:stl_underlineColor="#00000000" app:stl_defaultTabBackground="@color/bag_gray_transparent" /> ``` 完全可以按照自己想要的风格玩 下面表格为 可设置的属性 --------- |attr|描述| |:--|:-------| | stl_indicatorAlwaysInCenter | 如果设置为真,有源标签总是显示在中心(如报摊google app),默认的错误| | stl_indicatorWithoutPadding | 如果设置为true,画的指标没有填充选项卡中,默认的错误| | stl_indicatorInFront | 画前的指示器下划线,默认的错误| | stl_indicatorInterpolation | 行为的指标:“线性”或“智能”| | stl_indicatorGravity | 图的位置指示器:“底”或“前”或“中心”,默认“底”| | stl_indicatorColor | 标志的颜色| | stl_indicatorColors | 多种颜色的指标,可以设置每个选项卡的颜色| | stl_indicatorThickness | 厚度指标| | stl_indicatorWidth | 的宽度指标,默认“汽车”| | stl_indicatorCornerRadius | 圆角半径的指标| | stl_overlineColor | 顶线的颜色| | stl_overlineThickness | 顶线的厚度| | stl_underlineColor | 颜色的底线| | stl_underlineThickness | 厚度的底线| | stl_dividerColor| 颜色之间的分隔器选项卡| | stl_dividerColors| 多种颜色的选项卡之间的分隔器,可以设置每个选项卡的颜色| | stl_dividerThickness | 分频器的厚度| | stl_defaultTabBackground | 背景可拉的每个选项卡。 一般设置StateListDrawable| | stl_defaultTabTextAllCaps | 如果设置为真,所有选项卡标题大写,违约事实| | stl_defaultTabTextColor | 文本的颜色包括默认的选项卡| | stl_defaultTabTextSize | 文本包括默认的选项卡的大小| | stl_defaultTabTextHorizontalPadding| 文本布局填充默认的选项卡包括| | stl_defaultTabTextMinWidth| 最小宽度的标签| | stl_customTabTextLayoutId | 布局ID定义自定义选项卡。 如果你不指定一个布局,使用默认选项卡| | stl_customTabTextViewId | 文本视图ID在一个自定义选项卡布局。 如果你不与customTabTextLayoutId定义,不工作| | stl_distributeEvenly | 如果设置为真,每个选项卡都给出同样的重量,默认的错误| | stl_clickable | 如果设置为false,禁用选择选项卡单击,违约事实| | stl_titleOffset | 如果设置为“auto_center”,中间的幻灯片的位置选项卡中心将继续。 如果指定一个维度将抵消从左边缘,默认24 dp| | stl_drawDecorationAfterTab | 画装饰(指示器和线)绘图选项卡后,默认的错误| -------- 好了接下来就TabActivity ``` public class TabActivity extends AppCompatActivity { ViewGroup tab; ViewPager viewpager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tab); initView(); } private void initView() { tab = (ViewGroup) findViewById(R.id.tab); viewpager = (ViewPager) findViewById(R.id.viewpager); //使用方才定义头部 tab.addView(LayoutInflater.from(this).inflate(R.layout.tab_top_layout, tab, false)); SmartTabLayout viewPagerTab = (SmartTabLayout) findViewById(R.id.viewpagertab); FragmentPagerItems pages = new FragmentPagerItems(this); //添加Fragment FragmentPagerItem.of("头部显示标题", "建立的fragment","需要传值的可以传Bundle") for (int i=0;i<4;i++) { pages.add(FragmentPagerItem.of("Tab"+i, TabFragment.class)); } FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter( getSupportFragmentManager(), pages); viewpager.setAdapter(adapter); viewPagerTab.setViewPager(viewpager); } } ``` -------- ##特别感谢 - [JieCaoVideoPlayer](https://github.com/lipangit/JieCaoVideoPlayer) - [SpringView](https://github.com/liaoinstan/SpringView) - [SmartTabLayout](https://github.com/ogaclejapan/SmartTabLayout) - [BaseRecyclerViewAdapterHelper](https://github.com/CymChad/BaseRecyclerViewAdapterHelper) - [Recovery](https://github.com/80945540/Recovery)

2017-12-21

FrescoUtils-master

<h4>Fresco 的封装,快速上手,图像后处理,超大图高清预览,缩小放大,双击放大等一一俱全。</h4> ====================== [![](https://jitpack.io/v/CarGuo/FrescoUtils.svg)](https://jitpack.io/#CarGuo/FrescoUtils) [![Build Status](https://travis-ci.org/CarGuo/FrescoUtils.svg?branch=master)](https://travis-ci.org/CarGuo/FrescoUtils) ## 因为某些原因,现在使用jitpack.io,还请使用依赖的各位切换到jitpack。 #### 在project下的build.gradle添加 ``` allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` #### 在module下的build.gradle添加 ``` dependencies { compile 'com.github.CarGuo:FrescoUtils:v1.0.8' } ``` * 1.0.8 update fresco to 1.5.0 * 1.0.7 增加option配置方法; ``` /** * @param imageView 图片加载控件 * @param loadOption 加载配置构造器 */ public static void loadFrescoImage(FrescoImageView imageView, LoadOption loadOption) ``` * 1.0.6 update fresco to 1.3.0; * 1.0.5 update fresco to 1.2.0;移除无用依赖; * 1.0.4 update fresco to 1.0.1,update scaleImage to 3.6.0 * 1.0.3 update fresco to 1.0.0 * 1.0.2 最低API调整到15 * 1.0.1 增加了额FrescoHelper直接超大图加载接口 ``` /** * 超大图片的就接口 * * @param context 上下玩 * @param imageView 图片加载控件 * @param imageUri 图片地址 * @param defaultId 默认失败图片 */ public static void loadBigImage(final Context context, final SubsamplingScaleImageView imageView, String imageUri, final int defaultId) ``` <h4><a href="http://www.jianshu.com/p/cd058a924288">简书入口 这里有详细介绍</a></h4> ## 效果显示 <img src="https://github.com/CarGuo/FrescoUtils/blob/master/01.jpg" width="240px" height="426px"/> <img src="https://github.com/CarGuo/FrescoUtils/blob/master/02.jpg" width="240px" height="426px"/> <p></p> ### 动态图效果 <img src="https://github.com/CarGuo/FrescoUtils/blob/master/01.gif" width="240px" height="426px"/> <img src="https://github.com/CarGuo/FrescoUtils/blob/master/02.gif" width="240px" height="426px"/> <p></p> ### 记得记得在Application里初始化 ``` ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this) .setDownsampleEnabled(true) .build(); Fresco.initialize(this, config); ``` ### FrescoHelper 封装了针对 <a href="https://github.com/HomHomLin/FrescoImageView">FrescoImageView</a> 的工具类,直接使用FrescoImageView作为ImageView使用即可。 封装了多种类型,这是最全的一种 ``` /** * @param imageView 图片加载控件 * @param uri 路径或者URL * @param defaultImg 默认图片 * @param cornerRadius 弧形角度 * @param isCircle 是否为圆 * @param loadLocalPath 是否本地资源,如果显示R.drawable.xxx,Path可以为null,前提isCircle为true * @param isAnima 是否显示GIF动画 * @param size 是否再编码 * @param postprocessor 图像显示处理 */ public static void loadFrescoImage(FrescoImageView imageView, String uri, int defaultImg, int cornerRadius, boolean isCircle, boolean loadLocalPath, boolean isAnima, Point size, Postprocessor postprocessor) { init(imageView, cornerRadius, isCircle, isAnima, size, postprocessor); if (loadLocalPath) { imageView.loadLocalImage(uri, defaultImg); } else { imageView.loadView(uri, defaultImg); } } ··· FrescoHelper.loadFrescoImage(frescoImageView, recyclerDataModel.getUrl(), R.mipmap.ic_launcher, 2, false, recyclerDataModel.getSize(), new BlurPostprocessor(context, 10)); ``` ### 带有<a href="https://github.com/wasabeef/fresco-processors">fresco-processors</a>各种处理特效,高斯,五角形等。 <img src="https://github.com/wasabeef/fresco-processors/raw/master/art/demo.gif" width="240px" height="426px"/> ### 带有<a href="https://github.com/davemorrissey/subsampling-scale-image-view">subsampling-scale-image-view</a>实现超高清图片超长图片不模糊显示。 <img src="https://github.com/CarGuo/FrescoUtils/blob/master/01.gif" width="240px" height="426px"/> ### 带有<a href="https://github.com/ongakuer/PhotoDraweeView">PhotoDraweeView</a> 功能与PhotoView一样,支持双击放大,单击返回,手动放大与缩小等。 <img src="https://github.com/ongakuer/PhotoDraweeView/raw/master/screenshot.gif" width="240px" height="426px"/>

2017-12-21

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

TA关注的人

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