List of usage examples for android.app ActionBar DISPLAY_USE_LOGO
int DISPLAY_USE_LOGO
To view the source code for android.app ActionBar DISPLAY_USE_LOGO.
Click Source Link
From source file:htw.bui.openreskit.meter.SeriesActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mOverlayFramelayout = new FrameLayout(this); setContentView(mOverlayFramelayout); View view = getLayoutInflater().inflate(R.layout.series_fragment, mOverlayFramelayout, false); mOverlayFramelayout.addView(view);// ww w . j a v a 2 s .co m mContext = this; mHelpView = getLayoutInflater().inflate(R.layout.help_overlay, mOverlayFramelayout, false); if (Utils.isTablet(this)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } ActionBar bar = getActionBar(); bar.setDisplayOptions( ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE); bar.setDisplayShowHomeEnabled(true); EnterValueFragment enterValueFrag = (EnterValueFragment) mFragMan .findFragmentById(R.id.enter_value_fragment); if (enterValueFrag != null) { enterValueFrag.getView().setVisibility(View.INVISIBLE); } }
From source file:htw.bui.openreskit.discard.InspectionActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mOverlayFramelayout = new FrameLayout(this); setContentView(mOverlayFramelayout); View view = getLayoutInflater().inflate(R.layout.inspection_fragment, mOverlayFramelayout, false); mOverlayFramelayout.addView(view);/*from w w w. j ava 2s .co m*/ mContext = this; mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext); mHelpView = getLayoutInflater().inflate(R.layout.help_overlay, mOverlayFramelayout, false); mInspFrag = (InspectionFragment) mFragMan.findFragmentById(R.id.inspection_fragment); mAddInspectionButton = (Button) mOverlayFramelayout.findViewById(R.id.addInspectionButton); mAddInspectionButton.setOnClickListener(mButtonListener); if (Utils.isTablet(this)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); if (findViewById(R.id.inspectionLayoutContainer) != null) { // if we are being restored from a previous state, then we dont need to do anything and should // return or else we could end up with overlapping fragments. if (savedInstanceState != null) return; // Create an instance of inspectionInfoFragment mInspectionInfoFragment = new InspectionInfoFragment(); // Create an instance of RunningInspectionFragment mRunningInspectionFragment = new RunningInspectionFragment(); // add fragment to the fragment container layout FragmentTransaction ft = mFragMan.beginTransaction(); ft.add(R.id.inspectionFrameLayout, mInspectionInfoFragment); ft.hide(mInspectionInfoFragment).commit(); FragmentTransaction ft1 = mFragMan.beginTransaction(); ft1.add(R.id.inspectionFrameLayout, mRunningInspectionFragment); ft1.hide(mRunningInspectionFragment).commit(); } } else { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT); } ActionBar bar = getActionBar(); bar.setDisplayOptions( ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_SHOW_TITLE); bar.setDisplayShowHomeEnabled(true); }
From source file:com.docd.purefm.ui.activities.SearchActivity.java
private void initActionBar() { //noinspection InflateParams final View actionBarCustom = this.getLayoutInflater().inflate(R.layout.activity_search_actionbar, null); if (actionBarCustom == null) { throw new RuntimeException("Inflated View is null"); }// w w w . j a v a 2 s . co m final TextView path = (TextView) actionBarCustom.findViewById(android.R.id.text1); path.setText(mStartDirectory.getAbsolutePath()); final ActionBar bar = this.getActionBar(); if (bar == null) { throw new RuntimeException("ActionBar should not be null"); } bar.setDisplayOptions(ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO); bar.setCustomView(actionBarCustom); mActionModeController = new ActionModeController(this); }
From source file:com.docd.purefm.ui.activities.BrowserPagerActivity.java
private void initActionBar() { mActionBar = this.getActionBar(); if (mActionBar == null) { throw new RuntimeException("BrowserPagerActivity should have an ActionBar"); }/*from w w w . j av a 2 s .c o m*/ mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_HOME_AS_UP); //noinspection InflateParams final View custom = LayoutInflater.from(this).inflate(R.layout.activity_browser_actionbar, null); if (custom == null) { throw new RuntimeException("Inflated View is null"); } mActionBar.setCustomView(custom); mBreadCrumbView = (BreadCrumbTextView) custom.findViewById(R.id.bread_crumb_view); }
From source file:android.support.v7.widget.ToolbarWidgetWrapper.java
private int detectDisplayOptions() { int opts = ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO; if (mToolbar.getNavigationIcon() != null) { opts |= ActionBar.DISPLAY_HOME_AS_UP; mDefaultNavigationIcon = mToolbar.getNavigationIcon(); }// w ww.j a va 2 s .co m return opts; }
From source file:com.dnielfe.manager.Browser.java
private void initActionBar() { mActionBar = this.getActionBar(); mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_USE_LOGO | ActionBar.DISPLAY_HOME_AS_UP); // set custom ActionBar layout final View mActionView = getLayoutInflater().inflate(R.layout.activity_browser_actionbar, null); mActionBar.setCustomView(mActionView); mActionBar.show();//from w w w . java2 s. c om }
From source file:android.support.v7.internal.widget.ToolbarWidgetWrapper.java
private int detectDisplayOptions() { int opts = ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_USE_LOGO; if (mToolbar.getNavigationIcon() != null) { opts |= ActionBar.DISPLAY_HOME_AS_UP; }//w ww . j a v a 2 s . c om return opts; }
From source file:android.support.v7.internal.widget.ToolbarWidgetWrapper.java
private void updateToolbarLogo() { Drawable logo = null;/*from w w w . j av a 2 s . c om*/ if ((mDisplayOpts & ActionBar.DISPLAY_SHOW_HOME) != 0) { if ((mDisplayOpts & ActionBar.DISPLAY_USE_LOGO) != 0) { logo = mLogo != null ? mLogo : mIcon; } else { logo = mIcon; } } mToolbar.setLogo(logo); }
From source file:com.bookkos.bircle.CaptureActivity.java
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); _context = getApplicationContext();/*w ww .j a v a 2 s . co m*/ _activity = this; currentTime = new Time("Asia/Tokyo"); // exceptionHandler = new ExceptionHandler(_context); // Thread.setDefaultUncaughtExceptionHandler(exceptionHandler); // sharedPreference???, user_id?group_id?registration_id?? getUserData(); Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); // ?? WindowManager window_manager = getWindowManager(); Display display = window_manager.getDefaultDisplay(); Point point = new Point(); display.getSize(point); displayWidth = point.x; displayHeight = point.y; displayInch = getInch(); // ??4??????? textSize = 17 * (displayInch / 4); actionBar = getActionBar(); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE, ActionBar.DISPLAY_USE_LOGO); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayUseLogoEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayHomeAsUpEnabled(false); String title_text = ""; subGroupText = ""; groupText = groupName; if (displayInch < 4.7) { title_text = "<small><small><small>??: </small></small></small>"; resizeTitleSizeTooSmall(); } else if (displayInch >= 4.7 && displayInch < 5.5) { title_text = "<small><small>??: </small></small>"; resizeTitleSizeSmall(); } else if (displayInch >= 5.5 && displayInch < 6.5) { title_text = "<small>??: </small>"; resizeTitleSizeMiddle(); } else if (displayInch >= 6.5 && displayInch < 8) { title_text = "<small>??: </small>"; resizeTitleSizeLarge(); } else { title_text = "??: "; } String modify_group_text = title_text + "<font color=#FF0000>" + groupName + "</font>"; actionBar.setTitle(Html.fromHtml(modify_group_text)); Resources resources = _context.getResources(); int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); titleBarHeight = resources.getDimensionPixelSize(resourceId); setContentView(R.layout.capture); returnBorrowHelpView = (ImageView) findViewById(R.id.return_borrow_help_view); returnBorrowHelpView.setImageResource(R.drawable.return_borrow_help); returnBorrowHelpView.setTranslationY(displayHeight / 5 + titleBarHeight); returnBorrowHelpView.setLayoutParams(new FrameLayout.LayoutParams(displayWidth, displayHeight / 5 + titleBarHeight, Gravity.BOTTOM | Gravity.CENTER)); registHelpView = (ImageView) findViewById(R.id.regist_help_view); registHelpView.setImageResource(R.drawable.regist_help); registHelpView.setTranslationY(displayHeight / 5 + titleBarHeight); registHelpView.setLayoutParams(new FrameLayout.LayoutParams(displayWidth, displayHeight / 5 + titleBarHeight, Gravity.BOTTOM | Gravity.CENTER)); registHelpView.setVisibility(View.GONE); leftDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); leftDrawer = (ListView) findViewById(R.id.left_drawer); textView = (TextView) findViewById(R.id.textView); modeText = (TextView) findViewById(R.id.mode_text); modeText.setTextColor(Color.rgb(56, 234, 123)); modeText.setTextSize(textSize); modeText.setTypeface(Typeface.SERIF.MONOSPACE, Typeface.BOLD); strokeColor = Color.rgb(56, 234, 123); borrowReturnButton = (Button) findViewById(R.id.borrowReturnButton); registButton = (Button) findViewById(R.id.registButton); returnHistoryButton = (Button) findViewById(R.id.return_history_button); helpViewButton = (Button) findViewById(R.id.help_view_button); registSelectShelfRelativeLayout = (RelativeLayout) findViewById(R.id.regist_select_shelf_relative_layout); textViewLinearLayout = (LinearLayout) findViewById(R.id.text_view_linear_layout); buttonLinearLayout = (LinearLayout) findViewById(R.id.button_linear_layout); listViewLinearLayout = (LinearLayout) findViewById(R.id.list_view_linear_layout); decisionButton = (Button) findViewById(R.id.decision_button); cancelButton = (Button) findViewById(R.id.cancel_button); shelfListView = (ListView) findViewById(R.id.shelf_list_view); tempTextView = (TextView) findViewById(R.id.temp_text_view); // bookListViewAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1); bookListViewAdapter = new BookListViewAdapter(_context, R.layout.book_list_row, this); bookRegistRelativeLayout = (RelativeLayout) findViewById(R.id.book_regist_relative_layout); bookRegistLinearLayout = (LinearLayout) findViewById(R.id.book_regist_linear_layout); bookRegistListViewLinearLayout = (LinearLayout) findViewById(R.id.book_regist_list_view_linear_layout); bookRegistListView = (ListView) findViewById(R.id.book_regist_list_view); bookRegistTextView = (TextView) findViewById(R.id.book_regist_text_view); bookRegistCancelButton = (Button) findViewById(R.id.book_regist_cancel_button); registFlag = 0; int borrowReturnButton_width = displayWidth / 5 * 2; int borrowReturnButton_height = displayHeight / 10; int borrowReturnButton_x = ((displayWidth / 2) - borrowReturnButton_width) / 2; int borrowReturnButton_y = displayHeight / 2 + titleBarHeight; borrowReturnButton.setTranslationX(borrowReturnButton_x); borrowReturnButton.setTranslationY(borrowReturnButton_y); borrowReturnButton .setLayoutParams(new FrameLayout.LayoutParams(borrowReturnButton_width, borrowReturnButton_height)); borrowReturnButton.setBackgroundColor(Color.rgb(56, 234, 123)); borrowReturnButton.setText("??\n"); borrowReturnButton.setTextSize(textSize * 7 / 10); borrowReturnButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { arrayList.clear(); registFlag = 0; borrowReturnButton.setText("??\n"); borrowReturnButton.setEnabled(false); borrowReturnButton.setTextColor(Color.WHITE); borrowReturnButton.setBackgroundColor(Color.rgb(56, 234, 123)); registButton.setText("?\n??"); registButton.setEnabled(true); registButton.setTextColor(Color.GRAY); registButton.setBackgroundColor(Color.argb(170, 21, 38, 45)); modeText.setText("??"); modeText.setTextColor(Color.rgb(56, 234, 123)); returnBorrowHelpView.setVisibility(View.VISIBLE); registHelpView.setVisibility(View.GONE); strokeColor = Color.rgb(56, 234, 123); } }); int registButton_width = displayWidth / 5 * 2; int registButton_height = displayHeight / 10; int registButton_x = (displayWidth / 2) + ((displayWidth / 2) - registButton_width) / 2; int registButton_y = displayHeight / 2 + titleBarHeight; registButton.setTranslationX(registButton_x); registButton.setTranslationY(registButton_y); registButton.setLayoutParams(new FrameLayout.LayoutParams(registButton_width, registButton_height)); registButton.setBackgroundColor(Color.argb(170, 21, 38, 45)); registButton.setTextColor(Color.GRAY); registButton.setTextSize(textSize * 7 / 10); registButton.setText("?\n??"); registButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { arrayList.clear(); registFlag = 1; borrowReturnButton.setText("??\n??"); borrowReturnButton.setEnabled(true); borrowReturnButton.setTextColor(Color.GRAY); borrowReturnButton.setBackgroundColor(Color.argb(170, 9, 54, 16)); registButton.setText("?\n"); registButton.setEnabled(false); registButton.setTextColor(Color.WHITE); registButton.setBackgroundColor(Color.rgb(62, 162, 229)); modeText.setText("?"); modeText.setTextColor(Color.rgb(62, 162, 229)); returnBorrowHelpView.setVisibility(View.GONE); registHelpView.setVisibility(View.VISIBLE); strokeColor = Color.rgb(62, 162, 229); } }); returnHistoryButton.setText("????"); returnHistoryButton.setTextSize(textSize * 7 / 10); returnHistoryButton.setOnClickListener(new OnClickListener() { public void onClick(View v) { leftDrawerLayout.openDrawer(Gravity.RIGHT); // animateTranslationY(bookRegistRelativeLayout, displayHeight, displayHeight - displayHeight / 4 - titleBarHeight); } }); getReturnHistory(); getCurrentTime(); setHelpView(); setScanUnregisterBookView(); setBookRegistView(); arrayList = new ArrayList<String>(); tempRegistIsbn = ""; initBookRegistUrl = book_register_url + "?user_id=" + userId + "&group_id=" + groupId; initLendRegistUrl = lend_register_url + "?user_id=" + userId + "&group_id=" + groupId; initTemporaryLendRegistUrl = temporary_lend_register_url + "?user_id=" + userId + "&group_id=" + groupId; initCatalogRegistUrl = catalog_register_url + "?group_id=" + groupId + "&book_code="; initManuallyCatalogRegistUrl = manually_catalog_register_url + "?group_id=" + groupId + "&book_code="; getStatusUrl = get_status_url + "?group_id=" + groupId + "&user_id=" + userId; hasSurface = false; inactivityTimer = new InactivityTimer(this); bircleBeepManager = new BircleBeepManager(this); ambientLightManager = new AmbientLightManager(this); PreferenceManager.setDefaultValues(this, R.xml.preferences, false); toastText = ""; }
From source file:org.opendatakit.survey.android.activities.MainMenuActivity.java
/** * This creates the WebKit. We need all our values initialized by this point. *///from w w w .j av a 2 s . com private void assignContentView() { setContentView(R.layout.main_screen); ActionBar actionBar = getActionBar(); actionBar.setDisplayOptions(ActionBar.DISPLAY_USE_LOGO); actionBar.show(); }