List of usage examples for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT
int SCREEN_ORIENTATION_PORTRAIT
To view the source code for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT.
Click Source Link
portrait
in the android.R.attr#screenOrientation attribute. From source file:io.github.silencio_app.silencio.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar);//from www.jav a 2s . c om DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState(); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setNavigationItemSelectedListener(this); amplitude = (TextView) findViewById(R.id.amp); play_pause_button = (Button) findViewById(R.id.play_pause_button); loud_image = (ImageView) findViewById(R.id.loud_image); current_location = (TextView) findViewById(R.id.current_location); location_name = (TextView) findViewById(R.id.location_name); Typeface custom_font = Typeface.createFromAsset(getAssets(), "fonts/Somatic-Rounded.otf"); amplitude.setTypeface(custom_font); /** * Initialising the empty graph */ GraphView graph = (GraphView) findViewById(R.id.graph); series = new LineGraphSeries<>(); graph.addSeries(series); Viewport viewport = graph.getViewport(); viewport.setYAxisBoundsManual(true); viewport.setMinY(0); // min value is 0 viewport.setMaxY(100); // max value is 32768 viewport.setMaxX(100); // 10 units frame viewport.setScalable(true); // auto scroll to right GridLabelRenderer gridLabel = graph.getGridLabelRenderer(); gridLabel.setHorizontalAxisTitle("Partition Intervals"); gridLabel.setVerticalAxisTitle("db Levels"); recordQueue = new LinkedList<NoiseRecord>(); dateFormat = new SimpleDateFormat(DATETIME_FORMAT); Thread newT2 = new Thread(new IPMapper()); // New Thread is created to handle the amplitude fetching and plotting graph newT2.start(); CURRENT_LOGGED_USER = getIntent().getExtras().getString("LOGGING USER"); SharedPreferences settings = getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE); SharedPreferences.Editor editor = settings.edit(); editor.putString(PREFS_CURRENT_USER, CURRENT_LOGGED_USER); editor.commit(); }
From source file:edu.pdx.cecs.orcycle.TabsConfig.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try {/*from w ww . j a v a 2 s.c om*/ myApp = MyApplication.getInstance(); myApp.setRunning(true); myApp.clearReminderNotifications(); setContentView(R.layout.tabs_config); Log.v(MODULE_TAG, "Cycle: TabsConfig onCreate"); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // Toast.makeText(this, "Tab Created", Toast.LENGTH_LONG).show(); fragment1 = new FragmentMainInput(); fragment2 = new FragmentSavedTripsSection(); fragment3 = new FragmentSavedNotesSection(); //fragment4 = new FragmentUserInfo(); fragment4 = new FragmentSettings(); // Set up the action bar. final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar.setBackgroundDrawable(getResources().getDrawable(R.color.psu_green)); // Create the adapter that will return a fragment for each of the four // primary sections of the app. mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mSectionsPagerAdapter); // When swiping between different sections, select the corresponding // tab. We can also use ActionBar.Tab#select() to do this if we have // a reference to the Tab. mViewPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { actionBar.setSelectedNavigationItem(position); } }); // For each of the sections in the app, add a tab to the action bar. for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) { // Create a tab with text corresponding to the page title defined by // the adapter. Also specify this Activity object, which implements // the TabListener interface, as the callback (listener) for when // this tab is selected. actionBar.addTab( actionBar.newTab().setText(mSectionsPagerAdapter.getPageTitle(i)).setTabListener(this)); } mViewPager.setOffscreenPageLimit(4); Intent intent; Bundle bundle; if (null != (intent = getIntent())) { if (null != (bundle = intent.getExtras())) { fragmentToShow = bundle.getInt(TabsConfig.EXTRA_SHOW_FRAGMENT, FRAG_INDEX_MAIN_INPUT); } } } catch (Exception ex) { Log.e(MODULE_TAG, ex.getMessage()); } }
From source file:com.parse.ui.login.ParseLoginActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Disable landscape this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); this.requestWindowFeature(Window.FEATURE_NO_TITLE); // Combine options from incoming intent and the activity metadata configOptions = getMergedOptions();/*www . ja va 2s.c o m*/ // Show the login form if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .add(fragmentContainer, ParseLoginFragment.newInstance(configOptions)).commit(); } }
From source file:com.guayaba.tapir.ui.activities.ProfileActivity.java
/** * {@inheritDoc}/*from w w w .j av a 2 s .com*/ */ @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Temporay until I can work out a nice landscape layout setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // Get the preferences mPreferences = PreferenceUtils.getInstance(this); // Initialze the image fetcher mImageFetcher = ApolloUtils.getImageFetcher(this); // Initialize the Bundle mArguments = savedInstanceState != null ? savedInstanceState : getIntent().getExtras(); // Get the MIME type mType = mArguments.getString(Config.MIME_TYPE); // Get the profile title mProfileName = mArguments.getString(Config.NAME); // Get the artist name if (isArtist() || isAlbum()) { mArtistName = mArguments.getString(Config.ARTIST_NAME); } // Initialize the pager adapter mPagerAdapter = new PagerAdapter(this); // Initialze the carousel mTabCarousel = (ProfileTabCarousel) findViewById(R.id.acivity_profile_base_tab_carousel); mTabCarousel.reset(); mTabCarousel.getPhoto().setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { ProfileType profileType; if (isArtist()) { profileType = ProfileType.ARTIST; } else if (isAlbum()) { profileType = ProfileType.ALBUM; } else { profileType = ProfileType.OTHER; } PhotoSelectionDialog.newInstance(isArtist() ? mArtistName : mProfileName, profileType) .show(getSupportFragmentManager(), "PhotoSelectionDialog"); } }); // Set up the action bar final ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); /* Set up the artist profile */ if (isArtist()) { // Add the carousel images mTabCarousel.setArtistProfileHeader(this, mArtistName); // Artist profile fragments mPagerAdapter.add(ArtistSongFragment.class, mArguments); mPagerAdapter.add(ArtistAlbumFragment.class, mArguments); // Action bar title mResources.setTitle(mArtistName); } else // Set up the album profile if (isAlbum()) { // Add the carousel images mTabCarousel.setAlbumProfileHeader(this, mProfileName, mArtistName); // Album profile fragments mPagerAdapter.add(AlbumSongFragment.class, mArguments); // Action bar title = album name mResources.setTitle(mProfileName); // Action bar subtitle = year released mResources.setSubtitle(mArguments.getString(Config.ALBUM_YEAR)); } else // Set up the favorites profile if (isFavorites()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Favorite fragment mPagerAdapter.add(FavoriteFragment.class, null); // Action bar title = Favorites mResources.setTitle(mProfileName); } else // Set up the last added profile if (isLastAdded()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Last added fragment mPagerAdapter.add(LastAddedFragment.class, null); // Action bar title = Last added mResources.setTitle(mProfileName); } else // Set up the user playlist profile if (isPlaylist()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Playlist profile fragments mPagerAdapter.add(PlaylistSongFragment.class, mArguments); // Action bar title = playlist name mResources.setTitle(mProfileName); } else // Set up the genre profile if (isGenre()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Genre profile fragments mPagerAdapter.add(GenreSongFragment.class, mArguments); // Action bar title = playlist name mResources.setTitle(mProfileName); } // Initialize the ViewPager mViewPager = (ViewPager) findViewById(R.id.acivity_profile_base_pager); // Attch the adapter mViewPager.setAdapter(mPagerAdapter); // Offscreen limit mViewPager.setOffscreenPageLimit(mPagerAdapter.getCount() - 1); // Attach the page change listener mViewPager.setOnPageChangeListener(this); // Attach the carousel listener mTabCarousel.setListener(this); }
From source file:com.boko.vimusic.ui.activities.ProfileActivity.java
/** * {@inheritDoc}/*from w w w .j a v a 2s . c om*/ */ @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Temporay until I can work out a nice landscape layout setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // Get the preferences mPreferences = PreferenceUtils.getInstance(this); // Initialze the image fetcher mImageFetcher = CommonUtils.getImageFetcher(this); // Initialize the Bundle mArguments = savedInstanceState != null ? savedInstanceState : getIntent().getExtras(); // Get the MIME type mType = mArguments.getString(Config.MIME_TYPE); // Get the profile title mProfileName = mArguments.getString(Config.NAME); // Get the artist name if (isArtist() || isAlbum()) { mArtistName = mArguments.getString(Config.ARTIST_NAME); } // Initialize the pager adapter mPagerAdapter = new PagerAdapter(this); // Initialze the carousel mTabCarousel = (ProfileTabCarousel) findViewById(R.id.acivity_profile_base_tab_carousel); mTabCarousel.reset(); mTabCarousel.getPhoto().setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { ProfileType profileType; if (isArtist()) { profileType = ProfileType.ARTIST; } else if (isAlbum()) { profileType = ProfileType.ALBUM; } else { profileType = ProfileType.OTHER; } PhotoSelectionDialog.newInstance(isArtist() ? mArtistName : mProfileName, profileType) .show(getSupportFragmentManager(), "PhotoSelectionDialog"); } }); // Set up the action bar final ActionBar actionBar = getActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); /* Set up the artist profile */ if (isArtist()) { // Add the carousel images mTabCarousel.setArtistProfileHeader(this, mArtistName); // Artist profile fragments mPagerAdapter.add(ArtistSongFragment.class, mArguments); mPagerAdapter.add(ArtistAlbumFragment.class, mArguments); // Action bar title mResources.setTitle(mArtistName); } else // Set up the album profile if (isAlbum()) { // Add the carousel images mTabCarousel.setAlbumProfileHeader(this, mProfileName, mArtistName); // Album profile fragments mPagerAdapter.add(AlbumSongFragment.class, mArguments); // Action bar title = album name mResources.setTitle(mProfileName); // Action bar subtitle = year released mResources.setSubtitle(mArguments.getString(Config.ALBUM_YEAR)); } else // Set up the favorites profile if (isFavorites()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Favorite fragment mPagerAdapter.add(FavoriteFragment.class, null); // Action bar title = Favorites mResources.setTitle(mProfileName); } else // Set up the last added profile if (isLastAdded()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Last added fragment mPagerAdapter.add(LastAddedFragment.class, null); // Action bar title = Last added mResources.setTitle(mProfileName); } else // Set up the user playlist profile if (isPlaylist()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Playlist profile fragments mPagerAdapter.add(PlaylistSongFragment.class, mArguments); // Action bar title = playlist name mResources.setTitle(mProfileName); } else // Set up the genre profile if (isGenre()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Genre profile fragments mPagerAdapter.add(GenreSongFragment.class, mArguments); // Action bar title = playlist name mResources.setTitle(mProfileName); } // Initialize the ViewPager mViewPager = (ViewPager) findViewById(R.id.acivity_profile_base_pager); // Attch the adapter mViewPager.setAdapter(mPagerAdapter); // Offscreen limit mViewPager.setOffscreenPageLimit(mPagerAdapter.getCount() - 1); // Attach the page change listener mViewPager.setOnPageChangeListener(this); // Attach the carousel listener mTabCarousel.setListener(this); }
From source file:com.bringcommunications.etherpay.ScanActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); context = this; overlay_frame_layout = new FrameLayout(getApplicationContext()); setContentView(overlay_frame_layout); View activity_scan_view = getLayoutInflater().inflate(R.layout.activity_scan, overlay_frame_layout, false); setContentView(activity_scan_view);/*from w w w. j a v a 2 s . c om*/ Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); //The internal implementation of the support library just checks if the Toolbar has a title (not null) at the moment the SupportActionBar is //set up. If there is, then this title will be used instead of the window title. You can then set a dummy title while you load the real title. toolbar.setTitle(""); toolbar.setBackgroundResource(R.color.color_toolbar); setSupportActionBar(toolbar); // setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); target_activity = getIntent().getStringExtra("TARGET_ACTIVITY"); String scan_prompt = getIntent().getStringExtra("SCAN_PROMPT"); autoFocusHandler = new Handler(); //Instance barcode scanner scanner = new ImageScanner(); scanner.setConfig(0, Config.X_DENSITY, 3); scanner.setConfig(0, Config.Y_DENSITY, 3); // int subtitle_R = target_activity.equals("SendActivity") ? R.string.scan_subtitle_send : R.string.scan_subtitle_import; String subtitle = getResources().getString(subtitle_R); String app_name = getResources().getString(R.string.app_name); toolbar.setTitle(app_name); toolbar.setSubtitle(subtitle); instructions_view = (TextView) findViewById(R.id.instructions); instructions_view.setText(scan_prompt); barcodeScanned = false; }
From source file:com.orangelabs.rcs.ri.messaging.chat.single.SingleChatList.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /* Set layout */ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.chat_list);/*from w ww . j av a 2 s .c o m*/ mChatService = getChatApi(); mListView = (ListView) findViewById(android.R.id.list); TextView emptyView = (TextView) findViewById(android.R.id.empty); mListView.setEmptyView(emptyView); registerForContextMenu(mListView); mAdapter = new ChatListAdapter(this); mListView.setAdapter(mAdapter); /* * Initialize the Loader with id '1' and callbacks 'mCallbacks'. */ getSupportLoaderManager().initLoader(LOADER_ID, null, this); }
From source file:de.uulm.graphicalpasswords.openmiba.MIBACreatePasswordActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // requestWindowFeature(Window.FEATURE_NO_TITLE); // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_miba_create_password); SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); rounds_to_do = Integer.parseInt(sharedPref.getString("miba_length", "1")); min_rounds = rounds_to_do; Bundle bundle = new Bundle(); bundle.putInt("length", rounds_to_do); DialogFragment intro = new IntroDialogFragment(); intro.setArguments(bundle);// www .j ava2 s . c o m intro.show(getFragmentManager(), "intro"); // Show the Up button in the action bar. setupActionBar(); setViews(); seenPictureIds.add(R.drawable.ccp000); }
From source file:com.andrew.apollo.ui.activities.ProfileActivity.java
/** * {@inheritDoc}//from w ww . j av a 2 s. c om */ @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Temporay until I can work out a nice landscape layout setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // Get the preferences mPreferences = PreferenceUtils.getInstace(this); // Initialze the image fetcher mImageFetcher = ApolloUtils.getImageFetcher(this); // Initialize the Bundle mArguments = savedInstanceState != null ? savedInstanceState : getIntent().getExtras(); // Get the MIME type mType = mArguments.getString(Config.MIME_TYPE); // Get the profile title mProfileName = mArguments.getString(Config.NAME); // Get the artist name if (isArtist() || isAlbum()) { mArtistName = mArguments.getString(Config.ARTIST_NAME); } // Initialize the pager adapter mPagerAdapter = new PagerAdapter(this); // Initialze the carousel mTabCarousel = (ProfileTabCarousel) findViewById(R.id.acivity_profile_base_tab_carousel); mTabCarousel.reset(); mTabCarousel.getPhoto().setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { ProfileType profileType; if (isArtist()) { profileType = ProfileType.ARTIST; } else if (isAlbum()) { profileType = ProfileType.ALBUM; } else { profileType = ProfileType.OTHER; } PhotoSelectionDialog.newInstance(isArtist() ? mArtistName : mProfileName, profileType) .show(getSupportFragmentManager(), "PhotoSelectionDialog"); } }); // Set up the action bar final ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); /* Set up the artist profile */ if (isArtist()) { // Add the carousel images mTabCarousel.setArtistProfileHeader(this, mArtistName); // Artist profile fragments mPagerAdapter.add(ArtistSongFragment.class, mArguments); mPagerAdapter.add(ArtistAlbumFragment.class, mArguments); // Action bar title mResources.setTitle(mArtistName); } else // Set up the album profile if (isAlbum()) { // Add the carousel images mTabCarousel.setAlbumProfileHeader(this, mProfileName, mArtistName); // Album profile fragments mPagerAdapter.add(AlbumSongFragment.class, mArguments); // Action bar title = album name mResources.setTitle(mProfileName); // Action bar subtitle = year released mResources.setSubtitle(mArguments.getString(Config.ALBUM_YEAR)); } else // Set up the favorites profile if (isFavorites()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Favorite fragment mPagerAdapter.add(FavoriteFragment.class, null); // Action bar title = Favorites mResources.setTitle(mProfileName); } else // Set up the last added profile if (isLastAdded()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Last added fragment mPagerAdapter.add(LastAddedFragment.class, null); // Action bar title = Last added mResources.setTitle(mProfileName); } else // Set up the user playlist profile if (isPlaylist()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Playlist profile fragments mPagerAdapter.add(PlaylistSongFragment.class, mArguments); // Action bar title = playlist name mResources.setTitle(mProfileName); } else // Set up the genre profile if (isGenre()) { // Add the carousel images mTabCarousel.setPlaylistOrGenreProfileHeader(this, mProfileName); // Genre profile fragments mPagerAdapter.add(GenreSongFragment.class, mArguments); // Action bar title = playlist name mResources.setTitle(mProfileName); } // Initialize the ViewPager mViewPager = (ViewPager) findViewById(R.id.acivity_profile_base_pager); // Attch the adapter mViewPager.setAdapter(mPagerAdapter); // Offscreen limit mViewPager.setOffscreenPageLimit(mPagerAdapter.getCount() - 1); // Attach the page change listener mViewPager.setOnPageChangeListener(this); // Attach the carousel listener mTabCarousel.setListener(this); }
From source file:com.dm.wallpaper.board.fragments.dialogs.WallpaperSettingsFragment.java
@Override public void onDismiss(DialogInterface dialog) { if (Preferences.get(getActivity()).isWallpaperCrop()) { getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } else {/*from w w w. j ava 2s. c o m*/ getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED); } super.onDismiss(dialog); }