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


Java SystemBarTintManager.setStatusBarTintResource方法代码示例

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


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

示例1: 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

示例2: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_common_listview);
	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);
	}
	containerView = (LinearLayout)findViewById(R.id.myLinearLayout);
	context = this;
	inflater = LayoutInflater.from(context);
	
	listDataLoadWrap = new CommonListRequestWrap<T>(context, this, getBeanType());
	pagingListViewWrap = getPagingListViewWrap(this);
	loadListDataErrorViewWrap = new LoadListDataErrorViewWrap(this);
}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:20,代码来源:ListBaseActivity.java

示例3: 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

示例4: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();
    if(intent == null){
        finish();
        return;
    }
    super.onCreate(savedInstanceState);
    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);
    }
    inflater = LayoutInflater.from(this);

    mTencent = Tencent.createInstance(Globe.QQ_APP_ID, this);
    mAuthInfo = new AuthInfo(this, Globe.SINA_APP_KEY, Globe.SINA_REDIRECT_URL, null);
    mSsoHandler = new SsoHandler(this, mAuthInfo);
    mIWeiboShareAPI =  WeiboShareSDK.createWeiboAPI(this, Globe.SINA_APP_KEY);
    mIWeiboShareAPI.registerApp();
}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:24,代码来源:ToolbarControlDetailListViewActivity.java

示例5: attachToActivity

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
public void attachToActivity(Activity activity) {
    mActivity = activity;

    TypedArray a = activity.getTheme().obtainStyledAttributes(new int[]{
            android.R.attr.windowBackground
    });
    int background = a.getResourceId(0, 0);
    a.recycle();

    ViewGroup decor = (ViewGroup) activity.getWindow().getDecorView();
    ViewGroup decorChild = (ViewGroup) decor.getChildAt(0);
    decorChild.setBackgroundResource(background);
    decor.removeView(decorChild);
    addView(decorChild);
    setContentView(decorChild);
    decor.addView(this);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);
        SystemBarTintManager tintManager = new SystemBarTintManager(activity);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintResource(R.color.app_main_theme_color);
    }
}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:26,代码来源:SwipeBackLayout.java

示例6: 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

示例7: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);

	Toolbar toolbar = (Toolbar) findViewById(R.id.main_toolbar);
	setSupportActionBar(toolbar);

	getSupportFragmentManager().beginTransaction().add(R.id.main_content_container, new ContentFragment()).commit();

	if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) {
		SystemBarTintManager tintManager = new SystemBarTintManager(this);
		tintManager.setStatusBarTintEnabled(true);
		tintManager.setStatusBarTintResource(R.color.status_bar_color);
	}
}
 
开发者ID:kyleduo,项目名称:MDNavigationDrawer,代码行数:17,代码来源:MainActivity.java

示例8: 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

示例9: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  getFragmentManager().beginTransaction()
          .replace(android.R.id.content, new SettingsFragment())
          .commit();
  getActionBar().setDisplayHomeAsUpEnabled(true);

  SystemBarTintManager tintManager = new SystemBarTintManager(this);
  tintManager.setStatusBarTintEnabled(true);
  tintManager.setStatusBarTintResource(R.color.statusbar_color);

  View mainContentView = findViewById(android.R.id.content);
  SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    mainContentView.setPadding(0, config.getPixelInsetTop(true), config.getPixelInsetRight(), config.getPixelInsetBottom());
  }
}
 
开发者ID:macbury,项目名称:EnklawaPlayer,代码行数:19,代码来源:SettingsActivity.java

示例10: 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

示例11: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@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("第三方库沉浸式实现");
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:39,代码来源:TranslucentActivity.java

示例12: initSystemBar

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
/**
 * 沉浸式状态栏.
 */
public void initSystemBar(Activity activity) {

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(activity, true);
    }

    SystemBarTintManager tintManager = new SystemBarTintManager(activity);
    tintManager.setStatusBarTintEnabled(true);
    // 使用颜色资源
    tintManager.setStatusBarTintResource(R.color.colorPrimary);

}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:16,代码来源:BaseActivity.java

示例13: onCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_before_push_live);
    setActionBarLayout(R.layout.actionbar_layout_push);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(true);
    }

    SystemBarTintManager tintManager = new SystemBarTintManager(this);
    tintManager.setStatusBarTintEnabled(true);
    tintManager.setStatusBarTintResource(R.color.green_bg);
    enterPushBtn = (ImageButton) findViewById(R.id.enter_topush);
    mPush_room_url = (EditText) findViewById(R.id.push_room_url);
    enterPushBtn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mPushAd_url = mPush_room_url.getText().toString().trim();
            Intent intent = new Intent(BeforePushLiveActivity.this, PushLiveActivity.class);
            intent.putExtra("pushUrl",mPushAd_url);
            startActivity(intent);
            overridePendingTransition(R.anim.magnify_fade_in, R.anim.magnify_fade_out);
        }
    });


}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:28,代码来源:BeforePushLiveActivity.java

示例14: setStatusBarColor

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
/**
 * 需要在setContentview之后再调用
 * @param activity
 */
public static void setStatusBarColor(Activity activity,int colorId){
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        setTranslucentStatus(activity,true);
        SystemBarTintManager mTintManager = new SystemBarTintManager(activity);
        mTintManager.setStatusBarTintEnabled(true);
        mTintManager.setStatusBarTintResource(colorId);
    }
}
 
开发者ID:glassLake,项目名称:fastDev,代码行数:13,代码来源:ViewUtils.java

示例15: setStatusBarColor

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
/**
     * 修改状态栏颜色,支持4.4以上版本
     *
     * @param activity
     * @param colorId
     */
    public static void setStatusBarColor(Activity activity, int colorId) {

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            Window window = activity.getWindow();
//      window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
            window.setStatusBarColor(activity.getResources().getColor(colorId));
        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            //使用SystemBarTint库使4.4版本状态栏变色,需要先将状态栏设置为透明
            transparencyBar(activity);
            SystemBarTintManager tintManager = new SystemBarTintManager(activity);
            tintManager.setStatusBarTintEnabled(true);
            tintManager.setStatusBarTintResource(colorId);
        }
    }
 
开发者ID:vondear,项目名称:RxTools,代码行数:21,代码来源:RxBarTool.java


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