• Stars
    star
    155
  • Rank 240,864 (Top 5 %)
  • Language
    Java
  • License
    MIT License
  • Created almost 8 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

One VectorCompatTextView suits for hundreds of CompoundDrawable style. 一个库,满足CompoundDrawable的百变风格。

API License

VectorCompatTextView

With this multifunctional TextView, the VectorDrawable resources can be set as CompoundDrawables, furthermore, the majority of scenarios to manipulate CompoundDrawables have been supported, such as checked state, color tinting/setting, custom size setting, visibility, RTL, etc. AndroidX version is available.

这个炒鸡强大的库可以让你轻松将VectorDrawable资源设置为CompoundDrawable,并且支持大多数操控CompoundDrawable的情景,如:checked状态,颜色设置或着色,自定义宽高,隐藏或显示,RTL布局等等(当然常规资源如png/jpg,Drawable的子类等更不在话下)。有AndroidX版本。

Screenshot

demo5 demo6

Download

root project:build.gradle

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

app:build.gradle

  android {
      ...
      defaultConfig {
          ...
          vectorDrawables.useSupportLibrary = true  // essential
      }
  ...

  dependencies {
     // Support
     // e.g. implementation 'com.github.woxingxiao:VectorCompatTextView:2.7'
     implementation 'com.github.woxingxiao:VectorCompatTextView:${LATEST_VERSION}'

     // AndroidX
     // e.g. implementation 'com.github.woxingxiao:VectorCompatTextView:2.7-androidx'
     implementation 'com.github.woxingxiao:VectorCompatTextView:${LATEST_VERSION}-androidx'
  }

Usage

<com.xw.repo.VectorCompatTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="GitHub"
    app:drawableLeftCompat="@drawable/svg_ic_github"/>

<com.xw.repo.VectorCompatTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Next"
    app:drawableRightCompat="@drawable/svg_ic_arrow_right"
    app:tintDrawableInTextColor="true"/>

<com.xw.repo.VectorCompatTextView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="ON"
    app:drawableCompatColor="#f44336"
    app:drawableBottomCompat="@drawable/svg_ic_line"/>

<com.xw.repo.VectorCompatTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="GitHub"
    app:drawableAdjustTextWidth="true"
    app:drawableTopCompat="@drawable/svg_ic_github"/>

<com.xw.repo.VectorCompatTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="GitHub"
    app:drawableWidth="24dp"
    app:drawableHeight="32dp"
    app:drawableLeftCompat="@mipmap/ic_launcher"/>

<com.xw.repo.VectorCompatTextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="评论"
    app:drawableAdjustTextHeight="true" <!-- text bounds -->
    app:drawableLeftCompat="@drawable/shape_rect_solid_red"
    app:drawableWidth="4dp"/>

<com.xw.repo.VectorCompatTextView
    android:layout_width="120dp"
    android:layout_height="wrap_content"
    android:checked="true"
    android:gravity="center"
    android:text="SELECTED TAB"
    android:textColor="@drawable/selector_text_color_tab"
    app:drawableAdjustViewWidth="true" <!-- view bounds -->
    app:drawableBottomCompat="@drawable/selector_drawable_tab"
    app:drawableHeight="2dp"/>

Check the Demo for complete usage.

LICENSE

MIT

More Repositories

1

BubbleSeekBar

A beautiful Android custom seekbar, which has a bubble view with progress appearing upon when seeking. 自定义SeekBar,进度变化更以可视化气泡样式呈现
Java
3,322
star
2

SlidingUpPanelLayout

A vertical-handled and multi-panel support SlidingPanelLayout. 一个竖直方向的SlidingPanelLayout,支持加载多个Panel,可以灵活地实现漂亮的的交互效果。
Java
1,562
star
3

GracefulMovies

简影讯,简约精彩影讯。基于Retrofit+RxJava+Android Arch+DataBinding+Room的高颜值影讯app。简约,优雅,精彩,即看即走,已正式发布上线。
Java
892
star
4

DashboardView

Android自定义仪表盘View,仿新旧两版芝麻信用分、炫酷汽车速度仪表盘
Java
832
star
5

XEditText

XEditText: clear contents easily; show/hide password; separeta contents automatically, such as credit card number; disable Emoji inputs; 带删除功能的EditText;显示或者隐藏密码;可设置自动添加分隔符分割电话号码、银行卡号等;支持禁止Emoji表情符号输入。
Java
512
star
6

FillBlankView

基于EditText,仿手机支付宝、微信支付时数字密码输入验证的控件,同时支持文字输入验证
Java
123
star
7

BounceScrollView

🔥🔥 An Android costomized ScrollView which likes UIScrollView over-scrolling effect in iOS.
Java
120
star
8

ScaleTransitionAnim

图片预览缩放过渡动画,效果如微信朋友圈,手机系统相册
Java
61
star
9

PullToRefreshAndLoadMore

Android下拉刷新、上拉加载更多控件,满足ListView等最常用上下拉刷新数据的需求,并理论上支持所有View。[DEPRECATED]
Java
58
star
10

EncryptHelper

Android data localized safely encryption/decryption tool. 数据安全本地化加密解密工具。
Java
17
star
11

Chameleon

【变色龙】实现优雅平滑地在两个色值之间过渡
Java
14
star