List of usage examples for android.view Window FEATURE_NO_TITLE
int FEATURE_NO_TITLE
To view the source code for android.view Window FEATURE_NO_TITLE.
Click Source Link
From source file:com.example.mydemos.view.RingtonePickerActivity.java
/** Called when the activity is first created. */ @Override//from w w w. j ava2s .c o m public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.ringtone_picker); CharSequence sysTitle = (CharSequence) getResources().getText(R.string.sys_tone); CharSequence MusicTitle = (CharSequence) getResources().getText(R.string.sd_music); CharSequence RecordTitle = (CharSequence) getResources().getText(R.string.record_tone); Intent intent = getIntent(); toneType = intent.getIntExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, -1); Log.e("duwenhua", "ringPick get toneType:" + toneType); //! by duwenhua //if(toneType == RingtoneManager.TYPE_RINGTONE_SECOND) // toneType = RINGTONE_TYPE; //! by duwenhua mHasDefaultItem = intent.getBooleanExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, true); mUriForDefaultItem = intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI); //Log.i("lys", "mUriForDefaultItem == " + mUriForDefaultItem); if (savedInstanceState != null) { mSelectedId = savedInstanceState.getLong(SAVE_CLICKED_POS, -1); } //Log.i("lys", "mUriForDefaultItem 1== " + mUriForDefaultItem+", mSelectedId =="+mSelectedId); mHasSilentItem = intent.getBooleanExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true); mExistingUri = intent.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_EXISTING_URI); //if(mUriForDefaultItem != null) //{ // mSelectedId = ContentUris.parseId(mUriForDefaultItem); //} //Log.i("lys", "RingtonePickerActivity.java onCreate mExistingUri == " + mExistingUri); //String action = getIntent().getAction(); //Log.i("lys", "PT Intent action == " + action); if (toneType == NOTIFICATION_TYPE) { mUriForDefaultItem = Settings.System.DEFAULT_NOTIFICATION_URI; } else if (toneType == RINGTONE_TYPE) { mUriForDefaultItem = Settings.System.DEFAULT_RINGTONE_URI; } else if (toneType == ALARM_TYPE) { mUriForDefaultItem = Settings.System.DEFAULT_ALARM_ALERT_URI; } if (isAvailableToCheckRingtone() == true) { Ringtone ringtone_DefaultItem = checkRingtone_reflect(this, mUriForDefaultItem, toneType); if (ringtone_DefaultItem != null && ringtone_DefaultItem.getUri() != null) { mUriForDefaultItem = ringtone_DefaultItem.getUri(); Log.i("lys", "RingtoneManager.getRingtone mUriForDefaultItem== " + mUriForDefaultItem); } else { //mUriForDefaultItem = 'content/medial/'; /*ZTE_AUDIO_LIYANG 2014/06/30 fix bug for ringtone when remove sdcard start */ String originalRingtone = Settings.System.getString(getApplicationContext().getContentResolver(), "ringtone_original"); if (originalRingtone != null && !TextUtils.isEmpty(originalRingtone)) { mUriForDefaultItem = Uri.parse(originalRingtone); Log.e("liyang", "select riongtone error ,change to originalRingtone == " + mExistingUri); } /*ZTE_AUDIO_LIYANG 2014/06/30 fix bug for ringtone when remove sdcard end */ Log.i("lys", "mUriForDefaultItem set as default mUriForDefaultItem== 222"); } if (mExistingUri != null) { Ringtone ringtone = checkRingtone_reflect(this, mExistingUri, toneType); if (ringtone != null && ringtone.getUri() != null) { //mUriForDefaultItem = ringtone.getUri(); mExistingUri = ringtone.getUri(); Log.i("lys", "RingtoneManager.getRingtone mExistingUri== " + mExistingUri); } else { mExistingUri = mUriForDefaultItem; Log.i("lys", "mExistingUri set as default mExistingUri== " + mExistingUri); } } } boolean includeDrm = intent.getBooleanExtra(RingtoneManager.EXTRA_RINGTONE_INCLUDE_DRM, false); Log.e("lys", "includeDrm ==" + includeDrm); mRingtoneManager = new RingtoneManager(this); mRingtoneManager.setIncludeDrm(includeDrm); if (toneType != -1) { mRingtoneManager.setType(toneType); } setVolumeControlStream(mRingtoneManager.inferStreamType()); // toneActivityType = mRingtoneManager.getActivityType(); if (toneType == ALARM_TYPE) { sysTitle = (CharSequence) getResources().getText(R.string.alarm_tone); } else if (toneType == NOTIFICATION_TYPE) { sysTitle = (CharSequence) getResources().getText(R.string.notification_tone); } listView = new ListView(this); listView.setOnItemClickListener(this); //listView.setBackgroundColor(#ff5a5a5a); listView.setFastScrollEnabled(true); //listView.setFastScrollAlwaysVisible(true); listView.setEmptyView(findViewById(android.R.id.empty)); //mHasSilentItem = intent.getBooleanExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_SILENT, true); //mHasDefaultItem = true; //temp if (mHasDefaultItem) { //chengcheng addDefaultStaticItem(listView, com.android.internal.R.string.ringtone_default); } setDefaultRingtone(); if (mHasSilentItem) { // chengcheng addSilendStaticItem(listView, com.android.internal.R.string.ringtone_silent); } audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); mAudioFocusListener = new OnAudioFocusChangeListener() { public void onAudioFocusChange(int focusChange) { } }; okBtn = (Button) findViewById(R.id.ok); okBtn.setOnClickListener(this); cancelBtn = (Button) findViewById(R.id.cancel); cancelBtn.setOnClickListener(this); TabHost mTabHost = (TabHost) findViewById(android.R.id.tabhost); mTabHost.setup(); mTabHost.addTab(mTabHost.newTabSpec("tab_system").setIndicator(sysTitle, null).setContent(this)); mTabHost.addTab(mTabHost.newTabSpec("tab_music").setIndicator(MusicTitle, null).setContent(this)); mTabHost.addTab(mTabHost.newTabSpec("tab_record").setIndicator(RecordTitle, null).setContent(this)); mTabHost.setCurrentTab(0); mTabHost.setOnTabChangedListener(new OnTabChangeListener() { @Override public void onTabChanged(String tabId) { // stopMediaPlayer(); createTabContent(tabId); } }); }
From source file:com.njlabs.amrita.aid.gpms.ui.GpmsActivity.java
private void showConnectToAmritaAlert() { AlertDialog.Builder builder = new AlertDialog.Builder(baseContext); builder.setMessage("Connect to the Amrita WiFi if possible, for a reliable connection to the GPMS Server.") .setCancelable(true).setIcon(R.drawable.ic_action_info_small) .setPositiveButton("Ok. I'll connect.", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { startActivity(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS)); finish();/*w w w .j ava2 s .c om*/ } }).setNegativeButton("No. I won't.", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); initialiseGpms(); hideSoftKeyboard(); } }); AlertDialog alert = builder.create(); alert.requestWindowFeature(Window.FEATURE_NO_TITLE); if (!Identifier.isConnectedToAmrita(baseContext)) { alert.show(); } else { initialiseGpms(); } }
From source file:android.support.v7.app.AlertController.java
public AlertController(Context context, AppCompatDialog di, Window window) { mContext = context;/*from w w w . j a v a 2 s.c om*/ mDialog = di; mWindow = window; mHandler = new ButtonHandler(di); final TypedArray a = context.obtainStyledAttributes(null, R.styleable.AlertDialog, R.attr.alertDialogStyle, 0); mAlertDialogLayout = a.getResourceId(R.styleable.AlertDialog_android_layout, 0); mButtonPanelSideLayout = a.getResourceId(R.styleable.AlertDialog_buttonPanelSideLayout, 0); mListLayout = a.getResourceId(R.styleable.AlertDialog_listLayout, 0); mMultiChoiceItemLayout = a.getResourceId(R.styleable.AlertDialog_multiChoiceItemLayout, 0); mSingleChoiceItemLayout = a.getResourceId(R.styleable.AlertDialog_singleChoiceItemLayout, 0); mListItemLayout = a.getResourceId(R.styleable.AlertDialog_listItemLayout, 0); a.recycle(); /* We use a custom title so never request a window title */ di.supportRequestWindowFeature(Window.FEATURE_NO_TITLE); }
From source file:terse.a1.TerseActivity.java
@Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); glSurfaceView = null; // Forget gl on new activity. requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); if (savedInstanceState != null && savedInstanceState.containsKey("TerseActivity")) { taSaveMe = savedInstanceState.getString("TerseActivity"); } else {/* ww w . j av a 2 s .c o m*/ taSaveMe = null; } Runnable bg = new Runnable() { @Override public void run() { resetTerp(); } }; Runnable fg = new Runnable() { @Override public void run() { Intent intent = getIntent(); Uri uri = intent.getData(); Bundle extras = intent.getExtras(); String path = uri == null ? "/" : uri.getPath(); String query = uri == null ? "" : uri.getQuery(); viewPath(path, query, extras, savedInstanceState); } }; if (terp == null) { TextView tv = new TextView(TerseActivity.this); tv.setText(Static.fmt("Building new TerseTalk VM for world <%s>...", world)); tv.setTextAppearance(this, R.style.teletype); tv.setBackgroundColor(Color.BLACK); tv.setTextColor(Color.DKGRAY); tv.setTextSize(24); setContentView(tv); setContentViewThenBgThenFg("ResetSplash", tv, bg, fg); } else { fg.run(); } }
From source file:com.cybrosys.palmcalc.PalmCalcActivity.java
private void Feedback() { dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCancelable(true);//from www .ja va 2s . co m dialog.setContentView(R.layout.feedback); etxtFeedback = (EditText) dialog.findViewById(R.id.etxtFeedback); btnClear = (Button) dialog.findViewById(R.id.btnClear); btnClear.setOnClickListener(this); btnSend = (Button) dialog.findViewById(R.id.btnSend); btnSend.setOnClickListener(this); dialog.show(); }
From source file:com.diandi.widget.googledatetimepicker.date.DatePickerDialog.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log.d(TAG, "onCreateView: "); getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); View view = inflater.inflate(R.layout.date_picker_dialog, null); mDayOfWeekView = (TextView) view.findViewById(R.id.date_picker_header); mMonthAndDayView = (LinearLayout) view.findViewById(R.id.date_picker_month_and_day); mMonthAndDayView.setOnClickListener(this); mSelectedMonthTextView = (TextView) view.findViewById(R.id.date_picker_month); mSelectedDayTextView = (TextView) view.findViewById(R.id.date_picker_day); mYearView = (TextView) view.findViewById(R.id.date_picker_year); mYearView.setOnClickListener(this); int listPosition = -1; int listPositionOffset = 0; int currentView = MONTH_AND_DAY_VIEW; if (savedInstanceState != null) { mWeekStart = savedInstanceState.getInt(KEY_WEEK_START); mMinYear = savedInstanceState.getInt(KEY_YEAR_START); mMaxYear = savedInstanceState.getInt(KEY_YEAR_END); currentView = savedInstanceState.getInt(KEY_CURRENT_VIEW); listPosition = savedInstanceState.getInt(KEY_LIST_POSITION); listPositionOffset = savedInstanceState.getInt(KEY_LIST_POSITION_OFFSET); }// w ww .ja v a 2 s. co m final Activity activity = getActivity(); mDayPickerView = new DayPickerView(activity, this); mYearPickerView = new YearPickerView(activity, this); Resources res = getResources(); mDayPickerDescription = res.getString(R.string.day_picker_description); mSelectDay = res.getString(R.string.select_day); mYearPickerDescription = res.getString(R.string.year_picker_description); mSelectYear = res.getString(R.string.select_year); mAnimator = (AccessibleDateAnimator) view.findViewById(R.id.animator); mAnimator.addView(mDayPickerView); mAnimator.addView(mYearPickerView); mAnimator.setDateMillis(mCalendar.getTimeInMillis()); // TODO: Replace with animation decided upon by the design team. Animation animation = new AlphaAnimation(0.0f, 1.0f); animation.setDuration(ANIMATION_DURATION); mAnimator.setInAnimation(animation); // TODO: Replace with animation decided upon by the design team. Animation animation2 = new AlphaAnimation(1.0f, 0.0f); animation2.setDuration(ANIMATION_DURATION); mAnimator.setOutAnimation(animation2); mDoneButton = (Button) view.findViewById(R.id.done); mDoneButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { tryVibrate(); if (mCallBack != null) { mCallBack.onDateSet(DatePickerDialog.this, mCalendar.get(Calendar.YEAR), mCalendar.get(Calendar.MONTH), mCalendar.get(Calendar.DAY_OF_MONTH)); } dismiss(); } }); updateDisplay(false); setCurrentView(currentView); if (listPosition != -1) { if (currentView == MONTH_AND_DAY_VIEW) { mDayPickerView.postSetSelection(listPosition); } else if (currentView == YEAR_VIEW) { mYearPickerView.postSetSelectionFromTop(listPosition, listPositionOffset); } } return view; }
From source file:com.spoiledmilk.ibikecph.util.Util.java
public static void launchNoConnectionDialog(Context ctx) { final Dialog dialog = new Dialog(ctx); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_no_connection); TextView text = (TextView) dialog.findViewById(R.id.textNetworkError); text.setTypeface(IbikeApplication.getNormalFont()); text.setText(IbikeApplication.getString("network_error_text")); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); dialog.show();/*from w ww .j a v a2s .co m*/ final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { try { dialog.dismiss(); } catch (Exception e) { // dialog not attached to window } } }, 3000); }
From source file:edu.cens.loci.ui.PlaceViewActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // parse incoming data final Intent intent = getIntent(); final String action = intent.getAction(); if (Intent.ACTION_VIEW.equals(action)) { mUri = intent.getData();/*w w w . j av a 2 s . c om*/ if (mUri == null) { MyLog.e(LociConfig.D.ERROR, TAG, "intent.getData() is empty, exiting."); finish(); } MyLog.d(LociConfig.D.UI.DEBUG, TAG, "mUri=" + mUri.toString()); } else { MyLog.e(LociConfig.D.ERROR, TAG, "Unknown action, exiting."); finish(); return; } mPlaceId = LociProvider.checkPlaceIdUri(mUri); if (mPlaceId < 0) { MyLog.e(LociConfig.D.ERROR, TAG, "Invalid uri, exiting."); finish(); } mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.place_view); mNameView = (TextView) findViewById(R.id.name); mMapView = (MapView) findViewById(R.id.map); mListView = (ListView) findViewById(R.id.place_data); mListView.setOnItemClickListener(this); mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY); mListView.setEmptyView(findViewById(android.R.id.empty)); mDbUtils = new LociDbUtils(this); mPlace = mDbUtils.getPlace(mPlaceId); //DEBUG MyLog.d(LociConfig.D.UI.DEBUG, TAG, "viewing..." + mPlace.toString()); mHandler = new NotifyingAsyncQueryHandler(this, this); // The order they're added to mSections dictates the order they are diplayed in the list. mSections.add(mGpsEntries); mSections.add(mWifiEntries); mSections.add(mPostalEntries); mSections.add(mTagEntries); mSections.add(mWebsiteEntries); mSections.add(mOtherEntries); }
From source file:com.scoreloop.android.coreui.BaseActivity.java
private Dialog createErrorDialog(final int resId) { final Dialog dialog = new Dialog(this); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); final View view = getLayoutInflater().inflate(R.layout.sl_dialog_custom, null); dialog.setContentView(view);/*from w w w .j av a 2 s . c o m*/ dialog.setCanceledOnTouchOutside(true); ((TextView) view.findViewById(R.id.message)).setText(getString(resId)); return dialog; }
From source file:gov.nasa.arc.geocam.geocam.CameraActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Window and view properties requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.camera);/*from w w w . j av a 2 s.c o m*/ // Location mLocationReceiver = new LocationReceiver(); mLocationFormatter.setMaximumFractionDigits(6); mLatText = (TextView) findViewById(R.id.camera_textview_lat); mLonText = (TextView) findViewById(R.id.camera_textview_lon); // Orientation mSensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); // Camera mCameraPreview = (SurfaceView) findViewById(R.id.camera_surfaceview); mHolder = mCameraPreview.getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); // UI elements mFocusRect = (ImageView) findViewById(R.id.camera_focus_imageview); mFocusRect.setImageDrawable(getResources().getDrawable(R.drawable.frame_unfocused_64x48)); final ImageButton shutterButton = (ImageButton) findViewById(R.id.camera_shutter_button); shutterButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { if (!mPictureTaken) { mPictureTaken = true; if (!mLensIsFocused) { mFocusRect.setImageDrawable(getResources().getDrawable(R.drawable.frame_unfocused_64x48)); mLensIsFocused = true; CameraActivity.this.focusLens(true); } else { CameraActivity.this.takePicture(); } } } }); mForeground = new ForegroundTracker(this); }