当前位置: 首页>>代码示例>>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;未经允许,请勿转载。