Skip to content

zhanzengyu/AndroidWheel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
zhanzengyu
Sep 26, 2021
772d7b2 · Sep 26, 2021

History

24 Commits
Nov 18, 2019
May 27, 2020
Sep 26, 2021
Nov 18, 2019
Sep 26, 2021
Sep 26, 2021
Oct 23, 2019
Nov 18, 2019
Sep 26, 2021
Oct 23, 2019
Oct 23, 2019
Oct 23, 2019
Oct 26, 2019

Repository files navigation

AndroidWheel

Android 组件库,避免重复造轮子。

添加到项目

Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
  implementation 'com.github.nesger:AndroidWheel:1.0.2'
}

效果图

zlog.jpg

debounce_edit_text.gif

selector_button.jpg

Releases

Releases

版本更新:

1.0.2:
增加 SelectorButton 工具类,减少 selector xml 文件的书写。

1.0.1:
增加防抖动 EditText

1.0.0:
提供日志工具类 ZLog,方便定位日志位置。提高开发效率。
提供日志辅助类 ZLogHelper,方便转换日志内容支持点击跳转。


文档

SelectorButton

功能:按住背景变色通用按钮 特点:支持代码配置和 xml 配置

xml 配置:

<com.zengyu.wheel.widgets.SelectorButton
    android:layout_marginTop="20dp"
    android:layout_width="200dp"
    android:layout_height="50dp"
    app:normal_color="#1a61a8"
    app:press_color="#63a3e3"
    app:stroke_color="#c4d6e9"
    app:stroke_width="6dp"
    android:text="xml stroke"
    android:textColor="@android:color/white"
    />

DebounceEditText

功能:防抖动
特点:支持代码配置和 xml 配置

xml 配置:

<com.zengyu.wheel.widgets.DebounceEditText
    android:id="@+id/edt_xml"
    android:layout_width="match_parent"
    android:layout_height="30dp"
    app:debounce_time="1000"
    />

ZLog

功能:日志工具类
特点:使用方便;可以快速点击跳转到日志打印处;

最简单用法:

// 1.打开开关。
ZLog.setDebugMode(true);
// 2.直接使用。
ZLog.e("use default tag ZLOG");

API:
setDebugMode(boolean debugMode): 设置是否打印日志。
setLinkMode(boolean linkMode): 设置是否支持日志跳转。
setTag(String tag): 设置默认 TAG 名称。

默认不打印,支持日志跳转,TAG 为 ZLOG

ZLogHelper

功能:让日志内容支持点击跳转。
特点:方便易用。

记住一点,stackIndex 为 1 表示定位到调用 ZLogHelper 的地方。
因此如果做了一层封装,要定位到外部调用处,stackIndex 需要为 2。

API:
wrapMessage(int stackIndex, String message): 包装 message 使其支持点击跳转。