@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.about_screen); stylefont = Typeface.createFromAsset(getAssets(), AppConstants.fontStyle); actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle("About"); fontActionBar(actionBar.getTitle().toString()); actionBar.setIcon(android.R.drawable.ic_menu_info_details); if (isNetworkAvailable()) { new GetAbout(this).execute(); } else { Toast.makeText(this, "Please check your internet connection", Toast.LENGTH_SHORT).show(); } about = (TextView) findViewById(R.id.about_text); developed = (TextView) findViewById(R.id.developed); developed.setTypeface(stylefont); about.setTypeface(stylefont); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setIcon(android.R.color.transparent); actionBar.setLogo(R.drawable.up_icon); actionBar.setTitle(R.string.observation_photos); mApp = (INaturalistApp) getApplicationContext(); setContentView(R.layout.observation_photos); Intent intent = getIntent(); try { if (savedInstanceState == null) { String observationString = intent.getStringExtra("observation"); if (observationString != null) mObservation = new JSONObject(observationString); } else { mObservation = new JSONObject(savedInstanceState.getString("observation")); } } catch (JSONException e) { e.printStackTrace(); } mViewPager = (HackyViewPager) findViewById(R.id.id_pic_view_pager); if (mObservation != null) { mViewPager.setAdapter(new IdPicsPagerAdapter(mObservation)); } }
// cambiar el actionbar con iconos y fondo personalizado @TargetApi(Build.VERSION_CODES.HONEYCOMB) private void changeActionBar() { // typeface personalizadas robotoBoldCondensed = Typeface.createFromAsset(getActivity().getAssets(), "Roboto-BoldCondensed.ttf"); // boton de volver atras del boton home, e icono personalizado actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setHomeButtonEnabled(true); actionBar.setIcon(R.drawable.ic_nav_menu); // cambiar el titulo por otro con subtitulo + layout actionBar.setDisplayShowTitleEnabled(false); // ocultar titulo normal // permitir el customizado actionBar.setDisplayShowCustomEnabled(true); // inflar un view con el layout de los titulos View customView = LayoutInflater.from(getActivity()).inflate(R.layout.actionbar_title, null); // identificar las etiquetas y setTypeface otra letra titulo = (TextView) customView.findViewById(R.id.tituloWeAreValencia); titulo.setTypeface(robotoBoldCondensed); /// center xml in actionbar ActionBar.LayoutParams lp = new ActionBar.LayoutParams( ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.MATCH_PARENT); lp.gravity = Gravity.CENTER; customView.setLayoutParams(lp); /* http://stackoverflow.com/questions/11327210/setting-a-custom-text-in-the-center-actionbarsherlock */ // set inflate view to actionBarSherlock actionBar.setCustomView(customView); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.HOSTheme); ActionBar actionBar = getSupportActionBar(); actionBar.setHomeButtonEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setIcon(android.R.color.transparent); FadingHelper helper = new FadingHelper() .actionBarBackground(R.color.black_overlay) .headerLayout(R.layout.xmas_header) .parallax(true) .contentLayout(R.layout.xmas_miracles); setContentView(helper.createView(this)); helper.initActionBar(this); setUpMapIfNeeded(); forum = (XmasItem) findViewById(R.id.forum); forum.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(getApplicationContext(), HiddenWiki.class); i.putExtra("wikiLink", "http://forum.parkfans.net/thread-1673.html"); startActivity(i); } }); }
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pincodelock); Intent intent = getIntent(); mActivity = intent.getStringExtra(EXTRA_ACTIVITY); mBCancel = (Button) findViewById(R.id.cancel); mPinHdr = (TextView) findViewById(R.id.pinHdr); mPinHdrExplanation = (TextView) findViewById(R.id.pinHdrExpl); mText1 = (EditText) findViewById(R.id.txt1); mText1.requestFocus(); getWindow().setSoftInputMode(android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); mText2 = (EditText) findViewById(R.id.txt2); mText3 = (EditText) findViewById(R.id.txt3); mText4 = (EditText) findViewById(R.id.txt4); SharedPreferences appPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); // Not PIN Code defined yet. // In a previous version settings is allow from start if ((appPrefs.getString("PrefPinCode1", null) == null)) { setChangePincodeView(true); mPinCodeChecked = true; mNewPasswordEntered = true; } else { if (appPrefs.getBoolean("set_pincode", false)) { // pincode activated if (mActivity.equals("preferences")) { // PIN has been activated yet mPinHdr.setText(R.string.pincode_configure_your_pin); mPinHdrExplanation.setVisibility(View.VISIBLE); mPinCodeChecked = true; // No need to check it setChangePincodeView(true); } else { // PIN active mBCancel.setVisibility(View.INVISIBLE); mBCancel.setVisibility(View.GONE); mPinHdr.setText(R.string.pincode_enter_pin_code); mPinHdrExplanation.setVisibility(View.INVISIBLE); setChangePincodeView(false); } } else { // pincode removal mPinHdr.setText(R.string.pincode_remove_your_pincode); mPinHdrExplanation.setVisibility(View.INVISIBLE); mPinCodeChecked = false; setChangePincodeView(true); } } setTextListeners(); ActionBar actionBar = getSupportActionBar(); actionBar.setIcon(DisplayUtils.getSeasonalIconId()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); app = TRAApplication.getApp(); TAG = getClass().getName(); // Log.i("SWall",TAG+":onCreate"); defaultRequestData = new Bundle(); defaultRequestData.putString( ServiceManager.Constants.KEY_USER_NAME, getCurrentAccount().userName); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setCustomView(R.layout.title_bar); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); actionBar.setIcon(R.drawable.icon); actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM); actionBar.setDisplayShowCustomEnabled(true); actionBar.setBackgroundDrawable(getResources().getDrawable((R.color.bg))); } UmengUpdateAgent.setUpdateAutoPopup(false); UmengUpdateAgent.setDialogListener( new UmengDialogButtonListener() { @Override public void onClick(int status) { switch (status) { case UpdateStatus.Update: break; case UpdateStatus.Ignore: break; case UpdateStatus.NotNow: break; } } }); // if(isIgnoredOnce) { // UmengUpdateAgent.update(this); // } UmengUpdateAgent.setUpdateListener(this); UmengUpdateAgent.update(app.getApplicationContext()); showQuitButton(); setBackConfirm(false); }
/** 主界面初始化 */ public void initContentview() { // actionbar ActionBar supportActionBar = getSupportActionBar(); supportActionBar.setIcon(R.drawable.ic_duobei); supportActionBar.setTitle("多贝公开课"); // menudrawer mDrawer = MenuDrawer.attach(this, Type.OVERLAY); mDrawer.setContentView(R.layout.activity_main); // 初始化3个tab fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); mhomeFragment = new HomeFragment(); mhomeFragment.addpager("新课速递", new NewCourseFragment()); mhomeFragment.addpager("每日推荐", new DailyRecFragment()); mhomeFragment.addpager("精选课程", new PickCourseFragment()); ft.add(R.id.container, mhomeFragment); ft.addToBackStack(null); ft.commit(); }
/* * inicializa * (non-Javadoc) * @see android.app.Activity#onCreate(android.os.Bundle) */ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.resultadostest); ActionBar bar = getSupportActionBar(); bar.setTitle("Recomendaciones"); bar.setIcon(R.drawable.home_icon_normal_invert); bar.setHomeButtonEnabled(true); if (savedInstanceState == null) { Recomendaciones.getResultados(this); } else { getContents(savedInstanceState.getString("json")); } }
private void setupActionBar() { final ActionBar actionBar = getSupportActionBar(); actionBar.setIcon(R.drawable.ic_action_list); actionBar.setTitle(R.string.lists); }