List of usage examples for android.app Activity getActionBar
@Nullable
public ActionBar getActionBar()
From source file:com.arantius.tivocommander.Utils.java
@TargetApi(11) public final static void activateHomeButton(Activity activity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { ActionBar ab = activity.getActionBar(); ab.setDisplayHomeAsUpEnabled(true); }/*from w ww .j a v a 2 s . c om*/ }
From source file:org.bottiger.podcast.utils.UIUtils.java
public static boolean hasActionBar(Activity activity) { return activity.getActionBar() != null; }
From source file:com.xiaomi.account.utils.SysHelper.java
public static void setMiuiActionBarTitle(Activity activity, String title) { if (Build.IS_TABLET) { ActionBar actionBar = (ActionBar) activity.getActionBar(); if (title.length() != 0 && actionBar != null) { actionBar.setTitle(title);// w w w . j a v a2 s . c o m } } }
From source file:com.xiaomi.account.utils.SysHelper.java
public static void showMiuiActionBar(Activity activity, boolean show) { if (Build.IS_TABLET) { ActionBar actionBar = (ActionBar) activity.getActionBar(); if (actionBar == null) { return; }//from ww w .ja v a 2s . c o m if (show) { actionBar.show(); } else { actionBar.hide(); } } }
From source file:info.papdt.blacklight.support.Utility.java
public static View findActionSpinner(Activity activity) { ActionBar action = activity.getActionBar(); // Get ActionBarImpl class for ActionView object // Then get spinner from ActionView try {// w ww. ja va 2s. com Class<?> clazz = Class.forName("com.android.internal.app.ActionBarImpl"); Field f = clazz.getDeclaredField("mActionView"); f.setAccessible(true); Object actionView = f.get(action); clazz = Class.forName("com.android.internal.widget.ActionBarView"); f = clazz.getDeclaredField("mSpinner"); f.setAccessible(true); return (View) f.get(actionView); } catch (Exception e) { if (DEBUG) { Log.e(TAG, "Failed to find spinner"); Log.e(TAG, Log.getStackTraceString(e)); } return null; } }
From source file:Main.java
public static int getDisplayHeight(Activity activity) { int height = 0; if (activity != null && activity.getWindowManager() != null && activity.getWindowManager().getDefaultDisplay() != null) { Point point = new Point(); activity.getWindowManager().getDefaultDisplay().getSize(point); height = point.y;/* www . j av a2 s . c o m*/ } Log.e(TAG, "isSupportSmartBar:" + isSupportSmartBar); if (isSupportSmartBar) { int smartBarHeight = getSmartBarHeight(activity); Log.e(TAG, "smartBarHeight:" + smartBarHeight); height -= smartBarHeight; } if (activity != null && activity.getActionBar() != null) { int actionbar = activity.getActionBar().getHeight(); if (actionbar == 0) { TypedArray actionbarSizeTypedArray = activity .obtainStyledAttributes(new int[] { android.R.attr.actionBarSize }); actionbar = (int) actionbarSizeTypedArray.getDimension(0, 0); } Log.d(TAG, "actionbar:" + actionbar); height -= actionbar; } int status = getStatusBarHeight(activity); Log.d(TAG, "status:" + status); height -= status; Log.d(TAG, "height:" + height); return height; }
From source file:me.barrasso.android.volume.activities.ConfigurationActivity.java
public static void setupActionBar(Activity activity) { // Tint the status bar, if available. SystemBarTintManager tintManager = new SystemBarTintManager(activity); tintManager.setStatusBarTintEnabled(true); tintManager.setTintColor(activity.getResources().getColor(R.color.action_bar_dark)); ActionBar actionBar = activity.getActionBar(); if (null != actionBar) { actionBar.setIcon(DateUtils.AppIcon()); actionBar.setDisplayHomeAsUpEnabled(!activity.isTaskRoot()); actionBar.setDisplayShowTitleEnabled(true); }/*from w w w.ja v a2 s. co m*/ }
From source file:de.vanita5.twittnuker.util.ThemeUtils.java
public static void applyColorFilterToMenuIcon(Activity activity, Menu menu) { final ActionBar actionBar = activity.getActionBar(); final Context context = actionBar != null ? actionBar.getThemedContext() : activity; final int color = getThemeForegroundColor(context); final int popupTheme = getActionBarPopupThemeRes(context); final int popupColor = getThemeForegroundColor(context, popupTheme); final int highlightColor = getUserAccentColor(activity); applyColorFilterToMenuIcon(menu, color, popupColor, highlightColor, Mode.SRC_ATOP); }
From source file:com.swisscom.safeconnect.activity.PipeActivity.java
protected void initActionBar(Activity activity, int stringId, View.OnClickListener listener) { ActionBar ab = activity.getActionBar(); //Tutorial with NoTitle Theme returns null here if (ab == null) { return;/* ww w .ja v a2 s . c o m*/ } ab.setDisplayShowCustomEnabled(true); ab.setDisplayShowTitleEnabled(false); ab.setDisplayShowHomeEnabled(false); actionBarView = activity.getLayoutInflater().inflate(R.layout.actionbar, null); tvTitle = (TextView) actionBarView.findViewById(R.id.tv_title); imgBackBtn = (ImageView) actionBarView.findViewById(R.id.img_back_btn); if (tvTitle != null && stringId != 0) { tvTitle.setText(stringId); } setOnBackPressedListener(listener); ab.setCustomView(actionBarView); }
From source file:net.xisberto.ledassist.ui.AboutFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); ActionBar actionBar = activity.getActionBar(); if (actionBar != null) { activity.getActionBar().setDisplayHomeAsUpEnabled(true); }/*from ww w . ja v a 2 s . c om*/ prepareLicensesInformation(); }