Android Open Source - EmojiEverywhere Emoji Horizontal Scroll View






From Project

Back to project page EmojiEverywhere.

License

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.

Java Source Code

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);
    }


}




Java Source Code List

emoji.sithagi.com.emojieverywhere.EmijiView.java
emoji.sithagi.com.emojieverywhere.EmojiHorizontalScrollView.java
emojicon.EmojiAdapter.java
emojicon.EmojiconEditText.java
emojicon.EmojiconGridFragment.java
emojicon.EmojiconHandler.java
emojicon.EmojiconSpan.java
emojicon.EmojiconTextView.java
emojicon.EmojiconsFragment.java
emojicon.emoji.Emojicon.java
emojicon.emoji.Nature.java
emojicon.emoji.Objects.java
emojicon.emoji.People.java
emojicon.emoji.Places.java
emojicon.emoji.Symbols.java