Example usage for android.content.res ColorStateList valueOf

List of usage examples for android.content.res ColorStateList valueOf

Introduction

In this page you can find the example usage for android.content.res ColorStateList valueOf.

Prototype

@NonNull
public static ColorStateList valueOf(@ColorInt int color) 

Source Link

Usage

From source file:com.example.michaelg.myapplication.Item.discreteseekbar.DiscreteSeekBar.java

/**
 * Sets the color of the seek thumb, as well as the color of the popup indicator.
 *
 * @param thumbColor     The color the seek thumb will be changed to
 * @param indicatorColor The color the popup indicator will be changed to
 *                       The indicator will animate from thumbColor to indicatorColor
 *                       when opening//from ww  w  . ja  va2  s  .c om
 */
public void setThumbColor(int thumbColor, int indicatorColor) {
    mThumb.setColorStateList(ColorStateList.valueOf(thumbColor));
    mIndicator.setColors(indicatorColor, thumbColor);
}

From source file:com.forum.lottery.view.PagerSlidingTabStrip.java

public void setTextColor(int textColor) {
    this.tabTextColor = ColorStateList.valueOf(textColor);
    updateTabStyles();
}

From source file:com.hcy.suzhoubusquery.utils.PagerSlidingTabStrip.java

public void setTextColor(int color) {
    this.tabTextColor = ColorStateList.valueOf(color);
    updateTabStyles();
}

From source file:com.itheima.googlemarket.PagerSlidingTabStrip.java

public void setTextColorResource(int resId) {
    this.tabTextColor = ColorStateList.valueOf(getResources().getColor(resId));
    updateTabStyles();
}

From source file:com.rks.musicx.ui.fragments.PlayingViews.Playing4Fragment.java

private void colorMode(int color) {
    if (getActivity() == null || getActivity().getWindow() == null) {
        return;/* w  ww. java2s.c o  m*/
    }
    if (Extras.getInstance().getDarkTheme() || Extras.getInstance().getBlackTheme()) {
        getActivity().getWindow().setNavigationBarColor(color);
        getActivity().getWindow().setStatusBarColor(color);
        seekbar.setBackgroundTintList(ColorStateList.valueOf(color));
        if (vizualview != null) {
            vizualview.setmCakeColor(color);
        }
        playpausebutton.setBackgroundTintList(ColorStateList.valueOf(color));
        queueClick.setBackgroundTintList(ColorStateList.valueOf(color));
    } else {
        getActivity().getWindow().setNavigationBarColor(color);
        seekbar.setBackgroundTintList(ColorStateList.valueOf(color));
        getActivity().getWindow().setStatusBarColor(color);
        if (vizualview != null) {
            vizualview.setmCakeColor(color);
        }
        playpausebutton.setBackgroundTintList(ColorStateList.valueOf(color));
        queueClick.setBackgroundTintList(ColorStateList.valueOf(color));
    }

}

From source file:com.example.michaelg.myapplication.Item.discreteseekbar.DiscreteSeekBar.java

/**
 * Sets the color of the seekbar scrubber
 *
 * @param color The color the track  scrubber will be changed to
 *//*from   w w w  .  j  a v a2 s . c  o m*/
public void setScrubberColor(int color) {
    mScrubber.setColorStateList(ColorStateList.valueOf(color));
}

From source file:org.huxizhijian.hhcomicviewer.ui.entry.ComicDetailsActivity.java

private void initData() {
    if (mComic == null) {
        mBinding.FABComicDetails.setBackgroundTintList(ColorStateList.valueOf(Color.GRAY));
    }//from   w  ww.ja  v a2  s.c om
    mComic = mComicDBHelper.findByCid(mCid);
    if (CommonUtils.getAPNType(this) == CommonUtils.NONEWTWORK) {
        mBinding.FABComicDetails
                .setBackgroundTintList(ColorStateList.valueOf(getResources().getColor(R.color.colorAccent)));
        Toast.makeText(this, Constants.NO_NETWORK, Toast.LENGTH_SHORT).show();
        if (mComic.getChapterName() != null) {
            mHandler.sendEmptyMessageDelayed(MSG_UPDATE_VIEW, 600);
        }
    } else {
        mPresenter = new ComicDetailsPresenter(this);
        mPresenter.getComic(mCid, mComic);
    }
    mReceiver = new ComicChapterDownloadUpdateReceiver();
}

From source file:com.ekuater.labelchat.ui.widget.PagerSlidingTabStrip.java

public void setTabTextColor(int color) {
    this.tabTextColor = ColorStateList.valueOf(color);
    updateTabStyles();
}

From source file:com.sbgapps.scoreit.ScoreItActivity.java

public void removeLap(final Lap lap) {
    final int position = mGameManager.removeLap(lap);

    mHeaderFragment.update();// w  w  w . j av a2s.c  om
    if (mScoreListFragment.isVisible())
        mScoreListFragment.getListAdapter().notifyItemRemoved(position);
    if (mScoreChartFragment.isVisible())
        mScoreChartFragment.update();

    invalidateOptionsMenu();

    View view = findViewById(R.id.coordinator);
    if (view != null) {
        mSnackBar = Snackbar.make(view, R.string.snackbar_msg_on_lap_deleted, Snackbar.LENGTH_LONG);
        mSnackBar.setAction(R.string.snackbar_action_on_lap_deleted, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                int p = position;
                if (p > mGameManager.getLaps().size())
                    p = mGameManager.getLaps().size();

                mGameManager.getLaps().add(p, lap);
                mHeaderFragment.update();
                if (mScoreListFragment.isVisible())
                    mScoreListFragment.getListAdapter().notifyItemInserted(position);
                if (mScoreChartFragment.isVisible())
                    mScoreChartFragment.update();
                invalidateOptionsMenu();
            }
        }).setActionTextColor(ColorStateList.valueOf(ContextCompat.getColor(this, R.color.color_accent)))
                .show();
    }
}

From source file:net.qiujuer.genius.ui.widget.GeniusAbsSeekBar.java

/**
 * Sets the color of the seek thumb, as well as the color of the popup indicator.
 *
 * @param startColor The color the seek thumb will be changed to
 * @param endColor   The color the popup indicator will be changed to
 *//*from w w w .  j av a2s .  c o  m*/
public void setThumbColor(int startColor, int endColor) {
    mSeekBarDrawable.setThumbColor(ColorStateList.valueOf(startColor));
    mIndicator.setColors(startColor, endColor);
}