Search in sources :

Example 1 with ChasingDots

use of com.github.ybq.android.spinkit.style.ChasingDots in project Android-SpinKit by ybq.

the class Page2Fragment method onViewCreated.

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    // ProgressBar
    ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progress);
    DoubleBounce doubleBounce = new DoubleBounce();
    doubleBounce.setBounds(0, 0, 100, 100);
    doubleBounce.setColor(colors[7]);
    progressBar.setIndeterminateDrawable(doubleBounce);
    // Button
    Button button = (Button) view.findViewById(R.id.button);
    mWaveDrawable = new Wave();
    mWaveDrawable.setBounds(0, 0, 100, 100);
    // noinspection deprecation
    mWaveDrawable.setColor(getResources().getColor(R.color.colorAccent));
    button.setCompoundDrawables(mWaveDrawable, null, null, null);
    // TextView
    TextView textView = (TextView) view.findViewById(R.id.text);
    mCircleDrawable = new Circle();
    mCircleDrawable.setBounds(0, 0, 100, 100);
    mCircleDrawable.setColor(Color.WHITE);
    textView.setCompoundDrawables(null, null, mCircleDrawable, null);
    textView.setBackgroundColor(colors[2]);
    // ImageView
    ImageView imageView = (ImageView) view.findViewById(R.id.image);
    mChasingDotsDrawable = new ChasingDots();
    mChasingDotsDrawable.setColor(Color.WHITE);
    imageView.setImageDrawable(mChasingDotsDrawable);
    imageView.setBackgroundColor(colors[0]);
}
Also used : Wave(com.github.ybq.android.spinkit.style.Wave) ChasingDots(com.github.ybq.android.spinkit.style.ChasingDots) Circle(com.github.ybq.android.spinkit.style.Circle) Button(android.widget.Button) DoubleBounce(com.github.ybq.android.spinkit.style.DoubleBounce) TextView(android.widget.TextView) ImageView(android.widget.ImageView) ProgressBar(android.widget.ProgressBar)

Aggregations

Button (android.widget.Button)1 ImageView (android.widget.ImageView)1 ProgressBar (android.widget.ProgressBar)1 TextView (android.widget.TextView)1 ChasingDots (com.github.ybq.android.spinkit.style.ChasingDots)1 Circle (com.github.ybq.android.spinkit.style.Circle)1 DoubleBounce (com.github.ybq.android.spinkit.style.DoubleBounce)1 Wave (com.github.ybq.android.spinkit.style.Wave)1