bottom = top + lp.height; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.LEFT) == Gravity.LEFT) { left = anchorView.getLeft() - lp.width / 2; right = left + lp.width; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.RIGHT) == Gravity.RIGHT) { left = anchorView.getRight() - lp.width / 2; right = left + lp.width;
bottom = top + lp.height; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.LEFT) == Gravity.LEFT) { left = anchorView.getLeft() - lp.width / 2; right = left + lp.width; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.RIGHT) == Gravity.RIGHT) { left = anchorView.getRight() - lp.width / 2; right = left + lp.width;
bottom = top + lp.height; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.LEFT) == Gravity.LEFT) { left = anchorView.getLeft() - lp.width / 2; right = left + lp.width; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.RIGHT) == Gravity.RIGHT) { left = anchorView.getRight() - lp.width / 2; right = left + lp.width;
bottom = top + lp.height; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.LEFT) == Gravity.LEFT) { left = anchorView.getLeft() - lp.width / 2; right = left + lp.width; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.RIGHT) == Gravity.RIGHT) { left = anchorView.getRight() - lp.width / 2; right = left + lp.width;
bottom = top + lp.height; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.LEFT) == Gravity.LEFT) { left = anchorView.getLeft() - lp.width / 2; right = left + lp.width; if ((GravityCompat.getAbsoluteGravity(lp.anchorGravity, ViewCompat.getLayoutDirection(child)) & Gravity.RIGHT) == Gravity.RIGHT) { left = anchorView.getRight() - lp.width / 2; right = left + lp.width;
private int layoutFlowingViews(int width) { int gravity = GravityCompat.getAbsoluteGravity(this.gravity, ViewCompat.getLayoutDirection(this)); if ((gravity & Gravity.RIGHT) == Gravity.RIGHT) { return layoutFlowingViewsRight(width); } else { return layoutFlowingViewsLeft(width); } }
float width = mTextToDraw != null ? mTextPaint.measureText(mTextToDraw, 0, mTextToDraw.length()) : 0; final int collapsedAbsGravity = GravityCompat.getAbsoluteGravity(mCollapsedTextGravity, mIsRtl ? ViewCompat.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR); switch (collapsedAbsGravity & Gravity.VERTICAL_GRAVITY_MASK) { width = mTextToDraw != null ? mTextPaint.measureText(mTextToDraw, 0, mTextToDraw.length()) : 0; final int expandedAbsGravity = GravityCompat.getAbsoluteGravity(mExpandedTextGravity, mIsRtl ? ViewCompat.LAYOUT_DIRECTION_RTL : ViewCompat.LAYOUT_DIRECTION_LTR); switch (expandedAbsGravity & Gravity.VERTICAL_GRAVITY_MASK) {
boolean isDrawerView2(View child) { final int gravity = ((LayoutParams) child.getLayoutParams()).gravity; final int absGravity = GravityCompat.getAbsoluteGravity(gravity, ViewCompat.getLayoutDirection(child)); return (absGravity & (Gravity.LEFT | Gravity.RIGHT)) != 0; }
@Override public void openArtworkSettings() { // Create fragment and give it an argument for the selected directory ArtworkSettingsFragment newFragment = ArtworkSettingsFragment.newInstance(); FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction transaction = fragmentManager.beginTransaction(); // set enter / exit animation final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); transaction.addToBackStack("ArtworkSettingsFragment"); transaction.replace(R.id.fragment_container, newFragment); // Commit the transaction transaction.commit(); }
@Override public void onPlaylistSelected(String playlistTitle, long playlistID) { // Create fragment and give it an argument for the selected playlist PlaylistTracksFragment newFragment = PlaylistTracksFragment.newInstance(playlistTitle, playlistID); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); // 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(); }
@Override public void onPlaylistFileSelected(String name, String path) { // Create fragment and give it an argument for the selected playlist PlaylistTracksFragment newFragment = PlaylistTracksFragment.newInstance(name, path); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // set enter / exit animation final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); // 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(); }
@Override public void onDirectorySelected(String dirPath, boolean isRootDirectory) { // Create fragment and give it an argument for the selected directory FilesFragment newFragment = FilesFragment.newInstance(dirPath, isRootDirectory); FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction transaction = fragmentManager.beginTransaction(); if (!isRootDirectory) { // no root directory so set a enter / exit transition final int layoutDirection = getResources().getConfiguration().getLayoutDirection(); newFragment.setEnterTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.START, layoutDirection))); newFragment.setExitTransition(new Slide(GravityCompat.getAbsoluteGravity(GravityCompat.END, layoutDirection))); } transaction.replace(R.id.fragment_container, newFragment); if (!isRootDirectory) { // add fragment only to the backstack if it's not a root directory transaction.addToBackStack("FilesFragment"); } // Commit the transaction transaction.commit(); }
final int contentHeight = height - paddingTop - paddingBottom; mItemCenterOffset = itemWidth + padding; switch (GravityCompat.getAbsoluteGravity(mGravity, ViewCompat.getLayoutDirection(this))) { case Gravity.LEFT: