Back to project page EmojiEverywhere.
The source code is released under:
GNU General Public License
If you think the Android project EmojiEverywhere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package emoji.sithagi.com.emojieverywhere; /* w w w . j a va 2 s . com*/ import android.content.Context; import android.os.Handler; import android.util.AttributeSet; import android.widget.HorizontalScrollView; public class EmojiHorizontalScrollView extends HorizontalScrollView { private boolean mStartScroll; public EmojiHorizontalScrollView(Context context) { this(context, null, 0); } public EmojiHorizontalScrollView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public EmojiHorizontalScrollView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { // Log.i("Scrolling", "X from ["+oldl+"] to ["+l+"]"); if (oldl < l && !mStartScroll) { mStartScroll = true; new Handler().postDelayed(new Runnable() { public void run() { fullScroll(HorizontalScrollView.FOCUS_RIGHT); mStartScroll = false; } }, 100L); } else if (l < oldl && !mStartScroll) { mStartScroll = true; new Handler().postDelayed(new Runnable() { public void run() { fullScroll(HorizontalScrollView.FOCUS_LEFT); mStartScroll = false; } }, 100L); } // fullScroll(HorizontalScrollView.FOCUS_LEFT); // temporary disable scroll super.onScrollChanged(l, t, oldl, oldt); } }