diff --git a/application/src/org/yaaic/model/ChannelList.java b/application/src/org/yaaic/model/ChannelList.java deleted file mode 100644 index c1c4735..0000000 --- a/application/src/org/yaaic/model/ChannelList.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.yaaic.model; - -import android.content.Context; -import android.util.AttributeSet; -import android.view.MotionEvent; -import android.widget.Gallery; - -public class ChannelList extends Gallery -{ - public ChannelList(Context context, AttributeSet attrs) - { - super(context, attrs); - } - - @Override - public boolean onFling (MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) - { - /* Reduce sensitivity based on f(x) = x * 0.925^y with y = (|x/500| - 1) - * The goal is to reduce higher velocities stronger than low ones - * 500 is the base, i.e. it will not reduced. */ - final float fexp = Math.abs(velocityX / 500.0f) - 1; - velocityX *= Math.pow(0.925, fexp); - return super.onFling(e1, e2, velocityX, velocityY); - } -} diff --git a/application/src/org/yaaic/view/ConversationGallery.java b/application/src/org/yaaic/view/ConversationGallery.java new file mode 100644 index 0000000..1ddda7b --- /dev/null +++ b/application/src/org/yaaic/view/ConversationGallery.java @@ -0,0 +1,60 @@ +/* +Yaaic - Yet Another Android IRC Client + +Copyright 2009-2011 Sebastian Kaspari + +This file is part of Yaaic. + +Yaaic is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Yaaic is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Yaaic. If not, see . + */ +package org.yaaic.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.MotionEvent; +import android.widget.Gallery; + +/** + * Conversation gallery for horizontal scrolling + * + * @author Thomas Martitz + */ +public class ConversationGallery extends Gallery +{ + /** + * Create a new conversation gallery + * + * @param context + * @param attrs + */ + public ConversationGallery(Context context, AttributeSet attrs) + { + super(context, attrs); + } + + /** + * On Fling: Reduce sensitivity of the channel gallery view + */ + @Override + public boolean onFling (MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) + { + /* Reduce sensitivity based on f(x) = x * 0.925^y with y = (|x/500| - 1) + * The goal is to reduce higher velocities stronger than low ones + * 500 is the base, i.e. it will not reduced. */ + final float fexp = Math.abs(velocityX / 500.0f) - 1; + velocityX *= Math.pow(0.925, fexp); + + return super.onFling(e1, e2, velocityX, velocityY); + } +}