use of com.readystatesoftware.systembartint.SystemBarTintManager in project SeeWeather by xcc3641.
the class BaseActivity method setStatusBarColorForKitkat.
public void setStatusBarColorForKitkat(int color) {
/**
* Android4.4
*/
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setStatusBarTintResource(color);
}
}
use of com.readystatesoftware.systembartint.SystemBarTintManager in project smartmodule by carozhu.
the class BaseSimpleAppCompatActivity method setStatusBarTintResource.
/**
* @param resColorID
*/
public void setStatusBarTintResource(int resColorID) {
getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
activity = this;
context = this;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setTranslucentStatus(true);
}
if (mTintManager == null) {
mTintManager = new SystemBarTintManager(this);
mTintManager.setStatusBarTintEnabled(true);
}
mTintManager.setStatusBarTintResource(resColorID);
}
use of com.readystatesoftware.systembartint.SystemBarTintManager in project Tapad by berict.
the class ToolbarHelper method setStatusBarTint.
public void setStatusBarTint(Activity activity) {
SystemBarTintManager tintManager = new SystemBarTintManager(activity);
// enable status bar tint
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint
tintManager.setNavigationBarTintEnabled(true);
// set the transparent color of the status bar, 20% darker
tintManager.setTintColor(activity.getResources().getColor(R.color.dark_status_bar));
}
use of com.readystatesoftware.systembartint.SystemBarTintManager in project SystemBarTint by jgilfelt.
the class ColorActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_color);
mTintManager = new SystemBarTintManager(this);
mTintManager.setStatusBarTintEnabled(true);
mTintManager.setNavigationBarTintEnabled(true);
mColorPicker = (ColorPicker) findViewById(R.id.color_picker);
applySelectedColor();
mButton = (Button) findViewById(R.id.button);
mButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
applySelectedColor();
}
});
}
use of com.readystatesoftware.systembartint.SystemBarTintManager in project FastDev4Android by jiangqqlmj.
the class TranslucentActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.translucent_layout);
tv = (TextView) this.findViewById(R.id.tv);
int mode = getIntent().getIntExtra("mode", 0);
Log.d(TAG, "MODE:" + mode);
//当系统版本为4.4或者4.4以上时可以使用沉浸式状态栏
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
//透明状态栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//透明导航栏
getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
if (mode == 0) {
LinearLayout linear_bar = (LinearLayout) findViewById(R.id.linear_bar);
linear_bar.setVisibility(View.VISIBLE);
int statusHeight = getStatusBarHeight();
android.widget.LinearLayout.LayoutParams params = (android.widget.LinearLayout.LayoutParams) linear_bar.getLayoutParams();
params.height = statusHeight;
linear_bar.setLayoutParams(params);
tv.setText("系统方法沉浸式实现");
} else if (mode == 1) {
// create our manager instance after the content view is set
SystemBarTintManager tintManager = new SystemBarTintManager(this);
// 激活状态栏
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint 激活导航栏
tintManager.setNavigationBarTintEnabled(true);
//设置系统栏设置颜色
//tintManager.setTintColor(R.color.red);
//给状态栏设置颜色
tintManager.setStatusBarTintResource(R.color.middle_red);
// 设置导航栏设置资源
tintManager.setNavigationBarTintResource(R.color.color_nav);
tv.setText("第三方库沉浸式实现");
}
}
}
Aggregations