开发中常用的工具类、通用 UI 的集合,目前在不断的更新中,尽可能的覆盖 Android 开发中通用的一些东西

CommonLibary

项目地址: smuyyh/CommonLibary
简介:开发中常用的工具类、通用 UI 的集合,目前在不断的更新中,尽可能的覆盖 Android 开发中通用的一些东西

CommonLibrary 主要是自己整理的一些项目开发中常用的工具类、通用 UI 的集合,目前在不断的更新中,尽可能的覆盖 Android 开发中通用的一些东西  


anim

AnimationUtils、ViewAnimationUtils。动画工具类,也可为视图创建动画效果。

data

AESUtils、Base64、ByteUtil、DESUtils、HexUtil、MD5Utils、RSAEncrypt、SharePreUtils。用于数据的安全性及数据持久化

io

BitmapUtils、FileUtils、IOUtils、PhotoUtils、StorageUtils。用于图片、文件、Bitmap、IO 流之间的转换

log

LogUtils。Log 工具类,可控制 Log 输出开关、保存 Log 到文件、过滤输出等级

network

用于判断网络连接类型、监听网络变化、设置网络、开启 GPS 等。

toast

DialogUtils、NotificationUtils、ToastUtils。Toast 工具类,解决连续弹出问题,发送通知栏信息、弹出对话框等。

utils

各类常用工具类,包括 AlarmUtils,AsyncExecutor,CheckUtils,ClipboardUtils,DateUtils,DeviceUtils,FieldUtils,FlashLightUtils,InputMethodUtils,KeyguardLockUtils,NumberUtils,PackageUtils,PatternUtils,ShellUtils,StringUtils,VibrateUtils,WakeLockUtils,ConvertUtils、DimenUtils、JSONUtils、SerializeUtils

view

各类自定义控件。例如密码输入框、下拉回弹 ListView、带删除键的 EditText、自动匹配邮箱输入框...

text:

1、闪烁的文字 ShimmerTextView 及 ShimmerButton,修改自Shimmer-android,xml 下新增相关动画属性,可直接启动动画。使用方式: 例如ShimmerTextView

<com.yuyh.library.view.text.ShimmerTextView
        android:id="@+id/tvShimmer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:gravity="center"
        android:text="发现没,文字会发亮哦~~"
        android:textColor="#AAAAAA"
        android:textSize="20sp"
        app:direction="ANIMATION_DIRECTION_RTL"
        app:duration="2000"
        app:model="START_RIGHT_AWAY"
        app:reflectionColor="#FFFFFF"
        app:repeatCount="-1"
        app:startDelay="0"
        android:background="#000000"/>

当然,也可以在 Java 直接启动

Shimmer shimmer = new Shimmer().setDirection(direction).setDuration(duration).setRepeatCount(repeatCount).setStartDelay(startDelay);
shimmer.start((ShimmerTextView) view);

2、SearchEditText。仿 iOS 的搜索框,默认搜索图标在中间,编辑模式下搜索图标移动到左边。示例:

<com.yuyh.library.view.text.SearchEditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/edit_bg_white"
        android:hint="仿 ios 输入框"
        android:padding="50dp" />

3、ClearEditText。右侧带有清除文字按钮的 EditText,是个挺实用的功能

4、EmailAutoCompleteTextView。输入邮箱前缀,会相应生成一些常用的邮箱地址列表,供用户选择,实现快速输入

5、PasswordEditText。默认限定六位密码、类似支付宝、微信支付密码输入框。

6、... ...

progress

集成了CircleProgress这个进度条开源库以及Android-SVProgressHUD,便于显示进度条和 Loadding 动画

list

1、BorderScrollView。到达顶部或底部触发事件的 ScrollView

2、NoScrollListView、NotScrollGridView:全部展开的 ListView,解决与 ScrollView,由于这两款控件都自带滚动条,嵌套便会出问题,即 GridView 或 ListView 会显示不全。

3、ReboundListView、ReboundScrollView:弹性 ListView 和 ScrollView,类似 iOS 实现上下拉可以超出,手指离开后弹回的“阻尼”效果

4、RefreshListView:轻量级下拉刷新 ListView 控件

layout

AutoLineFeedLayout:自动换行的容器。本质为 ViewGroup

common

SafePopupWindow:弹窗之前检测 Activity 是否销毁,防止异常

ViewHolder:ListView 或 GridView 等的适配器视图缓存公共类,在 adapter 的 getView()中使用

button

1、SmoothCheckBox:自定义 CheckBox,示例:

<com.yuyh.library.view.button.SmoothCheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="15dp"
            app:smoothCheckBox_color_checked="#FF0000"
            app:smoothCheckBox_color_unchecked_stroke="#FF0000"
            app:smoothCheckBox_is_rect="true" />

SwitchButton:自定义 SwitchButton 动画效果,示例:

<com.yuyh.library.view.button.SwitchButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:onColor="#aa66cc"
            app:swBorderWidth="2dp"/>
image

CircleImageView:自定义圆形图片控件,可用于头像

GifView:轻量级可播放 GIF 动画的控件

RotateImageView:自动旋转的 imageveiw,可用于 Loadding

RounderImageView:圆角的 ImageView

SimpleTagImageView:四个角斜边带标签的 ImageView

other

AppUtils:用于获取全局 Context、执行 UI 线程...

CrashHandler:全局异常捕获

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值