本文整理匯總了Java中com.readystatesoftware.systembartint.SystemBarTintManager.setTintColor方法的典型用法代碼示例。如果您正苦於以下問題:Java SystemBarTintManager.setTintColor方法的具體用法?Java SystemBarTintManager.setTintColor怎麽用?Java SystemBarTintManager.setTintColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.readystatesoftware.systembartint.SystemBarTintManager
的用法示例。
在下文中一共展示了SystemBarTintManager.setTintColor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// mNewsItemBiz = new NewsItemBiz(this);
//使用tintManager設置狀態欄的顏色
mTintManager= new SystemBarTintManager(this);
// enable status bar tint
//mTintManager.setStatusBarTintEnabled(true);
if (isNavBarTransparent()) {
mTintManager.setStatusBarTintEnabled(true);
// 有虛擬按鍵時
if (isHasNavigationBar()) {
mTintManager.setNavigationBarTintEnabled(true);
}else{
mTintManager.setNavigationBarTintEnabled(false);
}
}
// set a custom tint color for all system bars
mTintManager.setTintColor(getResources().getColor(R.color.dark_primary_color));
// SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
}
示例2: setBarColor
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
public void setBarColor(int color) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS, WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow().setStatusBarColor(color);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setTintColor(color);
tintManager.setStatusBarTintEnabled(true);
tintManager.setNavigationBarTintEnabled(true);
}
}
示例3: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.webview);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
SystemBarTintManager manager = new SystemBarTintManager(this);
manager.setStatusBarTintEnabled(true);
int color = getResources().getColor(R.color.gpcard_image_bg_green);
manager.setTintColor(color);
}
ActionBar actionBar = getActionBar();
actionBar.setTitle(null);
actionBar.setDisplayHomeAsUpEnabled(true);
fragment = (WebViewFragment) getSupportFragmentManager().findFragmentById(R.id.webview_fragment);
}
示例4: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.init);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
SystemBarTintManager manager = new SystemBarTintManager(this);
manager.setStatusBarTintEnabled(true);
int color = getResources().getColor(R.color.gpcard_image_bg_green);
manager.setTintColor(color);
}
requests = Volley.newRequestQueue(this);
getHomePage();
}
示例5: configureActionbar
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
private void configureActionbar(){
ActionBar bar = getActionBar();
bar.setHomeButtonEnabled(true);
bar.setDisplayShowHomeEnabled(false);
tint = new SystemBarTintManager(this);
TypedValue tintColor = new TypedValue();
if(getTheme().resolveAttribute(R.attr.statusBarBackground, tintColor, true)){
tint.setStatusBarTintEnabled(true);
tint.setTintColor(tintColor.data);
defaultActionbarColor = tintColor.data;
currentActionbarColor = tintColor.data;
}else{
tint.setStatusBarTintEnabled(false);
}
TypedValue actionbarBackground = new TypedValue();
if(getTheme().resolveAttribute(R.attr.actionbarBackgroundLayerList, actionbarBackground, false)){
actionbarBackgroundList = (LayerDrawable) getResources().getDrawable(actionbarBackground.data);
actionbarBackgroundList.mutate();
actionbarColor = (ColorDrawable) actionbarBackgroundList.findDrawableByLayerId(R.id.actionbar_background_color);
actionbarColor.mutate();
bar.setBackgroundDrawable(actionbarBackgroundList);
}
}
示例6: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// to make the statusbar tinted in API 19 or above, won't make any
// difference in other devices
SystemBarTintManager tintManager = new SystemBarTintManager(this);
// enable status bar tint
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint
tintManager.setNavigationBarTintEnabled(true);
tintManager.setTintColor(Color.parseColor("#00796b"));
// Display the fragment as the main content.
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new PrefFragment()).commit();
getActionBar().setDisplayHomeAsUpEnabled(true);
}
示例7: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_edit_environment);
if (savedInstanceState == null) {
placeholderFragment = new PlaceholderFragment();
getFragmentManager().beginTransaction()
.add(R.id.container, placeholderFragment)
.commit();
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
int flags = getWindow().getAttributes().flags | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
getWindow().setFlags(flags,flags);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(getResources().getColor(R.color.action_bar_edit_environment));
}
}
示例8: setUpActionBar
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
private void setUpActionBar(){
ActionBar actionBar = getSupportActionBar();
actionBarColor = getResources().getColor(R.color.action_bar_settings);
if(!Utility.checkForNullAndWarn(actionBar, LOG_TAG)){
actionBar.setBackgroundDrawable(new ColorDrawable(actionBarColor));
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
}
tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(actionBarColor);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
mPaddingTop = tintManager.getConfig().getPixelInsetTop(true);
if(Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT){
mPaddingTop += 16;
}
mPaddingBottom = tintManager.getConfig().getNavigationBarHeight();
}
}
示例9: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_location);
//Intent
intent = getIntent();
//Init
setUpActionBar();
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(getResources().getColor(R.color.action_bar_location));
paddingBottom = tintManager.getConfig().getNavigationBarHeight();
paddingTop = tintManager.getConfig().getPixelInsetTop(true);
if(Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT){
paddingTop += 16;
}
}
setUpGoogleMap();
}
示例10: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_master_password);
mSetMasterPasswordFragment = new SetMasterPasswordFragment();
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, mSetMasterPasswordFragment)
.commit();
}
ActionBar actionBar = getSupportActionBar();
if(!Utility.checkForNullAndWarn(actionBar, LOG_TAG)) {
actionBar.setBackgroundDrawable(new ColorDrawable(
getResources().getColor(R.color.action_bar_setup)));
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,
WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(getResources().getColor(R.color.action_bar_setup));
}
}
示例11: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_environment);
if (savedInstanceState == null) {
placeholderFragment = new PlaceholderFragment();
getFragmentManager().beginTransaction()
.add(R.id.container, placeholderFragment)
.commit();
}
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){
int flags = getWindow().getAttributes().flags | WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
getWindow().setFlags(flags,flags);
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(getResources().getColor(R.color.action_bar_add_environment));
}
}
示例12: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActionBar().setIcon(R.drawable.logo_trans);
getActionBar().setDisplayHomeAsUpEnabled(true);
String token = FoursquareAccount.getInstance().getToken(this);
if(token == null || token.equals("")){
startActivity(new Intent(this, LoginActivity_.class));
finish();
}else{
api.setoAuthToken(token);
}
// create our manager instance after the content view is set
SystemBarTintManager tintManager = new SystemBarTintManager(this);
// enable status bar tint
tintManager.setStatusBarTintEnabled(true);
// enable navigation bar tint
tintManager.setNavigationBarTintEnabled(true);
// set a custom tint color for all system bars
tintManager.setTintColor(getResources().getColor(R.color.blue));
}
示例13: onCreate
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int color = getResources().getColor(R.color.action_bar_red);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(color);
}
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
Drawable icon = getResources().getDrawable(R.drawable.ic_launcher);
icon.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP);
getSupportActionBar().setIcon(icon);
}
示例14: setupAppBar
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
/**
* Sets up a top-padding for the given app bar equal to the height of the status bar.
* This increases the length of the app bar so it fits nicely below the status bar.
* This method also sets the status bar transparency.
*
* @param appBar Toolbar to set padding to
* @param activity Activity - current activity
*/
public static void setupAppBar(Toolbar appBar, Activity activity) {
appBar.setPadding(0, getStatusBarHeight(activity.getResources()), 0, 0);
SystemBarTintManager tintManager = new SystemBarTintManager(activity);
tintManager.setStatusBarTintEnabled(true);
tintManager.setNavigationBarTintEnabled(true);
tintManager.setTintColor(Color.parseColor("#10000000"));
}
示例15: tintBars
import com.readystatesoftware.systembartint.SystemBarTintManager; //導入方法依賴的package包/類
private void tintBars(){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setTranslucentStatusAndNavigationBar();
}
tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setNavigationBarTintEnabled(true);
tintManager.setTintColor(ThemeUtil.getPrimaryColor(this));
}