當前位置: 首頁>>代碼示例>>Java>>正文


Java Display.getCurrentSizeRange方法代碼示例

本文整理匯總了Java中android.view.Display.getCurrentSizeRange方法的典型用法代碼示例。如果您正苦於以下問題:Java Display.getCurrentSizeRange方法的具體用法?Java Display.getCurrentSizeRange怎麽用?Java Display.getCurrentSizeRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.Display的用法示例。


在下文中一共展示了Display.getCurrentSizeRange方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: start

import android.view.Display; //導入方法依賴的package包/類
public void start() throws Exception {
    this.receiver = new SwipeTabManagerReceiver();
    IntentFilter filter = new IntentFilter();
    filter.addAction(INTENT_ACTION_CMDS);
    this.context.registerReceiver(this.receiver, filter);
    Display display = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    Point size2 = new Point();
    display.getCurrentSizeRange(size, size2);
    this.screenWidth = size.x;
    this.screenHeight = size2.y;
    LayoutInflater inflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    setupRelocationManager();
    this.swipeTabTouchView = new View(this.context);
    this.swipeTabMinimizedTouchView = new View(this.context);
    this.swipeRenderView = new RelativeLayout(this.context);
    this.swipeTabView = (YettiTabLayout) inflater.inflate(R.layout.yetti_tab_layout, null);
    this.swipeTabView.setUnreadCount(0, null);
    this.swipeRenderView.addView(this.swipeTabView);
    refreshTabViewState();
    this.settings.registerSettingChangeListener(this);
    this.relocationManager.init();
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:24,代碼來源:SwipeTabViewController.java

示例2: addChildAt

import android.view.Display; //導入方法依賴的package包/類
/**
 * We need to set the styleWidth and styleHeight of the one child (represented by the <View/>
 * within the <RCTModalHostView/> in Modal.js.  This needs to fill the entire window.
 */
@Override
@TargetApi(16)
public void addChildAt(ReactShadowNode child, int i) {
  super.addChildAt(child, i);

  Context context = getThemedContext();
  WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
  Display display = wm.getDefaultDisplay();
  // getCurrentSizeRange will return the min and max width and height that the window can be
  display.getCurrentSizeRange(mMinPoint, mMaxPoint);

  int width, height;
  int rotation = display.getRotation();
  if (rotation == Surface.ROTATION_0 || rotation == Surface.ROTATION_180) {
    // If we are vertical the width value comes from min width and height comes from max height
    width = mMinPoint.x;
    height = mMaxPoint.y;
  } else {
    // If we are horizontal the width value comes from max width and height comes from min height
    width = mMaxPoint.x;
    height = mMinPoint.y;
  }
  child.setStyleWidth(width);
  child.setStyleHeight(height);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:30,代碼來源:FlatReactModalShadowNode.java

示例3: createSwipeLayoutView

import android.view.Display; //導入方法依賴的package包/類
private void createSwipeLayoutView() {
    Display display = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    Point size2 = new Point();
    display.getCurrentSizeRange(size, size2);
    this.screenWidth = size.x;
    this.screenHeight = size2.y;
    this.inboxViewController.getView().setX(0.0f);
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:10,代碼來源:SwipeViewManager.java

示例4: init

import android.view.Display; //導入方法依賴的package包/類
void init() {
    WindowManager windowManager = (WindowManager) this.context.getSystemService("window");
    Display display = windowManager.getDefaultDisplay();
    Point size = new Point();
    Point size2 = new Point();
    display.getCurrentSizeRange(size, size2);
    this.screenWidth = size.x;
    this.screenHeight = size2.x;
    this.statusBarHeight = size2.x - size2.y;
    LayoutParams params = new LayoutParams(-2, -2, 2007, 16843544, -3);
    params.gravity = 51;
    params.width = -1;
    params.height = -1;
    params.x = this.FAR_AWAY;
    params.y = 0;
    LayoutInflater inflater = (LayoutInflater) this.context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    this.renderView = new RelativeLayout(this.context);
    this.trashFooter = (ViewGroup) inflater.inflate(R.layout.swipe_relocation_trash_footer, null);
    this.trashCan = this.trashFooter.findViewById(R.id.swipe_relocator_trash);
    this.swipeTab = (YettiTabLayout) inflater.inflate(R.layout.yetti_tab_layout, null);
    this.swipeTab.animate().setDuration(0).alpha(0.0f);
    windowManager.addView(this.renderView, params);
    this.renderView.addView(this.swipeTab, -2, -2);
    this.renderView.addView(this.trashFooter, -1, -1);
    resetTrash();
    setupGestureDetector();
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:28,代碼來源:SwipeTabViewRelocationController.java


注:本文中的android.view.Display.getCurrentSizeRange方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。