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


Java AccessibilityRecordCompat.setScrollable方法代碼示例

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


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

示例1: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
/**
 * Called by the accessibility delegate to initialize an accessibility event.
 * <p>
 * Default implementation adds item count and scroll information to the event.
 *
 * @param recycler The Recycler that can be used to convert view positions into adapter
 *                 positions
 * @param state    The current state of RecyclerView
 * @param event    The event instance to initialize
 * @see View#onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent)
 */
public void onInitializeAccessibilityEvent(Recycler recycler, State state,
        AccessibilityEvent event) {
    final AccessibilityRecordCompat record = AccessibilityEventCompat
            .asRecord(event);
    if (mRecyclerView == null || record == null) {
        return;
    }
    record.setScrollable(ViewCompat.canScrollVertically(mRecyclerView, 1)
            || ViewCompat.canScrollVertically(mRecyclerView, -1)
            || ViewCompat.canScrollHorizontally(mRecyclerView, -1)
            || ViewCompat.canScrollHorizontally(mRecyclerView, 1));

    if (mRecyclerView.mAdapter != null) {
        record.setItemCount(mRecyclerView.mAdapter.getItemCount());
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:28,代碼來源:RecyclerView.java

示例2: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(DirectionalViewpager.class.getName());
    AccessibilityRecordCompat recordCompat = null;
    if (isHorizontal()) {
        recordCompat =
                AccessibilityEventCompat.asRecord(event);
    } else {
        recordCompat = AccessibilityRecordCompat.obtain();
    }
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:ynztlxdeai,項目名稱:TextReader,代碼行數:20,代碼來源:DirectionalViewpager.java

示例3: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
/**
 * Called by the accessibility delegate to initialize an accessibility event.
 * <p>
 * Default implementation adds item count and scroll information to the event.
 *
 * @param recycler The Recycler that can be used to convert view positions into adapter
 *                 positions
 * @param state    The current state of RecyclerView
 * @param event    The event instance to initialize
 * @see View#onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent)
 */
public void onInitializeAccessibilityEvent(Recycler recycler, State state,
                                           AccessibilityEvent event) {
    final AccessibilityRecordCompat record = AccessibilityEventCompat
            .asRecord(event);
    if (mRecyclerView == null || record == null) {
        return;
    }
    record.setScrollable(ViewCompat.canScrollVertically(mRecyclerView, 1)
            || ViewCompat.canScrollVertically(mRecyclerView, -1)
            || ViewCompat.canScrollHorizontally(mRecyclerView, -1)
            || ViewCompat.canScrollHorizontally(mRecyclerView, 1));

    if (mRecyclerView.mAdapter != null) {
        record.setItemCount(mRecyclerView.mAdapter.getItemCount());
    }
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:28,代碼來源:RecyclerView.java

示例4: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityEvent(Recycler recycler, State state, AccessibilityEvent event) {
    boolean z = true;
    AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
    if (this.mRecyclerView != null && record != null) {
        if (!(ViewCompat.canScrollVertically(this.mRecyclerView, 1) || ViewCompat.canScrollVertically(this.mRecyclerView, -1) || ViewCompat.canScrollHorizontally(this.mRecyclerView, -1) || ViewCompat.canScrollHorizontally(this.mRecyclerView, 1))) {
            z = false;
        }
        record.setScrollable(z);
        if (this.mRecyclerView.mAdapter != null) {
            record.setItemCount(this.mRecyclerView.mAdapter.getItemCount());
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:14,代碼來源:RecyclerView.java

示例5: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(ViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:14,代碼來源:VerticalViewPager.java

示例6: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(XCCycleViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:ruiqiao2017,項目名稱:Renrentou,代碼行數:14,代碼來源:XCCycleViewPager.java

示例7: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(YViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat =
            AccessibilityEventCompat.asRecord(event);
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(getAdapterCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:14,代碼來源:YViewPager.java

示例8: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(YViewPagerNew.class.getName());
    final AccessibilityRecordCompat recordCompat =
            AccessibilityEventCompat.asRecord(event);
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(getAdapterCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:15,代碼來源:YViewPagerNew.java

示例9: 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,項目名稱:boohee_v5.6,代碼行數:12,代碼來源:NestedScrollView.java

示例10: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(ViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat =
            AccessibilityEventCompat.asRecord(event);
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:simplezhli,項目名稱:ChangeTabLayout,代碼行數:15,代碼來源:VerticalViewPager.java

示例11: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
	super.onInitializeAccessibilityEvent(host, event);
	event.setClassName(CustomViewPager.class.getName());
	final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
	recordCompat.setScrollable(canScroll());
	if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
		&& mAdapter != null) {
		recordCompat.setItemCount(mAdapter.getCount());
		recordCompat.setFromIndex(mCurItem);
		recordCompat.setToIndex(mCurItem);
	}
}
 
開發者ID:fengshihao,項目名稱:WebPager,代碼行數:14,代碼來源:CustomViewPager.java

示例12: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(ViewPager.class.getName());
    AccessibilityRecordCompat recordCompat = AccessibilityEventCompat.asRecord(event);
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == 4096 && ViewPager.this.mAdapter != null) {
        recordCompat.setItemCount(ViewPager.this.mAdapter.getCount());
        recordCompat.setFromIndex(ViewPager.this.mCurItem);
        recordCompat.setToIndex(ViewPager.this.mCurItem);
    }
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:12,代碼來源:ViewPager.java

示例13: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(ViewPagerEx.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:14,代碼來源:ViewPagerEx.java

示例14: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(VelocityViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:reyanshmishra,項目名稱:Rey-MusicPlayer,代碼行數:14,代碼來源:VelocityViewPager.java

示例15: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(host, event);
    event.setClassName(SmoothViewPager.class.getName());
    final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
    recordCompat.setScrollable(canScroll());
    if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
            && mAdapter != null) {
        recordCompat.setItemCount(mAdapter.getCount());
        recordCompat.setFromIndex(mCurItem);
        recordCompat.setToIndex(mCurItem);
    }
}
 
開發者ID:OpenLauncherTeam,項目名稱:openlauncher,代碼行數:14,代碼來源:SmoothViewPager.java


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