Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

feat: Wave color customisable #27

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kalaiz
Copy link

@Kalaiz Kalaiz commented Feb 23, 2021

<com.john.waveview.WaveView
        android:id="@+id/wave_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFFFFF"
        wave:above_wave_color="@color/dark_blue"
        wave:blow_wave_color="@color/light_blue"
        wave:above_wave_color_alpha="0.5"
        wave:blow_wave_color_alpha="0.3"
        wave:progress="80"
        wave:wave_height="large"
        wave:wave_hz="normal"
        wave:wave_length="middle" 
        wave:wave_color="@color/holo_purple"
        wave:wave_alpha="0.5"/>
        waveView.setAboveWaveColor(color);
        waveView.setBlowWaveColor(color);
        waveView.setWaveColor(color);
        waveView.setWaveAlpha(0.5f);
        waveView.setAboveWaveColorAlpha(0.3f);
        waveView.setBlowWaveColorAlpha(0.3f);
  • Made default above and below wave color to be that of the actual wave color, instead of white color.
  • Users can make the wave color to be their gradient color. [Gradient fill? #24]

....
wave:background="@drawable/gradient_background"/>

waveView.setWaveBackgroundDrawable(getResources().getDrawable(R.drawable.gradient_background));

feat: Wave background customisable
- Users can  change wave color and the background,
- Made default above and below wave color to be that of the actual wave color.
- Users can make the wave color to be their gradient color by giving appropriate drawable to  setWaveBackground.
@Kalaiz
Copy link
Author

Kalaiz commented Feb 23, 2021

Hey @john990, your custom view is awesome. I have done just a few works on it to address the extensibility aspect in the recent pull requests.

If you want, I will be able to merge #25, #26, #27 into one PR and add some brief unit test ( Situations of setting progress value, changing screen orientation, onPause and onResume etc ) to check if anything breaks.
Sidenote: Each PR is independent and does not depend on it's previous PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant