A handy library to show custom congratulations screen (uses confetti library and animations library)
implementation 'com.github.NiDaAppDev:Congratulator:0.1.2'
(An example app is attached)
Here's a code that's showing a CongratulationView:
CongratulationView congratulator = new CongratulationView.Builder(activity)
.setTitle(title)
.setContent(content)
.setImageRes(imageRes)
.enableSound(enable)
.enableImage(isImageEnabled, isImageAnimationEnabled)
.setConfettiColors(confettiColors)
.show();
setTitle(String) Title is the "Congratulation!" in the gif above.
setContent(String) Content is the "Well Done!" in the gif above.
setImageRes(int) ImageRes is the resource id of the image (trophy in the gif above).
enableSound(boolean) Determines whether a sound is played when showing or not.
enableImage(boolean, boolean) Determines whether the image is showing or not, and whether it's animated or not.
setConfettiColors(int[]) Confetti colors are the colors of the confetti particles in the gif above.
Suggestions and requests are more than welcome, and I'll try to address them as soon as I can.
MIT License
Copyright (c) 2022 Nitzan Daloomy
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
