getActivity / TitleBar

Android 标题栏框架,从此布局属性不用记
Apache License 2.0
1.75k stars 217 forks source link

icon可以支持设置tint #35

Closed br3ant closed 4 years ago

getActivity commented 4 years ago

这种需求比较少见,暂不考虑支持

getActivity commented 4 years ago

但是你可以用这种方式实现

getActivity commented 4 years ago
// 初始化 TitleBar
TitleBar.setDefaultInitializer(new LightBarInitializer() {
    @Override
    protected TextView createTextView(Context context) {
        return new AppCompatTextView(context);
    }
});
getActivity commented 4 years ago
mTitleBar = findViewById(R.id.tb_main_bar);
AppCompatTextView leftView = (AppCompatTextView) mTitleBar.getLeftView();
leftView.setSupportBackgroundTintList();
leftView.setSupportBackgroundTintMode();
br3ant commented 4 years ago

好的,我fork下来自己改吧,不过我感觉这是一个强需求

getActivity commented 4 years ago

titlebar.aar.zip

getActivity commented 4 years ago
app:leftTint="#ff00ff"
app:rightTint="#00ff00"
getActivity commented 4 years ago

小伙子,我刚刚加上了,你可以用这个包试一下