当前位置: 首页>>代码示例>>Java>>正文


Java SystemBarTintManager.setStatusBarTintEnabled方法代码示例

本文整理汇总了Java中com.readystatesoftware.systembartint.SystemBarTintManager.setStatusBarTintEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java SystemBarTintManager.setStatusBarTintEnabled方法的具体用法?Java SystemBarTintManager.setStatusBarTintEnabled怎么用?Java SystemBarTintManager.setStatusBarTintEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.readystatesoftware.systembartint.SystemBarTintManager的用法示例。


在下文中一共展示了SystemBarTintManager.setStatusBarTintEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
public void afterCreate(Bundle savedInstanceState) {

    View toolbar = findViewById(R.id.ll_root);
    toolbar.setPadding(0, PhoneInfoUtils.getStatusBarHeight(this), 0, 0);//防止遮挡
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintColor(MethodUtils.getColor(toolbar, R.color.main_theme));
        tintManager.setStatusBarTintEnabled(true);
    }

    findViewById(R.id.iv_back).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            finish();
        }
    });

}
 
开发者ID:maxwell-nc,项目名称:ExhibitionCenter,代码行数:22,代码来源:ScanActivity.java

示例2: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_three);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        //透明状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        //透明导航栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        // 激活状态栏
        tintManager.setStatusBarTintEnabled(true);
        // enable navigation bar tint 激活导航栏
        tintManager.setNavigationBarTintEnabled(true);
        //设置系统栏设置颜色
        //tintManager.setTintColor(R.color.red);
        //给状态栏设置颜色
        tintManager.setStatusBarTintResource(R.color.mask_tags_1);
        //Apply the specified drawable or color resource to the system navigation bar.
        //给导航栏设置资源
        tintManager.setNavigationBarTintResource(R.color.mask_tags_1);
    }
}
 
开发者ID:wuyinlei,项目名称:ImmersiveStatusBar,代码行数:24,代码来源:ThreeActivity.java

示例3: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    buildMockData();
    listView = (ListView) findViewById(R.id.listView);
    viewCell = new ViewCell(dataModel);
    listView.setAdapter(viewCell);
    viewCell.notifyDataSetChanged();
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
        setTranslucentNavigation(true);

    }

    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setStatusBarTintColor(Color.parseColor("#00796B"));
}
 
开发者ID:cbedoy,项目名称:EasterListView,代码行数:21,代码来源:MainActivity.java

示例4: setTranslucentStatus

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@TargetApi(19)
public void setTranslucentStatus(Activity activity, boolean on) {
    if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
        Window win = activity.getWindow();
        WindowManager.LayoutParams winParams = win.getAttributes();
        final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
        if (on) {
            winParams.flags |= bits;
        } else {
            winParams.flags &= ~bits;
        }
        win.setAttributes(winParams);

        SystemBarTintManager tintManager = new SystemBarTintManager(activity);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setNavigationBarTintEnabled(false);
        tintManager.setStatusBarTintColor(activity.getResources().getColor(R.color.colorPrimary));
        //tintManager.setNavigationBarTintColor(activity.getResources().getColor(R.color.colorPrimary));
        //			tintManager.setStatusBarTintResource(R.color.colorPrimary);
    }
}
 
开发者ID:captain-miao,项目名称:bleYan,代码行数:22,代码来源:HomeActivity.java

示例5: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sample);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintResource(R.color.app_main_theme_color);
    }
    fragmentManager = getFragmentManager();
    regToWx();
    initActionBar();
    initUpdate();
    initViews();
    initViewEvents();

    showFragment(1);

}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:22,代码来源:EveryXDayMainActivity.java

示例6: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.inject(this);
    setSupportActionBar(toolbar);
    // create our manager instance after the content view is set
    mTintManager = new SystemBarTintManager(this);
    // enable status bar tint
    mTintManager.setStatusBarTintEnabled(true);
    adapter = new MyPagerAdapter(getSupportFragmentManager());
    pager.setAdapter(adapter);
    tabs.setViewPager(pager);
    final int pageMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources()
            .getDisplayMetrics());
    pager.setPageMargin(pageMargin);
    changeColor(getResources().getColor(R.color.green));

    tabs.setOnTabReselectedListener(new SpinningTabStrip.OnTabReselectedListener() {
        @Override
        public void onTabReselected(int position) {
            Toast.makeText(MainActivity.this, "Tab reselected: " + position, Toast.LENGTH_SHORT).show();
        }
    });
}
 
开发者ID:eccyan,项目名称:SpinningTabStrip,代码行数:26,代码来源:MainActivity.java

示例7: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Timber.i("onCreate");
    AVAnalytics.trackAppOpened(getIntent());
    setContentView(provideContentViewId());
    ButterKnife.inject(this);
    if(toolbar!=null){
        setSupportActionBar(toolbar);
    }
    if(!TextUtils.isEmpty(NavUtils.getParentActivityName(this))){
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }
    if(Build.VERSION.SDK_INT <= 19){
        tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setNavigationBarTintEnabled(true);
        tintManager.setStatusBarTintColor(getResources().getColor(R.color.primary_dark));
    }
}
 
开发者ID:linroid,项目名称:Sky31Radio,代码行数:21,代码来源:BaseActivity.java

示例8: initTintManager

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
private void initTintManager() {
    // 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(false);

    // set a custom tint color for all system bars
    // tintManager.setTintColor(getResources().getColor(R.color.dark_darker));
    // set a custom navigation bar resource
    // tintManager.setNavigationBarTintResource(R.color.dark_darker);
    // set a custom status bar drawable
    // tintManager.setStatusBarTintColor(getResources().getColor(R.color.dark_darker));

    // Create SystemBarTintManager
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setStatusBarTintResource(R.color.dark_dark);
    mBarTintManager = tintManager;
}
 
开发者ID:PowerBack,项目名称:AnKey,代码行数:22,代码来源:SuperActivity.java

示例9: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_donate);
  SystemBarTintManager tintManager = new SystemBarTintManager(this);
  tintManager.setStatusBarTintEnabled(true);
  tintManager.setStatusBarTintResource(R.color.statusbar_color);

  View mainContainer = findViewById(R.id.main_container);
  SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    mainContainer.setPadding(0, config.getPixelInsetTop(true), config.getPixelInsetRight(), config.getPixelInsetBottom());
  }
  donationButton     = (Button) findViewById(R.id.button_donate);
  githubButton       = (Button) findViewById(R.id.button_github);

  donationButton.setOnClickListener(this);
  githubButton.setOnClickListener(this);
}
 
开发者ID:macbury,项目名称:EnklawaPlayer,代码行数:20,代码来源:DonateActivity.java

示例10: 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));
    }
}
 
开发者ID:aravindsagar,项目名称:SmartLockScreen,代码行数:20,代码来源:AddEnvironment.java

示例11: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(R.id.container, new HipSpiceFragment_())
                .commit();
    }
    setProgressBarVisibility(false);
    setProgressBarIndeterminateVisibility(false);
    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setStatusBarTintResource(R.color.blue);
    SpannableString spannableString = new SpannableString(getString(R.string.app_name));
    spannableString.setSpan(
            new TypefaceSpan(this, "OpenSans-Regular.ttf"),
            0,
            spannableString.length(),
            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
    );
    getSupportActionBar().setTitle(spannableString);
}
 
开发者ID:runningcode,项目名称:Hipster-Visualization,代码行数:23,代码来源:RateActivity.java

示例12: 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);
    }

}
 
开发者ID:2fast2fourier,项目名称:something.apk,代码行数:27,代码来源:SomeActivity.java

示例13: 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);
}
 
开发者ID:MainMethod1,项目名称:TrailMix-for-peel-android,代码行数:19,代码来源:PrefActivity.java

示例14: 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();
    }
}
 
开发者ID:aravindsagar,项目名称:SmartLockScreen,代码行数:25,代码来源:SmartLockScreenSettings.java

示例15: updateViews

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
/**
 * Call this method when you need to update the MainActivity view components' colors based on
 * update in the {@link MainActivity#currentTab}
 * Warning - All the variables should be initialised before calling this method!
 */
public void updateViews(ColorDrawable colorDrawable) {
    // appbar view color
    mainActivity.buttonBarFrame.setBackgroundColor(colorDrawable.getColor());
    // action bar color
    mainActivity.getSupportActionBar().setBackgroundDrawable(colorDrawable);
    // drawer status bar I guess
    mainActivity.mDrawerLayout.setStatusBarBackgroundColor(colorDrawable.getColor());
    // drawer header background
    mainActivity.drawerHeaderParent.setBackgroundColor(colorDrawable.getColor());

    if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        // for lollipop devices, the status bar color
        mainActivity.getWindow().setStatusBarColor(colorDrawable.getColor());
        if (colourednavigation)
            mainActivity.getWindow().setNavigationBarColor(PreferenceUtils
                    .getStatusColor(colorDrawable.getColor()));
    } else if (SDK_INT == Build.VERSION_CODES.KITKAT_WATCH || SDK_INT == Build.VERSION_CODES.KITKAT) {

        // for kitkat devices, the status bar color
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(colorDrawable.getColor());
    }
}
 
开发者ID:TeamAmaze,项目名称:AmazeFileManager,代码行数:30,代码来源:MainActivity.java


注:本文中的com.readystatesoftware.systembartint.SystemBarTintManager.setStatusBarTintEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。