當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。