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


Java SystemBarTintManager.getConfig方法代码示例

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


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

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

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

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

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

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

示例6: onPostCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
protected void onPostCreate(Bundle savedInstanceState) {
	// TODO Auto-generated method stub
	super.onPostCreate(savedInstanceState);
	if ( mImmersionEnable &&
			android.os.Build.VERSION.SDK_INT > 18) {
		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);
		SystemBarTintManager tintManager = new SystemBarTintManager(this);
		tintManager.setNavigationBarTintEnabled(true);
		tintManager.setStatusBarTintEnabled(true);
		tintManager.setTintColor(Color.parseColor("#ff009688"));
		SystemBarConfig systemBarConfig = tintManager.getConfig();
		findViewById(R.id.about_listview).setPadding(
				0, systemBarConfig.getPixelInsetTop(getActionBar().isShowing()), 
				0, systemBarConfig.getPixelInsetBottom());
	} else {
		mImmersionEnable = false;
	}
}
 
开发者ID:SharerMax,项目名称:MWord,代码行数:26,代码来源:AboutActivity.java

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

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

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

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

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

示例12: onViewCreated

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    setEmptyText(getString(R.string.no_favorites));
    view.setBackgroundResource(R.color.nav_bar_color);
    SystemBarTintManager systemBarTintManager = new SystemBarTintManager(getActivity());
    SystemBarTintManager.SystemBarConfig config = systemBarTintManager.getConfig();
    getListView().setPadding(0, config.getPixelInsetTop(true), 0,
            config.getPixelInsetBottom());
    getListView().setClipToPadding(false);
    getListView().setOnItemClickListener(this);
    getLoaderManager().initLoader(FAVS_LOADER_ID, null, this);
}
 
开发者ID:runningcode,项目名称:CUMtd,代码行数:14,代码来源:NavigationDrawerFragment.java

示例13: onPostCreate

import com.readystatesoftware.systembartint.SystemBarTintManager; //导入方法依赖的package包/类
@Override
  protected void onPostCreate(Bundle savedInstanceState) {
      super.onPostCreate(savedInstanceState);
      if (android.os.Build.VERSION.SDK_INT > 18 && mImmersionEnable) {
      	SystemBarTintManager tintManager = new SystemBarTintManager(this);
  		tintManager.setNavigationBarTintEnabled(true);
  		tintManager.setStatusBarTintEnabled(true);
  		tintManager.setTintColor(Color.parseColor("#ff009688"));
  		SystemBarConfig systemBarConfig = tintManager.getConfig();
  		findViewById(R.id.basicsetting).setPadding(
  				0, systemBarConfig.getPixelInsetTop(getActionBar().isShowing()), 
  				0, systemBarConfig.getPixelInsetBottom());
}
  }
 
开发者ID:SharerMax,项目名称:MWord,代码行数:15,代码来源:BasicSettingActivity.java

示例14: onCreate

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

  Enklawa app           = Enklawa.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,项目名称:KontestacjaPod,代码行数:29,代码来源:ProgramEpisodesActivity.java

示例15: 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();
}
 
开发者ID:macbury,项目名称:KontestacjaPod,代码行数:32,代码来源:MainActivity.java


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