本文整理汇总了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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
示例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);
}
}
示例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;
}