Example usage for android.view Gravity BOTTOM

List of usage examples for android.view Gravity BOTTOM

Introduction

In this page you can find the example usage for android.view Gravity BOTTOM.

Prototype

int BOTTOM

To view the source code for android.view Gravity BOTTOM.

Click Source Link

Document

Push object to the bottom of its container, not changing its size.

Usage

From source file:com.github.topbottomsnackbar.TBSnackbar.java

/**
 * Show the {@link TBSnackbar}.//from   w w  w.j a  va  2s .  c  o  m
 */
public void show() {
    if (mStyle == STYLE_SHOW_BOTTOM) {
        changeLayoutParams(Gravity.BOTTOM);

    } else {
        changeLayoutParams(Gravity.TOP);
        if (mStyle == STYLE_SHOW_TOP_FITSYSTEMWINDOW) {
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
                mView.setPadding(0, getStatusBarHeight(mContext), 0, 0);
        }
    }
    TBSnackbarManager.getInstance().show(mDuration, mManagerCallback);
}

From source file:com.ruesga.rview.wizard.WizardActivity.java

private void performShowPageOptionsMenu(View view) {
    if (mCurrentPageFragment != null && mCurrentPageFragment.getPageOptionsMenu() > 0) {
        PopupMenu popup = new PopupMenu(this, view, Gravity.BOTTOM);
        popup.inflate(mCurrentPageFragment.getPageOptionsMenu());
        popup.setOnMenuItemClickListener(mCurrentPageFragment.getPageOptionsMenuOnItemClickListener());
        popup.show();//  w w  w . ja  v  a 2s . c  o m
    }
}

From source file:com.scoreflex.ScoreflexView.java

protected int getLayoutGravity() {
    ViewGroup.LayoutParams currentLayoutParams = getLayoutParams();
    int gravity = Scoreflex.getDefaultGravity() & Gravity.VERTICAL_GRAVITY_MASK;
    if (currentLayoutParams instanceof FrameLayout.LayoutParams) {
        FrameLayout.LayoutParams frameLayoutParams = (FrameLayout.LayoutParams) currentLayoutParams;
        gravity = (Gravity.TOP == (frameLayoutParams.gravity & Gravity.VERTICAL_GRAVITY_MASK)) ? Gravity.TOP
                : Gravity.BOTTOM;
    }/*from   w  ww  . j  ava2 s.  c o m*/
    return gravity;
}

From source file:com.aidy.bottomdrawerlayout.BottomDrawerLayout.java

void moveDrawerToOffset(View drawerView, float slideOffset) {
    Log.i(TAG, "moveDrawerToOffset()");
    final float oldOffset = getDrawerViewOffset(drawerView);
    final int height = drawerView.getHeight();
    final int oldPos = (int) (height * oldOffset);
    final int newPos = (int) (height * slideOffset);
    final int dy = newPos - oldPos;

    drawerView.offsetTopAndBottom(checkDrawerViewAbsoluteGravity(drawerView, Gravity.BOTTOM) ? -dy : dy);
    setDrawerViewOffset(drawerView, slideOffset);
}

From source file:com.alburivan.slickform.tooltip.SimpleTooltip.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void startAnimation() {
    final String property = mGravity == Gravity.TOP || mGravity == Gravity.BOTTOM ? "translationY"
            : "translationX";

    final ObjectAnimator anim1 = ObjectAnimator.ofFloat(mContentLayout, property, -mAnimationPadding,
            mAnimationPadding);/* w  ww . java 2  s. co m*/
    anim1.setDuration(mAnimationDuration);
    anim1.setInterpolator(new AccelerateDecelerateInterpolator());

    final ObjectAnimator anim2 = ObjectAnimator.ofFloat(mContentLayout, property, mAnimationPadding,
            -mAnimationPadding);
    anim2.setDuration(mAnimationDuration);
    anim2.setInterpolator(new AccelerateDecelerateInterpolator());

    mAnimator = new AnimatorSet();
    mAnimator.playSequentially(anim1, anim2);
    mAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            if (!dismissed && isShowing()) {
                animation.start();
            }
        }
    });
    mAnimator.start();
}

From source file:com.example.verticaldrawerlayout.VerticalDrawerLayout.java

/**
 * Sets the title of the drawer with the given gravity.
 * <p>//from   w ww.ja v  a 2 s  .  com
 * When accessibility is turned on, this is the title that will be used to
 * identify the drawer to the active accessibility service.
 * 
 * @param edgeGravity
 *            Gravity.LEFT, RIGHT, START or END. Expresses which
 *            drawer to set the title for.
 * @param title
 *            The title for the drawer.
 */
public void setDrawerTitle(int edgeGravity, CharSequence title) {
    final int absGravity = GravityCompat.getAbsoluteGravity(edgeGravity, ViewCompat.getLayoutDirection(this));
    if (absGravity == Gravity.TOP) {
        mTitleTop = title;
    } else if (absGravity == Gravity.BOTTOM) {
        mTitleBottom = title;
    }
}

From source file:com.google.blockly.android.ToolboxFragment.java

/**
 * @return Computed {@link Rotation} constant for {@link #mRotateTabs} and {@link #mTabEdge}.
 *//*from w ww .j a  v  a2 s .  co  m*/
@Rotation.Enum
private int getLabelRotation() {
    if (!mRotateTabs) {
        return Rotation.NONE;
    }
    switch (mTabEdge) {
    case Gravity.LEFT:
        return Rotation.COUNTER_CLOCKWISE;
    case Gravity.RIGHT:
        return Rotation.CLOCKWISE;
    case Gravity.TOP:
        return Rotation.NONE;
    case Gravity.BOTTOM:
        return Rotation.NONE;
    case GravityCompat.START:
        return Rotation.ADAPTIVE_COUNTER_CLOCKWISE;
    case GravityCompat.END:
        return Rotation.ADAPTIVE_CLOCKWISE;
    default:
        throw new IllegalArgumentException("Invalid tabEdge: " + mTabEdge);
    }
}

From source file:com.aidy.bottomdrawerlayout.AllDrawerLayout.java

/**
 * Check the lock mode of the drawer with the given gravity.
 * /*w w w.  ja  va2s  .co m*/
 * @param edgeGravity
 *            Gravity of the drawer to check
 * @return one of {@link #LOCK_MODE_UNLOCKED},
 *         {@link #LOCK_MODE_LOCKED_CLOSED} or
 *         {@link #LOCK_MODE_LOCKED_OPEN}.
 */
public int getDrawerLockMode(int edgeGravity) {
    final int absGravity = GravityCompat.getAbsoluteGravity(edgeGravity, ViewCompat.getLayoutDirection(this));
    switch (absGravity) {
    case Gravity.LEFT:
        return mLockModeLeft;
    case Gravity.RIGHT:
        return mLockModeRight;
    case Gravity.TOP:
        return mLockModeTop;
    case Gravity.BOTTOM:
        return mLockModeBottom;
    default:
        return LOCK_MODE_UNLOCKED;
    }
}

From source file:com.aidy.bottomdrawerlayout.BottomDrawerLayout.java

/**
 * Simple gravity to string - only supports LEFT and RIGHT for debugging
 * output.//from w  w w .ja v a  2  s  .  co m
 * 
 * @param gravity
 *            Absolute gravity value
 * @return LEFT or RIGHT as appropriate, or a hex string
 */
static String gravityToString(int gravity) {
    if ((gravity & Gravity.BOTTOM) == Gravity.BOTTOM) {
        return "BOTTOM";
    }
    return Integer.toHexString(gravity);
}

From source file:com.scoreflex.Scoreflex.java

/**
 * Changes the default gravity.//from w  ww.  j  a  va2s . c  om
 *
 * @param defaultGravity
 *            The new default gravity.
 */
public static void setDefaultGravity(int defaultGravity) {
    if (Gravity.TOP == (defaultGravity & Gravity.VERTICAL_GRAVITY_MASK))
        sDefaultGravity = Gravity.TOP;
    else
        sDefaultGravity = Gravity.BOTTOM;
}