本文整理了Java中android.view.View.isLongClickable()
方法的一些代码示例,展示了View.isLongClickable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.isLongClickable()
方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:isLongClickable
暂无
代码示例来源:origin: square/assertj-android
public S isNotLongClickable() {
isNotNull();
assertThat(actual.isLongClickable()) //
.overridingErrorMessage("Expected to not be long-clickable but was") //
.isFalse();
return myself;
}
代码示例来源:origin: square/assertj-android
public S isLongClickable() {
isNotNull();
assertThat(actual.isLongClickable()) //
.overridingErrorMessage("Expected to be long-clickable but was not") //
.isTrue();
return myself;
}
代码示例来源:origin: balysv/material-ripple
private boolean findClickableViewInChild(View view, int x, int y) {
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
final Rect rect = new Rect();
child.getHitRect(rect);
final boolean contains = rect.contains(x, y);
if (contains) {
return findClickableViewInChild(child, x - rect.left, y - rect.top);
}
}
} else if (view != childView) {
return (view.isEnabled() && (view.isClickable() || view.isLongClickable() || view.isFocusableInTouchMode()));
}
return view.isFocusableInTouchMode();
}
代码示例来源:origin: robolectric/robolectric
@Test
public void shouldLongClickAndNotLongClick() throws Exception {
assertThat(view.isLongClickable()).isFalse();
view.setLongClickable(true);
assertThat(view.isLongClickable()).isTrue();
view.setLongClickable(false);
assertThat(view.isLongClickable()).isFalse();
view.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
return false;
}
});
assertThat(view.isLongClickable()).isTrue();
}
代码示例来源:origin: facebook/litho
if (view.isLongClickable()) {
mMountViewFlags |= FLAG_VIEW_LONG_CLICKABLE;
代码示例来源:origin: alexvasilkov/GestureViews
viewportEvent.offsetLocation(-view.getPaddingLeft(), -view.getPaddingTop());
gestureDetector.setIsLongpressEnabled(view.isLongClickable());
代码示例来源:origin: willowtreeapps/Hyperion-Android
attributes.add(new MutableBooleanViewAttribute("LongClickable", view.isLongClickable()) {
@Override
protected void mutate(Boolean value) {
代码示例来源:origin: klinker24/Android-Blur-Launcher
public boolean onPressed(MotionEvent event) {
return mView.isLongClickable() && mView.performLongClick();
}
代码示例来源:origin: klinker24/launcher3
public boolean onPressed(MotionEvent event) {
return mView.isLongClickable() && mView.performLongClick();
}
代码示例来源:origin: enricocid/LaunchEnr
public boolean onPressed(MotionEvent event) {
return mView.isLongClickable() && mView.performLongClick();
}
代码示例来源:origin: appium/appium-espresso-driver
public boolean isLongClickable() {
return view.isLongClickable();
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public S isLongClickable() {
isNotNull();
assertThat(actual.isLongClickable()) //
.overridingErrorMessage("Expected to be long-clickable but was not") //
.isTrue();
return myself;
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public S isNotLongClickable() {
isNotNull();
assertThat(actual.isLongClickable()) //
.overridingErrorMessage("Expected to not be long-clickable but was") //
.isFalse();
return myself;
}
代码示例来源:origin: com.google.android.apps.common.testing.accessibility.framework/accessibility-test-framework
/**
* Determines if the supplied {@link View} is actionable for accessibility purposes.
*
* @param view The {@link View} to evaluate
* @return {@code true} if {@code view} is considered actionable for accessibility
*/
public static boolean isActionableForAccessibility(View view) {
if (view == null) {
return false;
}
return (view.isClickable() || view.isLongClickable() || view.isFocusable());
}
代码示例来源:origin: WeAreFairphone/FP2-Launcher
public void onClick(View v) {
if (mActionMode != null) {
// When CAB is up, clicking toggles the item instead
if (v.isLongClickable()) {
mLongClickListener.onLongClick(v);
}
return;
}
mSetWallpaperButton.setEnabled(true);
WallpaperTileInfo info = (WallpaperTileInfo) v.getTag();
if (info.isSelectable() && v.getVisibility() == View.VISIBLE) {
selectTile(v);
}
info.onClick(WallpaperPickerActivity.this);
}
};
代码示例来源:origin: jjhesk/KickAssSlidingMenu
private boolean findClickableViewInChild(View view, int x, int y) {
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
final Rect rect = new Rect();
child.getHitRect(rect);
final boolean contains = rect.contains(x, y);
if (contains) {
return findClickableViewInChild(child, x - rect.left, y - rect.top);
}
}
} else if (view != childView) {
return (view.isEnabled() && (view.isClickable() || view.isLongClickable() || view.isFocusableInTouchMode()));
}
return view.isFocusableInTouchMode();
}
代码示例来源:origin: bzsome/VirtualApp-x326
private boolean findClickableViewInChild(View view, int x, int y) {
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
final Rect rect = new Rect();
child.getHitRect(rect);
final boolean contains = rect.contains(x, y);
if (contains) {
return findClickableViewInChild(child, x - rect.left, y - rect.top);
}
}
} else if (view != childView) {
return (view.isEnabled() && (view.isClickable() || view.isLongClickable() || view.isFocusableInTouchMode()));
}
return view.isFocusableInTouchMode();
}
代码示例来源:origin: fookwood/Launcher3
public void onClick(View v) {
if (mActionMode != null) {
// When CAB is up, clicking toggles the item instead
if (v.isLongClickable()) {
mLongClickListener.onLongClick(v);
}
return;
}
setWallpaperButtonEnabled(true);
WallpaperTileInfo info = (WallpaperTileInfo) v.getTag();
if (info.isSelectable() && v.getVisibility() == View.VISIBLE) {
selectTile(v);
}
info.onClick(WallpaperPickerActivity.this);
}
};
代码示例来源:origin: jjhesk/KickAssSlidingMenu
private boolean findClickableViewInChild(View view, int x, int y) {
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
final Rect rect = new Rect();
child.getHitRect(rect);
final boolean contains = rect.contains(x, y);
if (contains) {
return findClickableViewInChild(child, x - rect.left, y - rect.top);
}
}
} else if (view != childView) {
return (view.isEnabled() && (view.isClickable() || view.isLongClickable() || view.isFocusableInTouchMode()));
}
return view.isFocusableInTouchMode();
}
代码示例来源:origin: jjhesk/KickAssSlidingMenu
private boolean findClickableViewInChild(View view, int x, int y) {
if (view instanceof ViewGroup) {
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0; i < viewGroup.getChildCount(); i++) {
View child = viewGroup.getChildAt(i);
final Rect rect = new Rect();
child.getHitRect(rect);
final boolean contains = rect.contains(x, y);
if (contains) {
return findClickableViewInChild(child, x - rect.left, y - rect.top);
}
}
} else if (view != childView) {
return (view.isEnabled() && (view.isClickable() || view.isLongClickable() || view.isFocusableInTouchMode()));
}
return view.isFocusableInTouchMode();
}
内容来源于网络,如有侵权,请联系作者删除!