List of usage examples for android.support.v4.view GravityCompat END
int END
To view the source code for android.support.v4.view GravityCompat END.
Click Source Link
From source file:org.gateshipone.odyssey.activities.OdysseyMainActivity.java
@Override public void onPlaylistSelected(String playlistTitle, long playlistID) { // Create fragment and give it an argument for the selected playlist PlaylistTracksFragment newFragment = new PlaylistTracksFragment(); Bundle args = new Bundle(); args.putString(PlaylistTracksFragment.ARG_PLAYLISTTITLE, playlistTitle); args.putLong(PlaylistTracksFragment.ARG_PLAYLISTID, playlistID); newFragment.setArguments(args);/*w w w . j a v a2 s . c om*/ android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); // Replace whatever is in the fragment_container view with this // fragment, // and add the transaction to the back stack so the user can navigate // back transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack("PlaylistTracksFragment"); // Commit the transaction transaction.commit(); }
From source file:org.gateshipone.malp.application.activities.MainActivity.java
@Override public void showAlbumsForPath(String path) { if (mNowPlayingDragStatus == DRAG_STATUS.DRAGGED_UP) { NowPlayingView nowPlayingView = (NowPlayingView) findViewById(R.id.now_playing_layout); if (nowPlayingView != null) { View coordinatorLayout = findViewById(R.id.main_coordinator_layout); coordinatorLayout.setVisibility(View.VISIBLE); nowPlayingView.minimize();//from w ww. j a v a2s . co m } } // Create fragment and give it an argument for the selected article AlbumsFragment newFragment = new AlbumsFragment(); Bundle args = new Bundle(); args.putString(AlbumsFragment.BUNDLE_STRING_EXTRA_PATH, path); newFragment.setArguments(args); android.support.v4.app.FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); // Replace whatever is in the fragment_container view with this // fragment, // and add the transaction to the back stack so the user can navigate // back transaction.replace(R.id.fragment_container, newFragment, AlbumsFragment.TAG); transaction.addToBackStack("DirectoryAlbumsFragment"); NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view); navigationView.setCheckedItem(R.id.nav_library); // Commit the transaction transaction.commit(); }
From source file:org.gateshipone.malp.application.activities.MainActivity.java
@Override public void openArtworkSettings() { // Create fragment and give it an argument for the selected directory ArtworkSettingsFragment newFragment = new ArtworkSettingsFragment(); FragmentManager fragmentManager = getSupportFragmentManager(); android.support.v4.app.FragmentTransaction transaction = fragmentManager.beginTransaction(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); transaction.addToBackStack("ArtworkSettingsFragment"); transaction.replace(R.id.fragment_container, newFragment); // Commit the transaction transaction.commit();//from w ww . j a va 2s. c o m }
From source file:org.kiwix.kiwixmobile.KiwixMobileActivity.java
private void initAllMenuItems() { try {//from w w w. j a v a2s. c om menu.findItem(R.id.menu_bookmarks).setVisible(true); menu.findItem(R.id.menu_fullscreen).setVisible(true); menu.findItem(R.id.menu_home).setVisible(true); menu.findItem(R.id.menu_randomarticle).setVisible(true); menu.findItem(R.id.menu_searchintext).setVisible(true); MenuItem searchItem = menu.findItem(R.id.menu_search); searchItem.setVisible(true); final String zimFile = ZimContentProvider.getZimFile(); searchItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { Intent i = new Intent(KiwixMobileActivity.this, SearchActivity.class); i.putExtra("zimFile", zimFile); startActivityForResult(i, REQUEST_FILE_SEARCH); overridePendingTransition(0, 0); return true; } }); toolbar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(KiwixMobileActivity.this, SearchActivity.class); i.putExtra("zimFile", zimFile); startActivityForResult(i, REQUEST_FILE_SEARCH); overridePendingTransition(0, 0); } }); toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (drawerLayout.isDrawerOpen(GravityCompat.END)) { drawerLayout.closeDrawer(GravityCompat.END); } else if (drawerLayout.isDrawerOpen(GravityCompat.START)) { drawerLayout.closeDrawer(GravityCompat.START); } else { drawerLayout.openDrawer(GravityCompat.START); } } }); new Handler().post(new Runnable() { @Override public void run() { ActionMenuItemView m = (ActionMenuItemView) findViewById(R.id.menu_bookmarks); if (m == null) { return; } findViewById(R.id.menu_bookmarks).setOnLongClickListener(view -> { goToBookmarks(); return false; }); } }); if (tts.isInitialized()) { menu.findItem(R.id.menu_read_aloud).setVisible(true); if (isSpeaking) { menu.findItem(R.id.menu_read_aloud) .setTitle(createMenuItem(getResources().getString(R.string.menu_read_aloud_stop))); } } } catch (Exception e) { e.printStackTrace(); } }
From source file:org.gateshipone.odyssey.activities.OdysseyMainActivity.java
@Override public void openArtworkSettings() { // Create fragment and give it an argument for the selected directory ArtworkSettingsFragment newFragment = new ArtworkSettingsFragment(); FragmentManager fragmentManager = getSupportFragmentManager(); android.support.v4.app.FragmentTransaction transaction = fragmentManager.beginTransaction(); // set enter / exit animation newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, getResources().getConfiguration().getLayoutDirection()))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, getResources().getConfiguration().getLayoutDirection()))); transaction.addToBackStack("ArtworkSettingsFragment"); transaction.replace(R.id.fragment_container, newFragment); // Commit the transaction transaction.commit();//w ww .j a v a 2 s . c o m }
From source file:lewa.support.v7.widget.Toolbar.java
private void ensureMenuView() { if (mMenuView == null) { mMenuView = new ActionMenuView(getContext()); mMenuView.setPopupTheme(mPopupTheme); mMenuView.setOnMenuItemClickListener(mMenuViewItemClickListener); mMenuView.setMenuCallbacks(mActionMenuPresenterCallback, mMenuBuilderCallback); final LayoutParams lp = generateDefaultLayoutParams(); lp.gravity = GravityCompat.END | (mButtonGravity & Gravity.VERTICAL_GRAVITY_MASK); mMenuView.setLayoutParams(lp);/*from ww w .ja v a 2 s.c o m*/ addSystemView(mMenuView); ((LewaActionBarContainer) mSplitView).getActionMenuBar().addView(mMenuView, lp); } }
From source file:android.support.design.widget.CoordinatorLayout.java
/** * Return the given gravity value or the default if the passed value is NO_GRAVITY. * This should be used for children that are positioned relative to a keyline. *//*from w w w .j a v a 2s .co m*/ private static int resolveKeylineGravity(int gravity) { return gravity == Gravity.NO_GRAVITY ? GravityCompat.END | Gravity.TOP : gravity; }
From source file:org.kiwix.kiwixmobile.KiwixMobileActivity.java
private void contentsDrawerHint() { drawerLayout.postDelayed(() -> drawerLayout.openDrawer(GravityCompat.END), 500); AlertDialog.Builder builder = new AlertDialog.Builder(this, dialogStyle()); builder.setMessage(getString(R.string.hint_contents_drawer_message)) .setPositiveButton(getString(R.string.got_it), (dialog, id) -> { }).setTitle(getString(R.string.did_you_know)).setIcon(R.drawable.icon_question); AlertDialog alert = builder.create(); alert.show();/*from ww w .j av a 2s . c om*/ }
From source file:maximsblog.blogspot.com.formuladict.DrawerLayout.java
@Override protected void onRestoreInstanceState(Parcelable state) { final SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); if (ss.openDrawerGravity != Gravity.NO_GRAVITY) { final View toOpen = findDrawerWithGravity(ss.openDrawerGravity); if (toOpen != null) { openDrawer(toOpen);/*from w w w . j av a 2 s . c o m*/ } } if (ss.lockModeLeft != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeLeft, Gravity.LEFT); } if (ss.lockModeRight != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeRight, Gravity.RIGHT); } if (ss.lockModeStart != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeStart, GravityCompat.START); } if (ss.lockModeEnd != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeEnd, GravityCompat.END); } }
From source file:com.huangj.huangjlibrary.widget.drawerlayout.DrawerLayout.java
@Override protected void onRestoreInstanceState(Parcelable state) { if (!(state instanceof SavedState)) { super.onRestoreInstanceState(state); return;/*from w w w . ja va 2 s . c o m*/ } final SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); if (ss.openDrawerGravity != Gravity.NO_GRAVITY) { final View toOpen = findDrawerWithGravity(ss.openDrawerGravity); if (toOpen != null) { openDrawer(toOpen); } } if (ss.lockModeLeft != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeLeft, Gravity.LEFT); } if (ss.lockModeRight != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeRight, Gravity.RIGHT); } if (ss.lockModeStart != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeStart, GravityCompat.START); } if (ss.lockModeEnd != LOCK_MODE_UNDEFINED) { setDrawerLockMode(ss.lockModeEnd, GravityCompat.END); } }