Example usage for android.support.v4.view PagerSlidingTabStrip setIndicatorColorResource

List of usage examples for android.support.v4.view PagerSlidingTabStrip setIndicatorColorResource

Introduction

In this page you can find the example usage for android.support.v4.view PagerSlidingTabStrip setIndicatorColorResource.

Prototype

public void setIndicatorColorResource(int resId) 

Source Link

Usage

From source file:im.AfriChat.messenger.app.view.keyboard.emoji.EmojiKeyboard.java

@Override
protected View createView() {
    View emojiPagerView = LayoutInflater.from(activity).inflate(R.layout.emoji_smiles_pager, null);

    final ViewPager emojiPager = (ViewPager) emojiPagerView.findViewById(R.id.emoji_pager);

    final PagerSlidingTabStrip emojiPagerIndicator = (PagerSlidingTabStrip) emojiPagerView
            .findViewById(R.id.emoji_pager_indicator);
    View backspace = emojiPagerView.findViewById(R.id.backspace);

    emojiPagerIndicator.setTabBackground(R.drawable.clickable_background);
    emojiPagerIndicator.setIndicatorColorResource(R.color.primary);
    emojiPagerIndicator.setIndicatorHeight(Screen.dp(2));
    emojiPagerIndicator.setDividerColor(0x00000000);
    emojiPagerIndicator.setUnderlineHeight(0);
    emojiPagerIndicator.setTabLayoutParams(new LinearLayout.LayoutParams(Screen.dp(48), Screen.dp(48)));

    backspace.setOnTouchListener(new RepeatListener(500, 100, new OnClickListener() {
        @Override//from  w w w.j a va  2s.  c  o m
        public void onClick(View v) {
            onBackspaceClick(v);
        }
    }));

    final SmilePagerAdapter mEmojisAdapter = new SmilePagerAdapter(this);

    emojiPager.setAdapter(mEmojisAdapter);
    emojiPagerIndicator.setViewPager(emojiPager);

    //emojiPagerIndicator.setLayoutParams(new RelativeLayout.LayoutParams(Screen.dp(58 * mEmojisAdapter.getCount()), Screen.dp(48)));
    //        emojiPager.postDelayed(new Runnable() {
    //            @Override
    //            public void run() {
    //                emojiPager.setAlpha(0f);
    //                emojiPagerIndicator.setAlpha(0f);
    //                animateView(emojiPager);
    //                animateView(emojiPagerIndicator);
    //                emojiPager.setAdapter(mEmojisAdapter);
    //                emojiPagerIndicator.setViewPager(emojiPager);
    //            }
    //        }, BINDING_DELAY);
    return emojiPagerView;
}