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


Java AccessibilityRecordCompat.setToIndex方法代码示例

本文整理汇总了Java中android.support.v4.view.accessibility.AccessibilityRecordCompat.setToIndex方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityRecordCompat.setToIndex方法的具体用法?Java AccessibilityRecordCompat.setToIndex怎么用?Java AccessibilityRecordCompat.setToIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.view.accessibility.AccessibilityRecordCompat的用法示例。


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

示例1: 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:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:DirectionalViewpager.java

示例2: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    if (getChildCount() > 0) {
        final AccessibilityRecordCompat record = AccessibilityEventCompat
                .asRecord(event);
        final View start = findFirstVisibleItemClosestToStart(false, true);
        final View end = findFirstVisibleItemClosestToEnd(false, true);
        if (start == null || end == null) {
            return;
        }
        final int startPos = getPosition(start);
        final int endPos = getPosition(end);
        if (startPos < endPos) {
            record.setFromIndex(startPos);
            record.setToIndex(endPos);
        } else {
            record.setFromIndex(endPos);
            record.setToIndex(startPos);
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:23,代码来源:StaggeredGridLayoutManager.java

示例3: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //导入方法依赖的package包/类
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    if (getChildCount() > 0) {
        AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
        View start = findFirstVisibleItemClosestToStart(false, true);
        View end = findFirstVisibleItemClosestToEnd(false, true);
        if (start != null && end != null) {
            int startPos = getPosition(start);
            int endPos = getPosition(end);
            if (startPos < endPos) {
                record.setFromIndex(startPos);
                record.setToIndex(endPos);
                return;
            }
            record.setFromIndex(endPos);
            record.setToIndex(startPos);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:20,代码来源:StaggeredGridLayoutManager.java

示例4: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    if (getChildCount() > 0) {
        final AccessibilityRecordCompat record = AccessibilityEventCompat
                .asRecord(event);
        final View start = findFirstVisibleItemClosestToStart(false);
        final View end = findFirstVisibleItemClosestToEnd(false);
        if (start == null || end == null) {
            return;
        }
        final int startPos = getPosition(start);
        final int endPos = getPosition(end);
        if (startPos < endPos) {
            record.setFromIndex(startPos);
            record.setToIndex(endPos);
        } else {
            record.setFromIndex(endPos);
            record.setToIndex(startPos);
        }
    }
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:23,代码来源:StaggeredGridLayoutManager.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(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    if (getChildCount() > 0) {
        final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
        record.setFromIndex(getPosition(getFirstChild()));
        record.setToIndex(getPosition(getLastChild()));
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:10,代码来源:DiscreteScrollLayoutManager.java

示例7: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);

    // Ensure that we only report the number apps for accessibility not including other
    // adapter views
    final AccessibilityRecordCompat record = AccessibilityEventCompat
            .asRecord(event);
    record.setItemCount(mApps.getNumFilteredApps());
    record.setFromIndex(Math.max(0,
            record.getFromIndex() - getRowsNotForAccessibility(record.getFromIndex())));
    record.setToIndex(Math.max(0,
            record.getToIndex() - getRowsNotForAccessibility(record.getToIndex())));
}
 
开发者ID:enricocid,项目名称:LaunchEnr,代码行数:15,代码来源:AllAppsGridAdapter.java

示例8: 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,项目名称:boohee_v5.6,代码行数:12,代码来源:ViewPager.java

示例9: 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

示例10: onInitializeAccessibilityEvent

import android.support.v4.view.accessibility.AccessibilityRecordCompat; //导入方法依赖的package包/类
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    if (getChildCount() > 0) {
        AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
        record.setFromIndex(findFirstVisibleItemPosition());
        record.setToIndex(findLastVisibleItemPosition());
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:LinearLayoutManager.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(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

示例12: 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

示例13: 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:SimonCherryGZ,项目名称:JewelryUI,代码行数:15,代码来源:ViewPager.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(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

示例15: 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:joy-inc,项目名称:core-ui,代码行数:15,代码来源:VerticalViewPager.java


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