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


Java AccessibilityRecordCompat.setScrollX方法代碼示例

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


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

示例1: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    NestedScrollView nsvHost = (NestedScrollView) host;
    event.setClassName(ScrollView.class.getName());
    AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    record.setScrollable(nsvHost.getScrollRange() > 0);
    record.setScrollX(nsvHost.getScrollX());
    record.setScrollY(nsvHost.getScrollY());
    record.setMaxScrollX(nsvHost.getScrollX());
    record.setMaxScrollY(nsvHost.getScrollRange());
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:12,代碼來源:NestedScrollView.java

示例2: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    final SSScrollView nsvHost = (SSScrollView) host;
    event.setClassName(ScrollView.class.getName());
    final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    final boolean scrollable = nsvHost.getScrollRange() > 0;
    record.setScrollable(scrollable);
    record.setScrollX(nsvHost.getScrollX());
    record.setScrollY(nsvHost.getScrollY());
    record.setMaxScrollX(nsvHost.getScrollX());
    record.setMaxScrollY(nsvHost.getScrollRange());
}
 
開發者ID:hanks-zyh,項目名稱:NestedScroll,代碼行數:14,代碼來源:SSScrollView.java

示例3: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host,
		AccessibilityEvent event) {
	super.onInitializeAccessibilityEvent(host, event);
	final TwoWayNestedScrollView nsvHost = (TwoWayNestedScrollView) host;
	event.setClassName(ScrollView.class.getName());
	final AccessibilityRecordCompat record = AccessibilityEventCompat
			.asRecord(event);
	final boolean scrollable = nsvHost.getVerticalScrollRange() > 0 || nsvHost.getHorizontalScrollRange() > 0;
	record.setScrollable(scrollable);
	record.setScrollX(nsvHost.getScrollX());
	record.setScrollY(nsvHost.getScrollY());
	record.setMaxScrollX(nsvHost.getHorizontalScrollRange());
	record.setMaxScrollY(nsvHost.getVerticalScrollRange());
}
 
開發者ID:peerless2012,項目名稱:TwoWayNestedScrollView,代碼行數:16,代碼來源:TwoWayNestedScrollView.java

示例4: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    final NestedScrollView nsvHost = (NestedScrollView) host;
    event.setClassName(ScrollView.class.getName());
    final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    final boolean scrollable = nsvHost.getScrollRange() > 0;
    record.setScrollable(scrollable);
    record.setScrollX(nsvHost.getScrollX());
    record.setScrollY(nsvHost.getScrollY());
    record.setMaxScrollX(nsvHost.getScrollX());
    record.setMaxScrollY(nsvHost.getScrollRange());
}
 
開發者ID:lovejjfg,項目名稱:MyBlogDemo,代碼行數:14,代碼來源:NestedScrollView.java


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