Java Code Examples for android.view.Display#getRectSize()

The following examples show how to use android.view.Display#getRectSize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SpinnerCrutch.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void getWindowVisibleDisplayFrame(Rect outRect) {
    WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
    Display d = wm.getDefaultDisplay();
    d.getRectSize(outRect);
    super.getWindowVisibleDisplayFrame(outRect);
    outRect.set(outRect.left, getTop(), outRect.right, outRect.bottom - 10);
}
 
Example 2
Source File: PopupLayer.java    From PopupCircleMenu with MIT License 5 votes vote down vote up
public PopupLayer(Activity context, int radius) {
    super(context);
    mRadius = radius;
    mContext = context;
    Display display = context.getWindow().getWindowManager().getDefaultDisplay();
    mRectWindowRange = new Rect();
    btTempRect = new Rect();
    display.getRectSize(mRectWindowRange);
    mWindowCenterPoint = new Point(mRectWindowRange.centerX(), mRectWindowRange.centerY());
    mShadowView = new View(context);
    mShadowView.setBackgroundColor(Color.parseColor("#66000000"));
    mShadowView.setLayoutParams(new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    addView(mShadowView);
}