Android的定制轮或老虎机实施 [英] Android Custom wheel or slot machine implementation

查看:193
本文介绍了Android的定制轮或老虎机实施的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要实现类似的控制车轮(老虎机),喜欢的图片。

但是每个项目的边缘(所述项之间的位置)需要被平滑,这样它会看起来像在地球的地球仪。这是一个屏幕截图的iPhone应用程序,从为iPhone库来实现的。我想它的机器人。我查了康康轮(安卓轮),但它并没有提供我的需要。然而,它的需要,我循环行为。我检查了下面的链接也。

<一个href="http://developer.sonymobile.com/2010/06/23/android-tutorial-making-your-own-3d-list-part-3/">http://developer.sonymobile.com/2010/06/23/android-tutorial-making-your-own-3d-list-part-3/

我打了帆布和矩阵的方法pretranslate翻译后的规模等一些价值观,但我没有关于它是如何工作的任何想法,什么样的影响,它会做歪斜等特定值 当我和UI设计师讨论他们告诉我,才达到这个屏幕设计采用倾斜或透视属性。但我还没有一个想法如何扭曲或应用透视图像的机器人。我尝试应用一些值在歪斜的drawChild()自定义列表视图的方法(使用列表视图执行此链接<一的href="http://developer.sonymobile.com/2010/06/23/android-tutorial-making-your-own-3d-list-part-3/">http://developer.sonymobile.com/2010/06/23/android-tutorial-making-your-own-3d-list-part-3/)但视图变得看不见的。

我无法用矩阵规模的行为,因为它会插入每个孩子的意见之间的差距。

我需要知道如何将实施下列行为为好。需求是

  1. 在用户试图滚动它会检查阀值且仅当阈值小于配置的阈值也滚动。

  2. 的项目滚动环状的,在某种意义上说,该lastitem后车轮显示中的第一项,并依此类推。如果只有一个项目,则车轮应填写与单个项目。

  3. 在该视图滚动所有触摸被禁止,直到轮结束。

  4. 车轮滚动应该为特定的提供时间(来计算后端的礼物,并决定哪些项目应该在视图的中心。

  5. 当我们设置与的setSelected()或setSelection()之类的康康车轮演示(安卓轮)方法来选择项目时,该轮应逐渐减速到指定位置,而不是immediatley停止车轮的这一立场。

解决方案

刚刚尝试这一点,保持6次5所示的图像和一个储备。 当视图1超出范围的储备来看进来下一个图像和放大器;观点1成为储备视图同样应该渲染周期,只要你想多次。

的宽度不断增大,而从底部移动到中心缩小,当它推出对顶部

I need to implement a wheel like control (a slot machine) like in the picture.

But the edges (the position between the items) of each item need to be smoothened so that it will look like a globe like the earth. This is a screen shot of iPhone app achieved from a library for iPhone. I want it in android. I checked the kankan wheel (Android wheel) but it does not serves my needs. However it's cyclic behavior is needed for me. And I checked the following link also.

http://developer.sonymobile.com/2010/06/23/android-tutorial-making-your-own-3d-list-part-3/

I played with canvas and matrix with some values for methods pretranslate post translate scale etc. But I haven't any idea about how it works, what the impact it will do with a specific value for skew etc. When I discussed with UI designers they told me that to achive this screen design use "skew" or "perspective" property. But I haven't an idea how to skew or apply perspective to an image in android. I tried to apply some values to skew in the on drawChild() method of the custom list view (used the list view implementation of this link http://developer.sonymobile.com/2010/06/23/android-tutorial-making-your-own-3d-list-part-3/) . But the view became invisible.

I can't use the scale behaviour of matrix because it will insert gaps between each child views.

I need to know how will implement the following behaviours as well. The needs are

  1. Once the user tries to scroll it will check the threshold and do scroll only if the threshold is higher than a configured threshold.

  2. The items scroll cyclic, in a sense that, after the lastitem the wheel show the first item and so on. If there is only one item, then the wheel should fill with the single item.

  3. Once the view is scrolled all the touch are disabled till the wheel ends.

  4. The wheel should scroll for a specific provided time (to calculate the gift from back end and determine which item should be at the centre of the view.

  5. When we set an item to be selected with setSelected() or setSelection() methods like in kankan wheel demo (Android wheel), the wheel should gradually decelerates to the specified position rather than immediatley stops the wheel to the that position.

解决方案

Just try this, keep 6 views 5 as shown in image and one in reserve. When the view 1 goes out of scope the reserve view came in with the next image & the view 1 became the reserve view similarly you should render the cycle as many times you want.

The width grows while it moves from bottom to center and shrinks when it rolls towards top

这篇关于Android的定制轮或老虎机实施的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆