List of usage examples for android.view Window FEATURE_CUSTOM_TITLE
int FEATURE_CUSTOM_TITLE
To view the source code for android.view Window FEATURE_CUSTOM_TITLE.
Click Source Link
From source file:gr.scify.newsum.ui.ViewActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); // Init custom category sCustomCategory = NewSumUiActivity.getAppContext(this).getResources().getString(R.string.custom_category); // Always select landscape orientation for big screens (?) if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_NORMAL & (getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) != Configuration.SCREENLAYOUT_SIZE_SMALL) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); }// w ww .j a va 2s . c o m SharedPreferences usertheme = getSharedPreferences("theme", 0); int newTheme = usertheme.getInt("theme", 2); Utils.onActivityCreateSetTheme(this, newTheme); }
From source file:org.altusmetrum.AltosDroid.AltosDroid.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (D)//from ww w. ja va 2s. c o m Log.e(TAG, "+++ ON CREATE +++"); // Get local Bluetooth adapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); // If the adapter is null, then Bluetooth is not supported if (mBluetoothAdapter == null) { Toast.makeText(this, "Bluetooth is not available", Toast.LENGTH_LONG).show(); finish(); return; } // Initialise preferences prefs = new AltosDroidPreferences(this); AltosPreferences.init(prefs); // Set up the window layout requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); setContentView(R.layout.altosdroid); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title); // Create the Tabs and ViewPager mTabHost = (TabHost) findViewById(android.R.id.tabhost); mTabHost.setup(); mViewPager = (AltosViewPager) findViewById(R.id.pager); mViewPager.setOffscreenPageLimit(4); mTabsAdapter = new TabsAdapter(this, mTabHost, mViewPager); mTabsAdapter.addTab(mTabHost.newTabSpec("pad").setIndicator("Pad"), TabPad.class, null); mTabsAdapter.addTab(mTabHost.newTabSpec("ascent").setIndicator("Ascent"), TabAscent.class, null); mTabsAdapter.addTab(mTabHost.newTabSpec("descent").setIndicator("Descent"), TabDescent.class, null); mTabsAdapter.addTab(mTabHost.newTabSpec("landed").setIndicator("Landed"), TabLanded.class, null); mTabsAdapter.addTab(mTabHost.newTabSpec("map").setIndicator("Map"), TabMap.class, null); // Scale the size of the Tab bar for different screen densities // This probably won't be needed when we start supporting ICS+ tabs. DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); int density = metrics.densityDpi; if (density == DisplayMetrics.DENSITY_XHIGH) tabHeight = 65; else if (density == DisplayMetrics.DENSITY_HIGH) tabHeight = 45; else if (density == DisplayMetrics.DENSITY_MEDIUM) tabHeight = 35; else if (density == DisplayMetrics.DENSITY_LOW) tabHeight = 25; else tabHeight = 65; for (int i = 0; i < 5; i++) mTabHost.getTabWidget().getChildAt(i).getLayoutParams().height = tabHeight; // Set up the custom title mTitle = (TextView) findViewById(R.id.title_left_text); mTitle.setText(R.string.app_name); mTitle = (TextView) findViewById(R.id.title_right_text); // Display the Version mVersion = (TextView) findViewById(R.id.version); mVersion.setText("Version: " + BuildInfo.version + " Built: " + BuildInfo.builddate + " " + BuildInfo.buildtime + " " + BuildInfo.buildtz + " (" + BuildInfo.branch + "-" + BuildInfo.commitnum + "-" + BuildInfo.commithash + ")"); mCallsignView = (TextView) findViewById(R.id.callsign_value); mRSSIView = (TextView) findViewById(R.id.rssi_value); mSerialView = (TextView) findViewById(R.id.serial_value); mFlightView = (TextView) findViewById(R.id.flight_value); mStateView = (TextView) findViewById(R.id.state_value); mAgeView = (TextView) findViewById(R.id.age_value); timer.scheduleAtFixedRate(new TimerTask() { public void run() { onTimerTick(); } }, 1000L, 100L); mAltosVoice = new AltosVoice(this); }
From source file:study.tdcc.act.MainCalendar.java
/** * onCreate//w w w . j a v a 2 s .c o m * @param savedInstanceState ? */ @Override public void onCreate(Bundle savedInstanceState) { Log.d("DEBUG", "MainCalendar onCreate Start"); super.onCreate(savedInstanceState); // requestWindowFeature(Window.FEATURE_CUSTOM_TITLE); //??? setContentView(R.layout.calendar); //??? Window window = getWindow(); window.setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.customtitle); //???? getScreenTransitionData(); //??? getScreenRestoreData(savedInstanceState); //????? getViewElement(); //? setCustomTitle(); //??? setViewListener(); //???? setViewElement(); // blFlick = true; Log.d("DEBUG", "MainCalendar onCreate End"); }
From source file:com.devwang.logcabin.LogCabinMainActivity.java
/** * /*from w w w.j a v a 2s . co m*/ */ private void diyTitle() { // Set up the window layout requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);// setContentView(R.layout.main); getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title); }