Example usage for android.support.v4.view ViewPager getHeight

List of usage examples for android.support.v4.view ViewPager getHeight

Introduction

In this page you can find the example usage for android.support.v4.view ViewPager getHeight.

Prototype

@ViewDebug.ExportedProperty(category = "layout")
public final int getHeight() 

Source Link

Document

Return the height of your view.

Usage

From source file:com.ylw.split.splitview.view.SplitView3.java

private void changeLayout() {
    int w = getWidth();
    int h = getHeight();
    vTop.layout(0, vHead.getBottom(), w, vCenter.getTop());
    vBottom.layout(0, vCenter.getBottom(), w, h);
    int cc = vBottom.getChildCount();

    ViewPager vp = vBottom;
    //        int bw = vp.getWidth();
    int bh = vp.getHeight();

    for (int i = 0; i < cc; i++) {
        View v = vp.getChildAt(i);
        v.layout(v.getLeft(), 0, v.getRight(), bh);
    }//from  w  w  w .j av a  2  s  . c  o  m
}

From source file:com.ylw.split.splitview.view.SplitView3.java

private void changeLayout_vBottom() {
    int w = getWidth();
    int h = getHeight();

    int bt = vBottom.getTop();
    vBottom.layout(0, bt, w, h);/*from w  w w  .  ja  v a  2s.c om*/
    vTop.layout(0, vHead.getBottom(), w, bt - vCenter.getHeight());
    vCenter.layout(0, bt - vCenter.getHeight(), w, bt);
    int cc = vBottom.getChildCount();

    ViewPager vp = vBottom;
    //        int bw = vp.getWidth();
    int bh = vp.getHeight();

    for (int i = 0; i < cc; i++) {
        View v = vp.getChildAt(i);
        v.layout(v.getLeft(), 0, v.getRight(), bh);
    }
}

From source file:org.libreoffice.impressremote.fragment.slides.PointerFragment.java

@Override
public void onServiceConnected(ComponentName aComponentName, IBinder aBinder) {
    CommunicationService.ServiceBinder aServiceBinder = (CommunicationService.ServiceBinder) aBinder;
    mCommunicationService = aServiceBinder.getService();

    if (!isServiceBound()) {
        return;//  w  w w .ja  va2  s .  c o  m
    }

    if (!isAdded()) {
        return;
    }

    ViewPager aSlidesPager = getSlidesPager();

    aSlidesPager.setAdapter(buildSlidesAdapter());

    setUpCurrentSlide();

    // get the real width/height of the preview
    int iH = ((ImageView) aSlidesPager.getChildAt(0)).getDrawable().getIntrinsicHeight();
    int iW = ((ImageView) aSlidesPager.getChildAt(0)).getDrawable().getIntrinsicWidth();
    int dH = aSlidesPager.getHeight();
    int dW = aSlidesPager.getWidth();
    if (dH / iH <= dW / iW) {
        //height is limiting
        displaywidth = iW * dH / iH;
        displayheight = dH;
        xoffset = (dW - displaywidth) / 2;
        yoffset = 0;
    } else {
        displaywidth = dW;
        displayheight = iH * dW / iW;
        xoffset = 0;
        yoffset = (dH - displayheight) / 2;
    }
}

From source file:de.vanita5.twittnuker.fragment.support.UserListFragment.java

@Override
public boolean isScrollContent(float x, float y) {
    final ViewPager v = mViewPager;
    final int[] location = new int[2];
    v.getLocationOnScreen(location);/*  w ww .j  a  v  a  2  s  .com*/
    return x >= location[0] && x <= location[0] + v.getWidth() && y >= location[1]
            && y <= location[1] + v.getHeight();
}