• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java AutoScrollHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.support.v4.widget.AutoScrollHelper的典型用法代码示例。如果您正苦于以下问题:Java AutoScrollHelper类的具体用法?Java AutoScrollHelper怎么用?Java AutoScrollHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AutoScrollHelper类属于android.support.v4.widget包,在下文中一共展示了AutoScrollHelper类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: calculateMaxViewport

import android.support.v4.widget.AutoScrollHelper; //导入依赖的package包/类
private void calculateMaxViewport() {
    this.tempMaximumViewport.set(AutoScrollHelper.NO_MAX, Float.MIN_VALUE, Float.MIN_VALUE, AutoScrollHelper.NO_MAX);
    for (Line line : this.dataProvider.getLineChartData().getLines()) {
        for (PointValue pointValue : line.getValues()) {
            if (pointValue.getX() < this.tempMaximumViewport.left) {
                this.tempMaximumViewport.left = pointValue.getX();
            }
            if (pointValue.getX() > this.tempMaximumViewport.right) {
                this.tempMaximumViewport.right = pointValue.getX();
            }
            if (pointValue.getY() < this.tempMaximumViewport.bottom) {
                this.tempMaximumViewport.bottom = pointValue.getY();
            }
            if (pointValue.getY() > this.tempMaximumViewport.top) {
                this.tempMaximumViewport.top = pointValue.getY();
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:20,代码来源:LineChartRenderer.java


示例2: getClosestDecodedValue

import android.support.v4.widget.AutoScrollHelper; //导入依赖的package包/类
private static int getClosestDecodedValue(int[] moduleBitCount) {
    int bitCountSum = PDF417Common.getBitCountSum(moduleBitCount);
    float[] bitCountRatios = new float[8];
    for (int i = 0; i < bitCountRatios.length; i++) {
        bitCountRatios[i] = ((float) moduleBitCount[i]) / ((float) bitCountSum);
    }
    float bestMatchError = AutoScrollHelper.NO_MAX;
    int bestMatch = -1;
    for (int j = 0; j < RATIOS_TABLE.length; j++) {
        float error = 0.0f;
        float[] ratioTableRow = RATIOS_TABLE[j];
        for (int k = 0; k < 8; k++) {
            float diff = ratioTableRow[k] - bitCountRatios[k];
            error += diff * diff;
            if (error >= bestMatchError) {
                break;
            }
        }
        if (error < bestMatchError) {
            bestMatchError = error;
            bestMatch = PDF417Common.SYMBOL_TABLE[j];
        }
    }
    return bestMatch;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:PDF417CodewordDecoder.java


示例3: init

import android.support.v4.widget.AutoScrollHelper; //导入依赖的package包/类
private void init() {
        listView = (ListView) findViewById(R.id.list_view);

        String[] strs = getData(100);
        List<Map<String, Object>> list = new ArrayList<>();
        for (String str : strs) {
            Map<String, Object> map = new HashMap<>();
            map.put("text", str);
            list.add(map);
        }
        SimpleAdapter adapter = new SimpleAdapter(this, list, R.layout.item_simple, new String[]{"text"}, new int[]{R.id.text_view});
        listView.setAdapter(adapter);

        AutoScrollHelper autoScrollHelper = new ListViewAutoScrollHelper(listView);
        listView.setOnTouchListener(autoScrollHelper);
        autoScrollHelper.setEnabled(true);
//        autoScrollHelper.setActivationDelay(3000);
//        autoScrollHelper.setRampDownDuration(3000);
        Toast.makeText(this, "长按上或下边缘", Toast.LENGTH_SHORT).show();
    }
 
开发者ID:zhengxiaopeng,项目名称:Rocko-Android-Demos,代码行数:21,代码来源:ListViewActivity.java


示例4: setScrollHelpers

import android.support.v4.widget.AutoScrollHelper; //导入依赖的package包/类
private void setScrollHelpers() {
    mScrollHelper = new ListBuddiesAutoScrollHelper(mListViewLeft) {
        @Override
        public void scrollTargetBy(int deltaX, int deltaY) {
            mListViewLeft.smoothScrollBy(mSpeedLeft, 0);
            mListViewRight.smoothScrollBy(mSpeedRight, 0);
        }

        @Override
        public boolean canTargetScrollHorizontally(int i) {
            return false;
        }

        @Override
        public boolean canTargetScrollVertically(int i) {
            return true;
        }
    };

    mScrollHelper.setEnabled(isEnable());
    mScrollHelper.setEdgeType(AutoScrollHelper.EDGE_TYPE_OUTSIDE);
}
 
开发者ID:mthli,项目名称:Geeky,代码行数:23,代码来源:ListBuddiesLayout.java


示例5: calculateMaxViewport

import android.support.v4.widget.AutoScrollHelper; //导入依赖的package包/类
private void calculateMaxViewport() {
    float maxZ = Float.MIN_VALUE;
    this.tempMaximumViewport.set(AutoScrollHelper.NO_MAX, Float.MIN_VALUE, Float.MIN_VALUE, AutoScrollHelper.NO_MAX);
    BubbleChartData data = this.dataProvider.getBubbleChartData();
    for (BubbleValue bubbleValue : data.getValues()) {
        if (Math.abs(bubbleValue.getZ()) > maxZ) {
            maxZ = Math.abs(bubbleValue.getZ());
        }
        if (bubbleValue.getX() < this.tempMaximumViewport.left) {
            this.tempMaximumViewport.left = bubbleValue.getX();
        }
        if (bubbleValue.getX() > this.tempMaximumViewport.right) {
            this.tempMaximumViewport.right = bubbleValue.getX();
        }
        if (bubbleValue.getY() < this.tempMaximumViewport.bottom) {
            this.tempMaximumViewport.bottom = bubbleValue.getY();
        }
        if (bubbleValue.getY() > this.tempMaximumViewport.top) {
            this.tempMaximumViewport.top = bubbleValue.getY();
        }
    }
    this.maxRadius = (float) Math.sqrt(((double) maxZ) / 3.141592653589793d);
    this.bubbleScaleX = this.tempMaximumViewport.width() / (this.maxRadius * aj.hA);
    if (this.bubbleScaleX == 0.0f) {
        this.bubbleScaleX = 1.0f;
    }
    this.bubbleScaleY = this.tempMaximumViewport.height() / (this.maxRadius * aj.hA);
    if (this.bubbleScaleY == 0.0f) {
        this.bubbleScaleY = 1.0f;
    }
    this.bubbleScaleX *= data.getBubbleScale();
    this.bubbleScaleY *= data.getBubbleScale();
    this.tempMaximumViewport.inset((-this.maxRadius) * this.bubbleScaleX, (-this.maxRadius) * this.bubbleScaleY);
    this.minRawRadius = (float) ChartUtils.dp2px(this.density, this.dataProvider.getBubbleChartData().getMinBubbleRadius());
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:36,代码来源:BubbleChartRenderer.java


示例6: init

import android.support.v4.widget.AutoScrollHelper; //导入依赖的package包/类
private void init() {
    recyclerView = (RecyclerView) findViewById(R.id.recyler_view);

    linearLayoutManager = new LinearLayoutManager(this);
    linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    staggeredGridLayoutManager = new StaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL);

    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setAdapter(new SimpleRecylerViewAdapter(this, getData(100)));

    AutoScrollHelper autoScrollHelper = new RecyclerViewAutoScrollHelper(recyclerView);
    autoScrollHelper.setEnabled(true);
    recyclerView.setOnTouchListener(autoScrollHelper);
}
 
开发者ID:zhengxiaopeng,项目名称:Rocko-Android-Demos,代码行数:15,代码来源:RecyclerViewActivity.java


示例7: init

import android.support.v4.widget.AutoScrollHelper; //导入依赖的package包/类
private void init() {
    scrollView = (ScrollView) findViewById(R.id.scroll_view);
    AutoScrollHelper autoScrollHelper = new ScrollViewAutoScrollHelper(scrollView);
    autoScrollHelper.setEnabled(true);
    scrollView.setOnTouchListener(autoScrollHelper);
}
 
开发者ID:zhengxiaopeng,项目名称:Rocko-Android-Demos,代码行数:7,代码来源:ScrollViewActivity.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GetContainerStatusesRequestProto类代码示例发布时间:2022-05-22
下一篇:
Java ActorPath类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap