@Override public void onNewIntent(Intent intent) { super.onNewIntent(intent); setIntent(intent); handleIntent(intent); removeKeyboard(); actionBar.setDisplayShowHomeEnabled(false); Log.v("talon_searching", "on new intent, query: " + searchQuery); }
private void intiActionTab() { actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); tab_top = actionBar.newTab().setText("头条"); tab_cyclopedia = actionBar.newTab().setText("百科"); tab_message = actionBar.newTab().setText("资讯"); tab_manage = actionBar.newTab().setText("经营"); tab_data = actionBar.newTab().setText("数据"); tab_top.setTabListener(this); tab_cyclopedia.setTabListener(this); tab_message.setTabListener(this); tab_manage.setTabListener(this); tab_data.setTabListener(this); actionBar.addTab(tab_top); actionBar.addTab(tab_cyclopedia); actionBar.addTab(tab_message); actionBar.addTab(tab_manage); actionBar.addTab(tab_data); }
private void initActionBar() { bar.setTitle("Login"); bar.setDisplayShowHomeEnabled(false); bar.setDisplayShowTitleEnabled(false); LayoutInflater mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View mCustomView = mInflater.inflate(R.layout.custom_action_bar, null); ActionBar.LayoutParams params = new ActionBar.LayoutParams( ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.MATCH_PARENT); mCustomView.setLayoutParams(params); bar.setCustomView(mCustomView); actionBarText = (TextView) mCustomView.findViewById(R.id.nameOfScreen); actionBarText.setText("Login"); back = (Button) mCustomView.findViewById(R.id.back); // back.setVisibility(View.INVISIBLE); back.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { /*Log.e("DEMO", "clicked"); //removeCurrentFragment(); actionBarText.setText("Login"); //isSignUpEnabled = false; back.setVisibility(View.INVISIBLE); */ } }); bar.setDisplayShowCustomEnabled(true); }
/** * Goes back to usual Phone UI with tags. Previously selected Tag and associated Fragment should * be automatically focused again. */ private void exitSearchUi() { final ActionBar actionBar = getActionBar(); // Hide the search fragment, if exists. if (mSearchFragment != null) { mSearchFragment.setUserVisibleHint(false); final FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.hide(mSearchFragment); transaction.commitAllowingStateLoss(); } // We want to hide SearchView and show Tabs. Also focus on previously selected one. actionBar.setDisplayShowCustomEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); sendFragmentVisibilityChange(mViewPager.getCurrentItem(), true); // Before exiting the search screen, reset swipe state. mDuringSwipe = false; mUserTabClick = false; mViewPager.setVisibility(View.VISIBLE); hideInputMethod(getCurrentFocus()); // Request to update option menu. invalidateOptionsMenu(); // See comments in onActionViewExpanded() mSearchView.onActionViewCollapsed(); mInSearchUi = false; }
private void customizeActionbar() { mActionBar = getActionBar(); if (mActionBar != null) { mActionBarView = (FrameLayout) getLayoutInflater().inflate(R.layout.base_actionbar_view, null); mActionBarView .findViewById(R.id.ic_back) .setOnClickListener( new View.OnClickListener() { @Override public void onClick(View arg0) { onBackPressed(); } }); TextView title = (TextView) mActionBarView.findViewById(R.id.ab_title); title.setText("基本设置"); mActionBar.setCustomView( mActionBarView, new ActionBar.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); mActionBar.setDisplayShowCustomEnabled(true); mActionBar.setDisplayShowHomeEnabled(false); mActionBar.setDisplayShowTitleEnabled(false); } }
@SuppressLint("NewApi") @Override public void onCreate(Bundle savedInstanceState) { weblayer.toolbox.Common.DefinirTheme(this, getResources().getString(R.string.titulo_config)); super.onCreate(savedInstanceState); if (android.os.Build.VERSION.SDK_INT >= 11) { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowHomeEnabled(false); actionBar.setTitle(getResources().getString(R.string.titulo_config)); } setContentView(R.layout.activity_config); txtImei = (TextView) findViewById(R.id.config_txt_Imei); txtVendedor = (TextView) findViewById(R.id.config_txt_Vendedor); txtConta = (TextView) findViewById(R.id.config_txt_Conta); txtUltimaSinc = (TextView) findViewById(R.id.config_txt_UltimaSinc); ParametroDAO.initialize(this); LoadConfig(); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_layout_one, container, false); ActionBar actionBar = getActivity().getActionBar(); // Screen handling while hiding ActionBar icon. actionBar.setDisplayShowHomeEnabled(true); // Screen handling while hiding Actionbar title. actionBar.setDisplayShowTitleEnabled(true); // Creating ActionBar tabs. actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); ivIcon = (ImageView) view.findViewById(R.id.frag1_icon); tvItemName = (TextView) view.findViewById(R.id.frag1_text); tvItemName.setText(getArguments().getString(ITEM_NAME)); ivIcon.setImageDrawable( view.getResources().getDrawable(getArguments().getInt(IMAGE_RESOURCE_ID))); return view; }
public void onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu( menu); // REMOVE THE THREE DOT ICON FROM THE ACTIONBAR, SINCE IT IS NOT NEEDED FOR NOW MenuItem item = menu.findItem(R.id.action_settings); item.setVisible(false); // INFLATE CUSTOM ACTIONBAR ActionBar ab = getActivity().getActionBar(); ab.setDisplayShowTitleEnabled(false); ab.setDisplayShowCustomEnabled(true); ab.setDisplayShowHomeEnabled(false); View customActionView = getActivity().getLayoutInflater().inflate(R.layout.actionbar_custom_layout, null); ab.setCustomView(customActionView); // ADD A LISTENER TO THE VIEWS IN THE CUSTOM ACTION BAR LAYOUT acbar_cancel_button = (LinearLayout) customActionView.findViewById(R.id.custom_ab_cancel); acbar_save_button = (LinearLayout) customActionView.findViewById(R.id.custom_ab_done); acbar_cancel_button.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { getActivity().onBackPressed(); } }); acbar_save_button.setOnClickListener(new SaveTaskListener()); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_flash); bindViews(); mActionBar.setDisplayShowHomeEnabled(false); mActionBar.setDisplayHomeAsUpEnabled(true); mColorLightGray = getResources().getColor(R.color.actionbar_background_light); mColorCorrect = getResources().getColor(R.color.correct); mColorIncorrect = getResources().getColor(R.color.incorrect); mActionBarBottomBorder = getResources().getDrawable(R.drawable.actionbar_border_bottom); setActionBarBackground(false, 0); mPageAdapter = new FlashPageAdapter( this, getFlashCards(), new FlashGuessView.OnFlashGuessActionListener() { int currentPage; @Override public void onQuestionAttempted(int flashCardId, boolean isCorrect) { currentPage = mPager.getCurrentItem(); setActionBarBackground(isCorrect, ((float) (currentPage + 1) / mFlashPackSize)); } @Override public void onQuestionCompleted() { Log.i("Ken", "" + currentPage); mPager.setCurrentItem(currentPage + 1); } }); mPager.setAdapter(mPageAdapter); }
private void initActionBar() { actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayShowCustomEnabled(false); actionBar.setTitle(getString(R.string.save)); }
/** configure the action bar */ private void configureActionBar() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayShowCustomEnabled(true); View actionBarNumberView = getLayoutInflater().inflate(R.layout.title_bar_number, null); actionBar.setCustomView(actionBarNumberView, new LayoutParams(Gravity.END)); mNumberTextView = (TextView) actionBarNumberView.findViewById(R.id.number); }
public void initActionBar() { ActionBar actionBar = getActionBar(); actionBar.setDisplayShowCustomEnabled(true); actionBar.setCustomView(R.layout.actionbar_main); actionBar.setDisplayUseLogoEnabled(false); actionBar.setDisplayShowHomeEnabled(false); View view = actionBar.getCustomView(); RelativeLayout exitBt = (RelativeLayout) view.findViewById(R.id.add_lay); }
@Override @TargetApi(14) protected void setActionBarSettings(Activity activity) { ActionBar actionBar = activity.getActionBar(); actionBar.setDisplayShowHomeEnabled(true); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setIcon(getDrawable()); }
@Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); ActionBar actionBar = getActivity().getActionBar(); LayoutInflater mInflater = LayoutInflater.from(getActivity()); View mCustomView = mInflater.inflate(R.layout.custom_action_bar, null); TextView textTile = (TextView) mCustomView.findViewById(R.id.textTitle); imageIcon = (ImageView) mCustomView.findViewById(R.id.imageIcon); imageIcon.setVisibility(View.GONE); btnBack = (ImageView) mCustomView.findViewById(R.id.btnBack); btnGallery = (ImageView) mCustomView.findViewById(R.id.picture_icon); textTile.setText("Bali"); actionBar.setCustomView(mCustomView); btnGallery.setVisibility(View.VISIBLE); btnBack.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub // onBackPressed(); listener.onItemAttractionListMapPage(R.id.btnBack); } }); btnGallery.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub if (maps) { btnGallery.setImageResource(R.drawable.pin_icon); maps = false; listView.setVisibility(View.VISIBLE); layoutMap.setVisibility(View.GONE); arcMenu.setVisibility(View.VISIBLE); } else { btnGallery.setImageResource(R.drawable.picture_icon); maps = true; listView.setVisibility(View.GONE); layoutMap.setVisibility(View.VISIBLE); arcMenu.setVisibility(View.GONE); } } }); // actionBar.setBackgroundDrawable(new ColorDrawable(0x0065b3)); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setDisplayUseLogoEnabled(false); actionBar.setDisplayShowHomeEnabled(false); }
private void initActionBar() { actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowHomeEnabled(true); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); View view = View.inflate(this, R.layout.actionbar_title, null); mActionBarTitle = (ShimmerTextView) view.findViewById(R.id.tv_shimmer); new Shimmer().start(mActionBarTitle); actionBar.setCustomView(view); }
public static void setActionBarLayout(ActionBar actionBar, Context context, int layoutId) { if (null != actionBar) { actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setDisplayShowTitleEnabled(false); LayoutInflater inflator = LayoutInflater.from(context); View v = inflator.inflate(layoutId, null); ActionBar.LayoutParams layout = new ActionBar.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); actionBar.setCustomView(v, layout); } }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); // initialize action bar actionBar = getActionBar(); actionBar.setTitle("Login"); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayUseLogoEnabled(false); // initialize views and variables emailEditText = (RobotoLightEditText) findViewById(R.id.email_edit_text); passwordEditText = (RobotoLightEditText) findViewById(R.id.password_edit_text); loginButton = (RobotoRegularButton) findViewById(R.id.login_button); // on login button click loginButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { email = emailEditText.getText().toString(); password = passwordEditText.getText().toString(); // validation of email if (!TextUtils.isEmpty(email) && CommonUtil.validateEmail(email)) { appController.getPreferences().setSurveyData(""); if (NetworkUtil.iSConnected(getApplicationContext()) == NetworkUtil.TYPE_CONNECTED) { progressDialog = new ProgressDialog(LoginActivity.this); progressDialog.setCancelable(false); progressDialog.setIndeterminate(true); progressDialog.setMessage("Logging in"); progressDialog.show(); appController.getPreferences().setUsername(email); appController.getPreferences().setPassword(password); new Login().execute(); } else { appController.showToast("Please check your internet connection"); } } else { appController.showToast("Enter Valid Email "); } } }); }
private static View initView(ActionBar actionBar, int viewId, OnClickListener onDone) { // Inflate a custom view and set a Done handler actionBar.setCustomView(viewId); View view = actionBar.getCustomView(); view.findViewById(R.id.actionbar_done).setOnClickListener(onDone); // Show the custom action bar view and hide the normal Home icon and title. actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowCustomEnabled(true); return view; }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setHomeButtonEnabled(true); actionBar.setLogo(getResources().getDrawable(R.drawable.ic_back)); username = (EditText) findViewById(R.id.login_username_edit); passwd = (EditText) findViewById(R.id.login_passwd_edit); }
private void initViews() { views = new ArrayList<View>(); sharedPreferences = getSharedPreferences(LauncherApplication.SHARED_PREFRENCE, Context.MODE_PRIVATE); theme = getIntent().getStringExtra(LauncherApplication.NAME_KEY); ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setTitle(theme); actionBar.setDisplayUseLogoEnabled(false); actionBar.setDisplayShowHomeEnabled(false); try { Bitmap previewBitmap_01 = BitmapFactory.decodeStream( getAssets() .open( getString(R.string.theme) + "/" + theme + "/" + getString(R.string.preview) + "/" + "preview_01.jpg")); Bitmap previewBitmap_02 = BitmapFactory.decodeStream( getAssets() .open( getString(R.string.theme) + "/" + theme + "/" + getString(R.string.preview) + "/" + "preview_02.jpg")); ImageView imageView_01 = new ImageView(this); imageView_01.setImageBitmap(previewBitmap_01); ImageView imageView_02 = new ImageView(this); imageView_02.setImageBitmap(previewBitmap_02); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); params.gravity = Gravity.CENTER; views.add(imageView_01); views.add(imageView_02); pageAdapter = new MyViewPageAdapter(views); viewPager.setAdapter(pageAdapter); viewPager.setCurrentItem(0); viewPager.setOnPageChangeListener(new MyOnPageChangeListener()); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
@SuppressWarnings("unchecked") protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_link); // Set up layout bridgesList = (ListView) findViewById(R.id.link_bridges); bridgesAdapter = new BridgeAdapter(this); bridgesList.setAdapter(bridgesAdapter); bridgesList.setEmptyView(findViewById(R.id.link_empty)); // Set up loading UI elements ActionBar ab = getActionBar(); ab.setCustomView(R.layout.loader); ab.setDisplayShowCustomEnabled(true); ab.setDisplayShowHomeEnabled(false); RelativeLayout loadingLayout = (RelativeLayout) ab.getCustomView(); loadingSpinner = (ProgressBar) loadingLayout.findViewById(R.id.loader_spinner); refreshButton = (ImageButton) loadingLayout.findViewById(R.id.loader_refresh); setEventHandlers(); // Restore state or start over if (savedInstanceState == null) { Bridge lastBridge = Util.getLastBridge(this); if (lastBridge != null) { // This will be set again after a successful connection, connection failure leaves the last // bridge null Util.setLastBridge(this, null); // Try connecting to last bridge connectToLastBridge(lastBridge); } else { // Start searching for bridges and add them to the results startSearching(true); } } else { bridges = (ArrayList<Bridge>) savedInstanceState.getSerializable("bridges"); for (Bridge b : bridges) { bridgesAdapter.add(b); } // If a search was running, continue without removing existing results if (savedInstanceState.getBoolean("searching")) { startSearching(false); } } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Initilization setContentView(R.layout.activity_charts); viewPager = (ViewPager) findViewById(R.id.pager); actionBar = getActionBar(); mAdapter = new TabsPagerAdapter(getSupportFragmentManager(), this); viewPager.setAdapter(mAdapter); viewPager.setOffscreenPageLimit(2); actionBar.setHomeButtonEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME); Bundle bundle; bundle = getIntent().getExtras(); tabs = bundle.getStringArrayList("tabs"); Intent intent = new Intent(this, TabsPagerAdapter.class); intent.putExtras(bundle); try { ViewConfiguration config = ViewConfiguration.get(this); Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); if (menuKeyField != null) { menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Ignore } viewPager.setOnPageChangeListener( new ViewPager.OnPageChangeListener() { @Override public void onPageSelected(int position) { // on changing the page // make respected tab selected // actionBar.setSelectedNavigationItem(position); } @Override public void onPageScrolled(int arg0, float arg1, int arg2) {} @Override public void onPageScrollStateChanged(int arg0) {} }); /*Intent recintent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM); intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "AndroidBite Voice Recognition..."); startActivityForResult(recintent, 100);*/ }
@Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_client_news); ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowHomeEnabled(false); initView(); setTitle(getIntent().getStringExtra("type")); NoticeBean news = (NoticeBean) getIntent().getSerializableExtra("news"); this.noticeTitle.setText(news.getTitle()); String contentUrl = news.getUrl(); new LoadHtml().execute(contentUrl); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub rootView = inflater.inflate(R.layout.fragment_strength_layout, container, false); ActionBar actionBar = getActivity().getActionBar(); // actionBar.setDisplayOptions( // ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE); if (actionBar.isShowing()) { actionBar.removeAllTabs(); // actionBar.setDisplayOptions( // ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_SHOW_TITLE); // actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); } actionBar.setDisplayShowCustomEnabled(false); // Screen handling while hiding ActionBar icon. actionBar.setDisplayShowHomeEnabled(true); // Screen handling while hiding Actionbar title. actionBar.setDisplayShowTitleEnabled(true); // actionBar.setHomeButtonEnabled(isVisible()); // Creating ActionBar tabs. actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); listStrengthReport = (ListView) rootView.findViewById(R.id.listStrengthReport); urlcreatereport = new UrlConnectStrengthReport(rootView.getContext()); db = new DatabaseOpenHelper(rootView.getContext()); // load data on the list view populateStrengthReportListView(rootView.getContext()); // ++++++++++++++++++++++++++++++++++++++++++++++ /* try{ new LoadStrengthReport().execute(); }catch(Exception e){ Toast.makeText(getActivity(), "Error occured :"+e.getMessage(), Toast.LENGTH_SHORT); Log.d("Error Occured", e.getMessage()); }*/ // +++++++++++++++++++++++++++++++++++++++++++++ return rootView; }
@Override public void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); actionBar = getActionBar(); setSlidingActionBarEnabled(true); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); // 初始化主界面 initView(); fragmentManager = getFragmentManager(); setTabSelection(1); // 初始化滑动菜单 initSlidingMenu(savedInstanceState); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); ActionBar bar = getActionBar(); bar.setDisplayShowHomeEnabled(false); bar.setTitle("About"); RadioGroup rg = (RadioGroup) findViewById(R.id.campusGroup); SharedPreferences sp = getSharedPreferences("setting", MODE_PRIVATE); if (sp.getInt("checked", 2131558509) != 2131558509) { rg.check(sp.getInt("checked", 0)); } else if (sp.getInt("checked", 2131558510) != 2131558510) { rg.check(sp.getInt("checked", 1)); } }
/** Hides every tab and shows search UI for phone lookup. */ private void enterSearchUi() { if (mSearchFragment == null) { // We add the search fragment dynamically in the first onLayoutChange() and // mSearchFragment is set sometime later when the fragment transaction is actually // executed, which means there's a window when users are able to hit the (physical) // search key but mSearchFragment is still null. // It's quite hard to handle this case right, so let's just ignore the search key // in this case. Users can just hit it again and it will work this time. return; } if (mSearchView == null) { prepareSearchView(); } final ActionBar actionBar = getActionBar(); final Tab tab = actionBar.getSelectedTab(); // User can search during the call, but we don't want to remember the status. if (tab != null && !DialpadFragment.phoneIsInUse()) { mLastManuallySelectedFragment = tab.getPosition(); } mSearchView.setQuery(null, true); actionBar.setDisplayShowCustomEnabled(true); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); sendFragmentVisibilityChange(mViewPager.getCurrentItem(), false); // Show the search fragment and hide everything else. mSearchFragment.setUserVisibleHint(true); final FragmentTransaction transaction = getFragmentManager().beginTransaction(); transaction.show(mSearchFragment); transaction.commitAllowingStateLoss(); mViewPager.setVisibility(View.GONE); // We need to call this and onActionViewCollapsed() manually, since we are using a custom // layout instead of asking the search menu item to take care of SearchView. mSearchView.onActionViewExpanded(); mInSearchUi = true; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_wash_and_iron_page_list); mSharedDataPrefrence = new SharedDataPrefrence(); msSessionManager = new SessionManager(WashAndIronListPage.this); initControls(); helper = new SqlHelper(getApplicationContext()); sharedPref = getSharedPreferences("laundry", 0); ActionBar mActionBar = getActionBar(); mActionBar.setDisplayShowHomeEnabled(false); mActionBar.setDisplayShowTitleEnabled(false); LayoutInflater mInflater = LayoutInflater.from(getApplicationContext()); View mCustomView = mInflater.inflate(R.layout.actionbar_drawermenu, null); ImageButton imgBack = (ImageButton) mCustomView.findViewById(R.id.btn_img_cart1); imgBack.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub confirmOrderDialog(); // helper.updateIronCount(); // clearPreference(); } }); TextView mTitleTextView = (TextView) mCustomView.findViewById(R.id.title_text); mTitleTextView.setText("Select Clothes"); getActionBar().setCustomView(mCustomView); getActionBar().setDisplayShowCustomEnabled(true); iornItemsList = MyApplication.iornItemsList; if (iornItemsList.size() < 1) { if (CommanMethods.isConnected(getBaseContext())) { // helper.deleteDataFromAllTables(); new RemoteDataTask().execute(); } } else { setWashAndFoldAdapter(); } }
private void initUI() { mFileSettingsHelper = FileSettingsHelper.getInstance(this); FileOperationHelper fileOperationHelper = FileOperationHelper.getInstance(this); mFileSDCardHelper = FileSDCardHelper.getInstance(this, mFileSettingsHelper, fileOperationHelper); mViewPager = (ViewPager) findViewById(R.id.sdcard_viewPager); mViewPager.setOffscreenPageLimit(3); IntentFilter filter = new IntentFilter(); filter.addAction(ACTION_LOCALE_CHANGED); // registerReceiver(mReceiver, filter); ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowHomeEnabled(false); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setDisplayOptions(0, ActionBar.DISPLAY_SHOW_TITLE | ActionBar.DISPLAY_SHOW_HOME); mFileSDCardPageAdapter = new FileSDCardPageAdapter(this, mViewPager); mFileSDCardPageAdapter.addTab( actionBar.newTab().setText(R.string.menu_sdcard_info), FileSDCardInfoFragment.class, null); mViewPager.setCurrentItem(0); ArrayList<SDCardInfo> roots = mFileSDCardHelper.getAllRoot(); // SD鍗′俊鎭� Bundle _args = null; for (int i = 0; i < roots.size(); i++) { SDCardInfo info = roots.get(i); _args = new Bundle(); _args.putInt(KEY_SDTYPE, info.type); mFileSDCardPageAdapter.addTab( // Add SDCard tab actionBar .newTab() .setText( info.type == SDCardInfo.INTERNAL_SD ? R.string.title_internal_sdcard : R.string.title_external_sdcard), FileSDCardFragment2.class, _args); } Button clearGarbage = (Button) findViewById(R.id.clear_garbage); clearGarbage.setOnClickListener(this); }
/** Called when the activity is first created. */ @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) @SuppressLint("NewApi") @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_capture); CameraManager.init(getApplication()); viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view); hasSurface = false; inactivityTimer = new InactivityTimer(this); actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowHomeEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setHomeButtonEnabled(true); actionBar.setLogo(getResources().getDrawable(R.drawable.ic_back)); }