Tabnine Logo
GravityCompat
Code IndexAdd Tabnine to your IDE (free)

How to use
GravityCompat
in
androidx.core.view

Best Java code snippets using androidx.core.view.GravityCompat (Showing top 14 results out of 315)

origin: ZieIony/Carbon

  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;
origin: ZieIony/Carbon

final int w = r.mWidth < 0 ? d.getIntrinsicWidth() : r.mWidth;
final int h = r.mHeight < 0 ? d.getIntrinsicHeight() : r.mHeight;
GravityCompat.apply(gravity, w, h, container, outRect, layoutDirection);
d.setBounds(outRect);
origin: ZieIony/Carbon

  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;
origin: ZieIony/Carbon

  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;
origin: ZieIony/Carbon

  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;
origin: ZieIony/Carbon

  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;
origin: ZieIony/Carbon

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);
  }
}
origin: nickbutcher/plaid

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) {
origin: luhaoaimama1/zone-sdk

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;
}
origin: gateship-one/odyssey

@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();
}
origin: gateship-one/odyssey

@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();
}
origin: gateship-one/odyssey

@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();
}
origin: gateship-one/odyssey

@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();
}
origin: AlexMofer/ProjectX

final int contentHeight = height - paddingTop - paddingBottom;
mItemCenterOffset = itemWidth + padding;
switch (GravityCompat.getAbsoluteGravity(mGravity,
    ViewCompat.getLayoutDirection(this))) {
  case Gravity.LEFT:
androidx.core.viewGravityCompat

Most used methods

  • getAbsoluteGravity
  • apply

Popular in Java

  • Running tasks concurrently on multiple threads
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now