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.moodmap.HomeActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); scale = this.getResources().getDisplayMetrics().density; setContentView(R.layout.home_screen_layout); context = HomeActivity.this; getDeviceWidth(); // get device vidth to create view width and height initUi(); // initializ the ui initDatabase(); // create database instance moodFirst = new Mood(); moodSecond = new Mood(); /** Reminder to enter the */ AlarmReceiver.setNotificationTimer(HomeActivity.this); // STC 10/19/11 spIDs = // getApplicationContext().getSharedPreferences("IDs", MODE_PRIVATE); spIDs = PreferenceManager.getDefaultSharedPreferences(this); // STC studyID = spIDs.getString("StudyID", ""); participantID = spIDs.getString("participantID", ""); deviceID = spIDs.getString("DeviceID", ""); mMoodMapProbeWriter = new MoodMapProbeWriter(this); // just onResume 1/2/12 registerLocationListeners(); }
From source file:ca.ualberta.cs.drivr.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); userManager.setConnectivityManager((ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE)); /**/* ww w . j a v a 2s.c o m*/ * This calls the login activity a the beginning if there is no local user stored */ if (userManager.getUser().getUsername().isEmpty()) { Intent intent = new Intent(MainActivity.this, LoginActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); } this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); context = getApplicationContext(); PreferenceManager.setDefaultValues(this, R.xml.pref_driver_mode, false); setSupportActionBar(toolbar); // Create an instance of GoogleAPIClient. if (mGoogleApiClient == null) { mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this) .addOnConnectionFailedListener(this).addApi(LocationServices.API).build(); } mFragment = (SupportMapFragment) this.getSupportFragmentManager().findFragmentById(R.id.main_map); mFragment.getMapAsync(this); autocompleteFragment = (PlaceAutocompleteFragment) getFragmentManager() .findFragmentById(R.id.place_autocomplete_fragment); autocompleteFragment.setOnPlaceSelectedListener(new PlaceSelectionListener() { @Override public void onPlaceSelected(Place place) { ConcretePlace concretePlace = new ConcretePlace(place); Gson gson = new GsonBuilder().registerTypeAdapter(Uri.class, new UriSerializer()).create(); if (userManager.getUserMode().equals(UserMode.RIDER)) { Intent intent = new Intent(MainActivity.this, NewRequestActivity.class); String concretePlaceJson = gson.toJson(concretePlace); intent.putExtra(NewRequestActivity.EXTRA_PLACE, concretePlaceJson); Log.i(TAG, "Place: " + place.getName() + ", :" + place.getLatLng()); startActivity(intent); } else if (userManager.getUserMode().equals(UserMode.DRIVER)) { Intent intent = new Intent(MainActivity.this, SearchRequestActivity.class); String concretePlaceJson = gson.toJson(concretePlace); intent.putExtra(SearchRequestActivity.EXTRA_PLACE, concretePlaceJson); intent.putExtra(SearchRequestActivity.EXTRA_KEYWORD, ""); Log.i(TAG, "Place: " + place.getName() + ", :" + place.getLatLng()); startActivity(intent); } } @Override public void onError(Status status) { // Do nothing } }); // Using the floating action button menu system final FloatingActionMenu fabMenu = (FloatingActionMenu) findViewById(R.id.main_fab_menu); FloatingActionButton fabSettings = (FloatingActionButton) findViewById(R.id.fabSettings); FloatingActionButton fabRequests = (FloatingActionButton) findViewById(R.id.main_fab_requests); FloatingActionButton fabProfile = (FloatingActionButton) findViewById(R.id.main_fab_profile); FloatingActionButton fabHistory = (FloatingActionButton) findViewById(R.id.main_fah_history); FloatingActionButton fabLogin = (FloatingActionButton) findViewById(R.id.main_fab_login); final FloatingActionButton fabDriver = (FloatingActionButton) findViewById(R.id.main_driver_mode); final FloatingActionButton fabRider = (FloatingActionButton) findViewById(R.id.main_rider_mode); // Hide the settings FAB fabSettings.setVisibility(View.GONE); /* Change between user and driver mode. Will probably be replaced with an option in settings. For now the visibility of this is set to gone because we should not have too many FABs. Having too many FABs may cause confusion and rendering issues on small screens. */ keywordEditText = (EditText) findViewById(R.id.main_keyword_edit_text); FloatingActionButton fabMode = (FloatingActionButton) findViewById(R.id.main_fab_mode); fabMode.setVisibility(View.GONE); if (userManager.getUserMode().equals(UserMode.RIDER)) { fabRider.setVisibility(View.GONE); keywordEditText.setVisibility(View.GONE); } else { fabDriver.setVisibility(View.GONE); keywordEditText.setVisibility(View.VISIBLE); } keywordEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_DONE) { Intent intent = new Intent(MainActivity.this, SearchRequestActivity.class); intent.putExtra(SearchRequestActivity.EXTRA_PLACE, ""); intent.putExtra(SearchRequestActivity.EXTRA_KEYWORD, keywordEditText.getText().toString()); keywordEditText.setText(""); keywordEditText.clearFocus(); startActivity(intent); } return true; } }); fabMode.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.i(TAG, "clicked mode fab"); /* Will be able to implement code below once elasticSearch is up and running UserManager userManager = null; // Once elasticSearch is working will replace with finding a User if (userManager.getUserMode() == UserMode.DRIVER) { userManager.setUserMode(UserMode.RIDER); } else if (userManager.getUserMode() == UserMode.RIDER) { userManager.setUserMode(UserMode.DRIVER); //Will have to implement a method "FindNearbyRequests" to get requests whose source // is nearby and display it on the map //Intent intent = new Intent((MainActivity.this, FindNearbyRequests.class);) //startActivity(intent); }*/ } }); fabDriver.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (userManager.getUser().getVehicleDescription().isEmpty()) { /* * From: http://stackoverflow.com/a/29048271 * Author: Syeda Zunairah * Accessed: November 29, 2016 * Creates a dialog box with an edit text to get the vehicle description. */ AlertDialog.Builder alert = new AlertDialog.Builder(v.getContext()); final EditText edittext = new EditText(v.getContext()); edittext.setText("Vechicle Make"); edittext.clearComposingText(); alert.setTitle("Become a Driver!"); alert.setMessage( "Drivers are require to enter vehicle information!\n\nPlease enter your vehicle's make"); alert.setView(edittext); alert.setPositiveButton("Save Description", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { String vehicleDescription = edittext.getText().toString(); if (!vehicleDescription.isEmpty()) { userManager.getUser().setVehicleDescription(vehicleDescription); userManager.notifyObservers(); userManager.setUserMode(UserMode.DRIVER); ElasticSearch elasticSearch = new ElasticSearch( userManager.getConnectivityManager()); elasticSearch.updateUser(userManager.getUser()); keywordEditText.setVisibility(View.VISIBLE); fabDriver.setVisibility(View.GONE); fabRider.setVisibility(View.VISIBLE); fabMenu.close(true); } dialog.dismiss(); } }); alert.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { dialog.dismiss(); } }); AlertDialog newAlert = alert.create(); newAlert.show(); } if (!userManager.getUser().getVehicleDescription().isEmpty()) { userManager.setUserMode(UserMode.DRIVER); keywordEditText.setVisibility(View.VISIBLE); fabDriver.setVisibility(View.GONE); fabRider.setVisibility(View.VISIBLE); fabMenu.close(true); } } }); fabRider.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { userManager.setUserMode(UserMode.RIDER); keywordEditText.setVisibility(View.GONE); fabRider.setVisibility(View.GONE); fabDriver.setVisibility(View.VISIBLE); fabMenu.close(true); } }); fabLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(MainActivity.this, LoginActivity.class); fabMenu.close(true); startActivity(intent); } }); fabSettings.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.i(TAG, "clicked settings fab"); Intent intent = new Intent(MainActivity.this, SettingsActivity.class); fabMenu.close(true); startActivity(intent); } }); fabProfile.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.i(TAG, "clicked profile fab"); Intent intent = new Intent(MainActivity.this, ProfileActivity.class); fabMenu.close(true); startActivity(intent); } }); fabHistory.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.i(TAG, "clicked history fab"); Intent intent = new Intent(MainActivity.this, RequestHistoryActivity.class); fabMenu.close(true); startActivity(intent); } }); fabRequests.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.i(TAG, "clicked requests fab"); Intent intent = new Intent(MainActivity.this, RequestsListActivity.class); fabMenu.close(true); startActivity(intent); } }); setNotificationAlarm(context); }
From source file:com.twitterdev.rdio.app.RdioApp.java
@Override public void onCreate(Bundle savedInstanceState) { ////from w ww . jav a 2s .co m imageLoader = ImageLoader.getInstance(); imageLoader.init(ImageLoaderConfiguration.createDefault(this)); // set full screen requestWindowFeature(Window.FEATURE_NO_TITLE); final Activity ac = this; setContentView(R.layout.activity_main); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); List<String> where = new ArrayList<String>(); super.onCreate(savedInstanceState); setContentView(R.layout.main); trackQueue = new LinkedList<Track>(); // Initialize our Rdio object. If we have cached access credentials, then use them - otherwise // Initialize w/ null values and the user will be prompted (if the Rdio app is installed), or // we'll fallback to 30s samples. if (rdio == null) { SharedPreferences settings = getPreferences(MODE_PRIVATE); accessToken = settings.getString(PREF_ACCESSTOKEN, null); accessTokenSecret = settings.getString(PREF_ACCESSTOKENSECRET, null); rdio = new Rdio(Constants.appKey, Constants.appSecret, accessToken, accessTokenSecret, this, this); if (accessToken == null || accessTokenSecret == null) { // If either one is null, reset both of them accessToken = accessTokenSecret = null; Intent myIntent = new Intent(RdioApp.this, OAuth1WebViewActivity.class); myIntent.putExtra(OAuth1WebViewActivity.EXTRA_CONSUMER_KEY, Constants.appKey); myIntent.putExtra(OAuth1WebViewActivity.EXTRA_CONSUMER_SECRET, Constants.appSecret); RdioApp.this.startActivityForResult(myIntent, 1); } else { Log.d(TAG, "Found cached credentials:"); Log.d(TAG, "Access token: " + accessToken); Log.d(TAG, "Access token secret: " + accessTokenSecret); rdio.prepareForPlayback(); } } ImageView i = (ImageView) findViewById(R.id.next); i.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { next(true); } }); playPause = (ImageView) findViewById(R.id.playPause); playPause.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { playPause(); } }); albumArt = (ImageView) findViewById(R.id.albumArt); playPause(); }
From source file:com.android.app.MediaPlaybackActivity.java
/** * Called when the activity is first created. *//*from w ww. j av a 2 s .co m*/ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setVolumeControlStream(AudioManager.STREAM_MUSIC); mAlbumArtWorker = new Worker("album art worker"); mAlbumArtHandler = new AlbumArtHandler(mAlbumArtWorker.getLooper()); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.audio_player); mCurrentTime = (TextView) findViewById(R.id.currenttime); mTotalTime = (TextView) findViewById(R.id.totaltime); mProgress = (SeekBar) findViewById(R.id.seekbar_playback); mAlbum = (ImageView) findViewById(R.id.album); mArtistName = (TextView) findViewById(R.id.artistname); mAlbumName = (TextView) findViewById(R.id.albumname); mTrackName = (TextView) findViewById(R.id.trackname); View v = (View) mArtistName.getParent(); v.setOnTouchListener(this); v.setOnLongClickListener(this); v = (View) mAlbumName.getParent(); v.setOnTouchListener(this); v.setOnLongClickListener(this); v = (View) mTrackName.getParent(); v.setOnTouchListener(this); v.setOnLongClickListener(this); mPrevButton = (RepeatingImageButton) findViewById(R.id.prev); mPrevButton.setOnClickListener(mPrevListener); mPrevButton.setRepeatListener(mRewListener, 260); mPauseButton = (ImageButton) findViewById(R.id.pause); mPauseButton.requestFocus(); mPauseButton.setOnClickListener(mPauseListener); mNextButton = (RepeatingImageButton) findViewById(R.id.next); mNextButton.setOnClickListener(mNextListener); mNextButton.setRepeatListener(mFfwdListener, 260); seekmethod = 1; mDeviceHasDpad = (getResources().getConfiguration().navigation == Configuration.NAVIGATION_DPAD); mQueueButton = (ImageButton) findViewById(R.id.curplaylist); mQueueButton.setOnClickListener(mQueueListener); mShuffleButton = ((ImageButton) findViewById(R.id.shuffle)); mShuffleButton.setOnClickListener(mShuffleListener); mRepeatButton = ((ImageView) findViewById(R.id.repeat)); mRepeatButton.setOnClickListener(mRepeatListener); mIndicator_left = (ImageView) findViewById(R.id.indicator_circle_1); mIndicator_right = (ImageView) findViewById(R.id.indicator_circle_2); mIndicator_right.setEnabled(false); mTitleBack = (ImageButton) findViewById(R.id.title_back); mTitleBack.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { onBackPressed(); } }); mTitlePlaylist = (ImageButton) findViewById(R.id.title_playlist); mTitlePlaylist.setOnClickListener(mQueueListener); mTitlePlaying = (TextView) findViewById(R.id.title_playing); playlistPlayback = (ImageView) findViewById(R.id.playlist_iv_playback); playlistPlayback.setOnClickListener(mShowPlaylistListener); if (mProgress instanceof SeekBar) { SeekBar seeker = (SeekBar) mProgress; seeker.setOnSeekBarChangeListener(mSeekListener); } mProgress.setMax(1000); mTouchSlop = ViewConfiguration.get(this).getScaledTouchSlop(); mViewPager = (ViewPager) findViewById(R.id.vp_play_container); initViewPagerContent(); // mViewPager.setPageTransformer(true, new PlayPageTransformer()); // mPagerIndicator.create(mViewPagerContent.size()); mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { } @Override public void onPageSelected(int position) { if (position == 0) { mIndicator_left.setEnabled(true); mIndicator_right.setEnabled(false); } else if (position == 1) { mIndicator_left.setEnabled(false); mIndicator_right.setEnabled(true); } } @Override public void onPageScrollStateChanged(int state) { } }); mViewPager.setAdapter(mPagerAdapter); }
From source file:com.memetro.android.MainActivity.java
public void showRecoverPassDialog(final Context context) { final Dialog mDialog = new Dialog(context); mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); mDialog.setContentView(R.layout.dialog_recover); mDialog.setCancelable(true);//from w w w.j a v a 2 s . co m final EditText emailText = (EditText) mDialog.findViewById(R.id.email); Button sendButton = (Button) mDialog.findViewById(R.id.send); sendButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { RecoverPassUtils.recoverPass(context, emailText.getText().toString(), new OAuthHandler() { public void onStart() { pdialog.show(); } public void onSuccess() { mDialog.dismiss(); MemetroDialog.showDialog(MainActivity.this, null, getString(R.string.recover_ok)); } public void onFailure() { MemetroDialog.showDialog(MainActivity.this, null, getString(R.string.recover_ko)); } public void onFinish() { pdialog.dismiss(); } }); } }); mDialog.show(); }
From source file:edu.cscie71.imm.slacker.plugin.Slacker.java
private void openAuthScreen() { Runnable runnable = new Runnable() { @SuppressLint("NewApi") public void run() { dialog = new Dialog(cordova.getActivity(), android.R.style.Theme_NoTitleBar); dialog.getWindow().getAttributes().windowAnimations = android.R.style.Animation_Dialog; dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setCancelable(true);/*from w w w . j ava 2 s .c o m*/ LinearLayout mainLayout = new LinearLayout(cordova.getActivity()); mainLayout.setOrientation(LinearLayout.VERTICAL); inAppWebView = new WebView(cordova.getActivity()); inAppWebView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT)); inAppWebView.setWebChromeClient(new WebChromeClient()); WebViewClient client = new AuthBrowser(); inAppWebView.setWebViewClient(client); WebSettings settings = inAppWebView.getSettings(); settings.setJavaScriptEnabled(true); settings.setJavaScriptCanOpenWindowsAutomatically(true); inAppWebView.loadUrl(authURL + "?client_id=" + slackClientID + "&scope=" + scope); inAppWebView.getSettings().setLoadWithOverviewMode(true); inAppWebView.getSettings().setUseWideViewPort(true); inAppWebView.requestFocus(); inAppWebView.requestFocusFromTouch(); mainLayout.addView(inAppWebView); WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(dialog.getWindow().getAttributes()); lp.width = WindowManager.LayoutParams.MATCH_PARENT; lp.height = WindowManager.LayoutParams.MATCH_PARENT; dialog.setContentView(mainLayout); dialog.show(); dialog.getWindow().setAttributes(lp); } }; this.cordova.getActivity().runOnUiThread(runnable); }
From source file:com.bitants.wally.fragments.ImageZoomFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { if (getActivity() != null) { final Dialog dialog = new Dialog(getActivity()); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.activity_image_zoom); dialog.getWindow().setBackgroundDrawableResource(R.color.Transparent); WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(); layoutParams.copyFrom(dialog.getWindow().getAttributes()); layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT; layoutParams.height = WindowManager.LayoutParams.MATCH_PARENT; dialog.getWindow().setAttributes(layoutParams); initToolbar(dialog);// ww w .ja v a2 s . c om progressBar = dialog.findViewById(R.id.zoom_loader); zoomableImageView = (PhotoView) dialog.findViewById(R.id.image_zoom_photoview); if (bitmap != null) { if (rect != null) { animateIn(dialog); } } else if (fileUri != null) { showLoader(); Glide.with(getActivity()).load(fileUri).fitCenter() .listener(new RequestListener<Uri, GlideDrawable>() { @Override public boolean onException(Exception e, Uri model, Target<GlideDrawable> target, boolean isFirstResource) { return false; } @Override public boolean onResourceReady(GlideDrawable resource, Uri model, Target<GlideDrawable> target, boolean isFromMemoryCache, boolean isFirstResource) { hideLoader(); return false; } }).into(zoomableImageView); } else { dismiss(); } photoViewAttacher = new PhotoViewAttacher(zoomableImageView); photoViewAttacher.setOnViewTapListener(new PhotoViewAttacher.OnViewTapListener() { @Override public void onViewTap(View view, float x, float y) { dismiss(); } }); return dialog; } else { return null; } }
From source file:com.futurologeek.smartcrossing.crop.CropImageActivity.java
@TargetApi(Build.VERSION_CODES.KITKAT) private void setupWindowFlags() { requestWindowFeature(Window.FEATURE_NO_TITLE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); }/*from w w w. j a v a2 s . co m*/ }
From source file:com.safecell.HomeScreenActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { // android:background="@drawable/stop_button" // TODO Auto-generated method stub super.onCreate(savedInstanceState); Log.v(TAG, "on create"); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setWindowAnimations(R.anim.null_animation); contextHomeScreenActivity = HomeScreenActivity.this; mManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); profilesRepository = new ProfilesRepository(contextHomeScreenActivity); isgameplay = this.GamplayOnOff(); if (!InformatonUtils.isServiceRunning(this)) { startService();/*w w w.ja va 2s. co m*/ } // ServiceHandler.getInstance(this).bindService(); this.initUI(); Log.v(TAG, "Emergencies.Inbound_Details Size:" + Emergencies.Inbound_Details.size()); // Request for Emergency numbers new EmergencyHandler(contextHomeScreenActivity, profilesRepository.getId()).execute(); IsTripPaused(); IsTripSaved(); Log.d(TAG, "Setings = " + getSharedPreferences("SETTINGS", MODE_WORLD_READABLE).getBoolean("isDisabled", false)); sharedPreferences = getSharedPreferences("TRIP", MODE_WORLD_READABLE); this.recentTripLog(); deleteFile(WayPointStore.WAY_POINT_FILE); deleteFile(InterruptionStore.INTERRUPTION_POINT_FILE); // setListAdapter(new recentTripAdapater(HomeScreenActivity.this)); if (isAppTermited()) { deleteLastTempTrip(); Intent mIntent = new Intent(HomeScreenActivity.this, TrackingScreenActivity.class); mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Log.v("HomeScreenActivity", "AppTerminated"); startActivity(mIntent); finish(); // clearTrackingScreenPref(); } /* * if(!isAppTermited()) { Log.v("SafeCell: Temp data", * "Delete Last Data"); deleteLastTempTrip(); } */ }