Search in sources :

Example 1 with WavesClippingTransform

use of com.github.jorgecastillo.clippingtransforms.WavesClippingTransform in project AndroidFillableLoaders by JorgeCastilloPrz.

the class FillableLoaderPage method setupFillableLoader.

private void setupFillableLoader(int pageNum) {
    if (pageNum == 3) {
        int viewSize = getResources().getDimensionPixelSize(R.dimen.fourthSampleViewSize);
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(viewSize, viewSize);
        params.gravity = Gravity.CENTER;
        FillableLoaderBuilder loaderBuilder = new FillableLoaderBuilder();
        fillableLoader = loaderBuilder.parentView((FrameLayout) rootView).svgPath(Paths.JOB_AND_TALENT).layoutParams(params).originalDimensions(970, 970).strokeColor(Color.parseColor("#1c9ade")).fillColor(Color.parseColor("#1c9ade")).strokeDrawingDuration(2000).clippingTransform(new WavesClippingTransform()).fillDuration(10000).build();
    } else if (pageNum == 6) {
        int viewSize = getResources().getDimensionPixelSize(R.dimen.fourthSampleViewSize);
        FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(viewSize, viewSize);
        params.gravity = Gravity.CENTER;
        SeekBar mSeekbar = (SeekBar) rootView.findViewById(R.id.PercentageSeekBar);
        mSeekbar.setProgress(mPercentage);
        mSeekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
                mPercentage = progress;
                fillableLoader.setPercentage(progress);
            }

            public void onStartTrackingTouch(SeekBar seekBar) {
            }

            public void onStopTrackingTouch(SeekBar seekBar) {
            }
        });
        FillableLoaderBuilder loaderBuilder = new FillableLoaderBuilder();
        fillableLoader = loaderBuilder.parentView((FrameLayout) rootView).svgPath(Paths.JOB_AND_TALENT).layoutParams(params).percentage(mPercentage).originalDimensions(970, 970).strokeColor(Color.parseColor("#1c9ade")).fillColor(Color.parseColor("#1c9ade")).strokeDrawingDuration(2000).clippingTransform(new WavesClippingTransform()).fillDuration(10000).build();
    } else {
        fillableLoader.setSvgPath(pageNum == 0 ? Paths.INDOMINUS_REX : pageNum == 1 ? Paths.RONALDO : pageNum == 2 ? Paths.SEGA : pageNum == 4 ? Paths.COCA_COLA : Paths.GITHUB);
    }
    fillableLoader.setOnStateChangeListener(this);
}
Also used : SeekBar(android.widget.SeekBar) FrameLayout(android.widget.FrameLayout) WavesClippingTransform(com.github.jorgecastillo.clippingtransforms.WavesClippingTransform)

Aggregations

FrameLayout (android.widget.FrameLayout)1 SeekBar (android.widget.SeekBar)1 WavesClippingTransform (com.github.jorgecastillo.clippingtransforms.WavesClippingTransform)1