2017.1-TOP5 Android开源库

Colorful (Github)

Colorful简单实用,通过这个开源库可以通过编码的方式来改变应用的主题,不再需要定义不同的style

dependencies {
    compile 'com.github.garretyoder:Colorful:1.1'
}
public class SampleApp extends Application { @Override public void onCreate() { super.onCreate(); Colorful.init(this); } }

你需要改变主题的Activity必须继承CActivity

public class MainActivity extends CActivity

或者在 setContentView()之前调用下面的方法

Colorful.applyTheme(Activity activity);

也可以调用 Colorful.applyTheme(Activity activity, Boolean overrideBase); 参数 overrideBase 说明是否要覆盖本身的主题

可以在初始化时,设置默认的主题

public class SampleApp extends Application { @Override public void onCreate() { super.onCreate(); Colorful.defaults() .primaryColor(Colorful.ThemeColor.RED) .accentColor(Colorful.ThemeColor.BLUE) .translucent(false) .dark(true); Colorful.init(this); } }

在代码中可以使用配置随时修改

Colorful.config(this)
                .primaryColor(Colorful.ThemeColor.RED) .accentColor(Colorful.ThemeColor.BLUE) .translucent(false) .dark(true) .apply();

Stencil (Github)

是时候给你的文字来点花样了

dependencies {
  compile 'com.github.thoughtbot:stencil:1.0'
}

WaveLoading (Github)

波浪形动画

compile 'com.race604.waveloading:library:1.1.1'

使用

Drawable mWaveDrawable = new WaveDrawable(otherDrawable);

// Use as common drawable imageView.setImageDrawable(mWaveDrawable);

其他的配置方法

public void setWaveAmplitude(int amplitude), set wave amplitude (in pixels) public void setWaveLength(int length), set wave length (in pixels) public void setWaveSpeed(int step), set wave move speed (in pixels) public void setIndeterminate(boolean indeterminate), like progress bar, if run in indeterminate mode, it'll increase water level over and over again, otherwise, you can use boolean setLevel(int level) to set the water level, acting as loading progress. public void setIndeterminateAnimator(ValueAnimator animator), set you customised animator for wave loading animation in indeterminate mode.

BufferTextInputLayout (Github)

一个简单的定制化的TextInputLayout

<org.buffer.android.buffertextinputlayout.BufferTextInputLayout
        android:layout_width="match_parent" android:layout_height="wrap_content" app:counterEnabled="true" app:counterMaxLength="10" app:counterOverflowTextAppearance="@style/counterOverride" app:counterTextAppearance="@style/counterText" app:hintEnabled="true" app:counterMode="ascending"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/text_hint" /> </org.buffer.android.buffertextinputlayout.BufferTextInputLayout>



PageLoader (Github)

定制页面加载的一个开源库

dependencies {
    compile 'id.arieridwan:pageloader:0.0.2'
}
<id.arieridwan.lib.PageLoader
    android:id="@+id/pageloader"
    android:layout_width="match_parent" android:layout_height="match_parent">
SomeMethod(){
pageLoader.startProgress();
...
    onComplete(){
        ...
    }
    onNext(){ ... pageLoader.stopProgress(); } onError(){ ... pageLoader.stopProgressAndFailed(); } }

原文

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值