当前位置: 首页>>代码示例>>Java>>正文


Java ExploreByTouchHelper类代码示例

本文整理汇总了Java中android.support.v4.widget.ExploreByTouchHelper的典型用法代码示例。如果您正苦于以下问题:Java ExploreByTouchHelper类的具体用法?Java ExploreByTouchHelper怎么用?Java ExploreByTouchHelper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ExploreByTouchHelper类属于android.support.v4.widget包,在下文中一共展示了ExploreByTouchHelper类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: moveFocus

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
private boolean moveFocus(boolean positive) {
  ensureFocus();
  boolean focusChanged = false;
  if (positive) {
    if (focusedVirtualView == ExploreByTouchHelper.HOST_ID) {
      setFocusedVirtualView(CLOSE_ICON_VIRTUAL_ID);
      focusChanged = true;
    }
  } else {
    if (focusedVirtualView == CLOSE_ICON_VIRTUAL_ID) {
      setFocusedVirtualView(ExploreByTouchHelper.HOST_ID);
      focusChanged = true;
    }
  }
  return focusChanged;
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:17,代码来源:Chip.java

示例2: clearFocusedVirtualView

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
public void clearFocusedVirtualView() {
    final int focusedVirtualView = getFocusedVirtualView();
    if (focusedVirtualView != ExploreByTouchHelper.INVALID_ID) {
        getAccessibilityNodeProvider(MonthView.this).performAction(
                focusedVirtualView,
                AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS,
                null);
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:10,代码来源:MonthView.java

示例3: getVirtualViewAt

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
@Override
protected int getVirtualViewAt(float x, float y) {
    final int day = getDayFromLocation(x, y);
    if (day >= 0) {
        return day;
    }
    return ExploreByTouchHelper.INVALID_ID;
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:9,代码来源:MonthView.java

示例4: setViewSize

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
private int setViewSize(int mode, int size, int drawableWidth) {
    switch (mode) {
        case ExploreByTouchHelper.INVALID_ID /*-2147483648*/:
            return Math.min(drawableWidth, size);
        case 0 /*0*/:
            return drawableWidth;
        case 1073741824:
            return size;
        default:
            return size;
    }
}
 
开发者ID:asif-patel,项目名称:ImageMagnifier,代码行数:13,代码来源:TouchImageView.java

示例5: getVirtualViewAt

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
@Override
protected int getVirtualViewAt(float x, float y) {
    final int day = getDayAtLocation((int) (x + 0.5f), (int) (y + 0.5f));
    if (day != -1) {
        return day;
    }
    return ExploreByTouchHelper.INVALID_ID;
}
 
开发者ID:Gericop,项目名称:DateTimePicker,代码行数:9,代码来源:SimpleMonthView.java

示例6: onFocusChanged

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
@Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
  if (focused) {
    // If we've gained focus from another view, always focus the chip first.
    setFocusedVirtualView(ExploreByTouchHelper.HOST_ID);
  } else {
    setFocusedVirtualView(ExploreByTouchHelper.INVALID_ID);
  }
  invalidate();

  super.onFocusChanged(focused, direction, previouslyFocusedRect);
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:13,代码来源:Chip.java

示例7: clearFocusedVirtualView

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
public void clearFocusedVirtualView() {
  final int focusedVirtualView = getFocusedVirtualView();
  if (focusedVirtualView != ExploreByTouchHelper.INVALID_ID) {
    getAccessibilityNodeProvider(
        MonthView.this).performAction(
        focusedVirtualView,
        AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS,
        null);
  }
}
 
开发者ID:novachevskyi,项目名称:material-calendar-datepicker,代码行数:11,代码来源:MonthView.java

示例8: getVirtualViewAt

import android.support.v4.widget.ExploreByTouchHelper; //导入依赖的package包/类
@Override
protected int getVirtualViewAt(float x, float y) {
  final int day = getDayFromLocation(x, y);
  if (day >= 0) {
    return day;
  }
  return ExploreByTouchHelper.INVALID_ID;
}
 
开发者ID:novachevskyi,项目名称:material-calendar-datepicker,代码行数:9,代码来源:MonthView.java


注:本文中的android.support.v4.widget.ExploreByTouchHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。