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


Java SystemBarTintManager.SystemBarConfig方法代码示例

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


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

示例1: hasTranslucentNavigation

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@TargetApi (19)
public boolean hasTranslucentNavigation() {
    if (!mTranslucentNavigationSet) {
        final SystemBarTintManager.SystemBarConfig config = getSystemBarTint().getConfig();
        if (Build.VERSION.SDK_INT >= 19) {
            boolean themeConfig =
                ((getWindow().getAttributes().flags & WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
                    == WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

            mTranslucentNavigation = themeConfig && config.hasNavigtionBar() && config.isNavigationAtBottom()
                && config.getNavigationBarHeight() > 0;
        }
        mTranslucentNavigationSet = true;
    }
    return mTranslucentNavigation;
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:17,代码来源:BaseActivity.java

示例2: setupToolbar

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
private int setupToolbar(final Activity activity) {
    SystemBarTintManager manager = new SystemBarTintManager(activity);
    final SystemBarTintManager.SystemBarConfig config = manager.getConfig();
    if (config.getPixelInsetTop(false) > 0) {
        ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) toolbar.getLayoutParams();
        params.topMargin = 0;
        params.height = config.getActionBarHeight() + config.getStatusBarHeight();
        toolbar.setLayoutParams(params);
        toolbar.setPadding(
            toolbar.getPaddingLeft(),
            toolbar.getPaddingTop() + config.getStatusBarHeight(),
            toolbar.getPaddingRight(),
            toolbar.getPaddingBottom()
        );
        return params.height;
    }
    return config.getActionBarHeight();
}
 
开发者ID:sephiroth74,项目名称:Material-BottomNavigation,代码行数:19,代码来源:ToolbarScrollHelper.java

示例3: getInsets

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
public static Rect getInsets(Activity context, View view)
{
    Rect insets = new Rect();

    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return insets;
    SystemBarTintManager tintManager = new SystemBarTintManager(context);
    SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();

    insets.left = 0;
    insets.right = config.getPixelInsetRight();
    insets.top = config.getPixelInsetTop(true);
    insets.bottom = config.getPixelInsetBottom();


    return insets;
}
 
开发者ID:joseliko7,项目名称:Snapmatic-Life,代码行数:17,代码来源:CamUtils.java

示例4: setInsets

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
private void setInsets(int color, View to_be_padded, boolean visibility) {

        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
        SystemBarTintManager.SystemBarConfig config = _tint_manager.getConfig();
        if (to_be_padded != null) {
            to_be_padded.setPadding(0, getPaddingInsetTop(false, config),
                    config.getPixelInsetRight(), config.getPixelInsetBottom());
        }

        if (_toolbar.getBackground() == null
                || !(_toolbar.getBackground() instanceof ColorDrawable)
                || ((ColorDrawable) _toolbar.getBackground()).getColor() != color) {
            _toolbar.setBackgroundColor(color);
        }
        //_toolbar.getBackground().setAlpha(alpha);
        int visibility_view = visibility ? View.VISIBLE : View.INVISIBLE;
        if (visibility_view != _toolbar.getVisibility()) {
            _toolbar.setVisibility(visibility_view);
        }
    }
 
开发者ID:codlab,项目名称:misfit-analyser,代码行数:21,代码来源:SystemFittableActivity.java

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

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

示例7: invalidateNavBar

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
public void invalidateNavBar() {
    if (SDK_INT == 20 || SDK_INT == 19) {
        SystemBarTintManager tintManager = new SystemBarTintManager(this);
        tintManager.setStatusBarTintEnabled(true);
        tintManager.setStatusBarTintColor(getColorPreference().getColor(ColorUsage.getPrimary(MainActivity.currentTab)));

        FrameLayout.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) findViewById(R.id.preferences).getLayoutParams();
        SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
        p.setMargins(0, config.getStatusBarHeight(), 0, 0);
    } else if (SDK_INT >= 21) {
        SharedPreferences Sp = PreferenceManager.getDefaultSharedPreferences(this);
        boolean colourednavigation = Sp.getBoolean(PreferencesConstants.PREFERENCE_COLORED_NAVIGATION, true);
        Window window = getWindow();
        window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        int tabStatusColor = PreferenceUtils.getStatusColor(getColorPreference().getColorAsString(ColorUsage.getPrimary(MainActivity.currentTab)));
        window.setStatusBarColor(tabStatusColor);
        if (colourednavigation) {
            window.setNavigationBarColor(tabStatusColor);
        } else if(window.getNavigationBarColor() != Color.BLACK){
            window.setNavigationBarColor(Color.BLACK);
        }
    }

    if (getAppTheme().equals(AppTheme.BLACK)) getWindow().getDecorView().setBackgroundColor(Utils.getColor(this, android.R.color.black));
}
 
开发者ID:TeamAmaze,项目名称:AmazeFileManager,代码行数:27,代码来源:PreferencesActivity.java

示例8: setInsets

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
public static void setInsets(Activity context, View view) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
        return;
    }
     SystemBarTintManager tintManager = new SystemBarTintManager(context);
     SystemBarTintManager.SystemBarConfig config = tintManager
     .getConfig();
     view.setPadding(0, config.getPixelInsetTop(true),
     config.getPixelInsetRight(), config.getPixelInsetBottom());
}
 
开发者ID:lookwhatlook,项目名称:WeiboWeiBaTong,代码行数:11,代码来源:TransLucentFragment.java

示例9: initRoot

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
private void initRoot() {
    mRoot = (RelativeLayout) findViewById(R.id.lay_super_root);

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        // Trans status bar
        StatusBarProxy.setImmersedWindow(getWindow(), true);
        // Init tint manager
        initTintManager();
        SystemBarTintManager.SystemBarConfig config = mBarTintManager.getConfig();
        // Set root padding
        mRoot.setPadding(0, config.getPixelInsetTop(false), config.getPixelInsetRight(), config.getPixelInsetBottom());
    }
}
 
开发者ID:PowerBack,项目名称:AnKey,代码行数:14,代码来源:SuperActivity.java

示例10: unsetInsets

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
public void unsetInsets() {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
    SystemBarTintManager.SystemBarConfig config = _tint_manager.getConfig();
    unsetInsetsToView(config, _parent);
    //_toolbar.getBackground().setAlpha(0);
    _toolbar.setBackgroundColor(getResources().getColor(R.color.transparent));
    setSystemColor(Color.TRANSPARENT, Color.TRANSPARENT);
}
 
开发者ID:codlab,项目名称:misfit-analyser,代码行数:9,代码来源:SystemFittableActivity.java

示例11: unsetInsetsAndGoneAlsoForLeftMenu

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
public void unsetInsetsAndGoneAlsoForLeftMenu(View left_menu) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
    SystemBarTintManager.SystemBarConfig config = _tint_manager.getConfig();
    unsetInsetsToView(config, _parent);
    if (left_menu != null)
        unsetInsetsToView(config, left_menu);
    _toolbar.setVisibility(View.GONE);
    //_toolbar.getBackground().setAlpha(0);
    _toolbar.setBackgroundColor(getResources().getColor(R.color.transparent));
    setSystemColor(Color.TRANSPARENT, Color.TRANSPARENT);
}
 
开发者ID:codlab,项目名称:misfit-analyser,代码行数:12,代码来源:SystemFittableActivity.java

示例12: initTranslucent

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
private void initTranslucent()
{
	// Return if user isn't on a version that supports this feature yet
	if(Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT)
		return;

	// Set translucency window flags
	Window window = getWindow();
	window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
	window.setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);

	// Initialize your Tint Manager
	mTintManager = new SystemBarTintManager(this);

	// Enable status bar tint and set to resource
	mTintManager.setStatusBarTintEnabled(true);
	mTintManager.setStatusBarTintColor(getResources().getColor(R.color.action_background));

	// Uncomment this line if you'd like to tint the nav bar as well
	//tintManager.setNavigationBarTintEnabled(true);

	// Set paddings & margins to main layout so they don't overlap the action/status bar
	SystemBarTintManager.SystemBarConfig config = mTintManager.getConfig();
	int actionBarSize = getResources().getDimensionPixelSize(R.dimen.action_height);
	mDrawerList.setPadding(0, actionBarSize + config.getStatusBarHeight(), 0, config.getPixelInsetBottom());
	ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) findViewById(R.id.feedContainer).getLayoutParams();
	params.setMargins(0, actionBarSize + config.getStatusBarHeight(), config.getPixelInsetRight(), 0);
}
 
开发者ID:Pkmmte,项目名称:TechDissected,代码行数:30,代码来源:MainActivity.java

示例13: onCreate

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

  App app           = App.current();
  Program program       = app.db.programs.find(app.intents.getProgramId(getIntent()));

  getActionBar().setTitle(program.name);
  getActionBar().setDisplayUseLogoEnabled(false);
  getActionBar().setDisplayShowTitleEnabled(true);
  ProgramEpisodesFragment fragment = new ProgramEpisodesFragment();
  fragment.setProgram(program);

  setContentView(R.layout.activity_program_episodes);
  getFragmentManager().beginTransaction()
          .replace(R.id.content_frame, fragment)
          .commit();

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

  View mainContentView = findViewById(R.id.content_frame);
  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,代码行数:29,代码来源:ProgramEpisodesActivity.java

示例14: onCreate

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

  SystemBarTintManager tintManager = new SystemBarTintManager(this);
  tintManager.setStatusBarTintEnabled(true);
  tintManager.setStatusBarTintResource(R.color.statusbar_color);
  playerFrameView               = (View)findViewById(R.id.player_frame);
  navDrawerListView             = (ListView) findViewById(R.id.left_drawer);
  mDrawerLayout                 = (DrawerLayout) findViewById(R.id.drawer_layout);
  mDrawerToggle                 = new MainActivityActionBarToggle(this, mDrawerLayout);
  mainContainer                 = findViewById(R.id.main_container);
  this.navigationController     = new NavigationController(this, navDrawerListView, mDrawerLayout, this);

  mDrawerLayout.setDrawerListener(mDrawerToggle);
  navigationController.setListener(this);

  ActionBar actionBar = getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  actionBar.setDisplayShowHomeEnabled(true);

  SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();

  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
    mainContainer.setPadding(0, config.getPixelInsetTop(true), config.getPixelInsetRight(), config.getPixelInsetBottom());
    navDrawerListView.setPadding((int) getResources().getDimension(R.dimen.nav_bar_padding), config.getPixelInsetTop(true), (int) getResources().getDimension(R.dimen.nav_bar_padding), config.getPixelInsetBottom());
  }
  showPlayer();

  //MainActivityTutorial tutorial = new MainActivityTutorial(this);
}
 
开发者ID:macbury,项目名称:EnklawaPlayer,代码行数:34,代码来源:MainActivity.java

示例15: onViewCreated

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    final SystemBarTintManager tintManager = new SystemBarTintManager(getActivity());
    final SystemBarTintManager.SystemBarConfig config = tintManager.getConfig();
    if (getMap() == null) {
        Toast.makeText(getActivity(), "An error occurred", Toast.LENGTH_SHORT).show();
        view.setPadding(0, config.getPixelInsetTop(true), config.getPixelInsetRight(),
                config.getPixelInsetBottom());
        return;
    }

    if (mClusterManager == null) {
        mClusterManager = new ClusterManager<>(getActivity().getApplicationContext(), getMap());
        final StopPointRenderer stopPointRenderer = new StopPointRenderer(getActivity()
                .getApplication(), getMap(),
                mClusterManager, getSpiceManager(), busMarkers
        );
        mClusterManager.setRenderer(stopPointRenderer);
        mClusterManager.setOnClusterClickListener(stopPointRenderer);
        mClusterManager.setOnClusterItemClickListener(stopPointRenderer);
        getMap().setInfoWindowAdapter(stopPointRenderer);
        getMap().setOnInfoWindowClickListener(stopPointRenderer);
        getMap().setOnCameraChangeListener(mClusterManager);
        getMap().setOnMarkerClickListener(mClusterManager);
        getMap().setMyLocationEnabled(gpsOn);
    }
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
        // this is a stupid hack since actionBarSize was returning zero
        getMap().setPadding(0, 60, 0, 0);
    } else {
        getMap().setPadding(0, config.getPixelInsetTop(true), config.getPixelInsetRight(),
                config.getPixelInsetBottom());
    }

}
 
开发者ID:runningcode,项目名称:CUMtd,代码行数:37,代码来源:BusMapFragment.java


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