I need to create a modal alert with some animated progress indicator. I've found this example below, and I'd like to create something like this:
I already know how to implement the circular progress indicator, but this effect at the end is new to me.
Has anyone seen a similar effect? (Circular progress indicator with effect in the end)
Is this some kind of gif? And if it is, how can I add a gif to a view on Android?
You can use this well known library AnimCheckBox. Here is an screenshot what will you get.
How to use?
Add this dependency to your app level build.gradle
dependencies{
compile 'com.hanks.animatecheckbox:library:0.1'
}
Then in your layout.xml
<com.hanks.library.AnimateCheckBox
android:layout_width="50dp"
android:layout_height="50dp"
android:padding="15dp"
app:animDuration="200"
app:checkedColor="#00f"
app:lineColor="#fff"
app:lineWidth="1.2dp"
app:unCheckColor="#ff0"/>
Related
I am trying to create a progress bar using default progress bar given in android , I achieved 80% of that required design but i cannot find a code to finish the required design.
this is a required design
given design
i need to bring the rounded part [highlighted in blue ] in my progress bar
finished design
xml code
<ProgressBar
android:id="#+id/ww_progress_bar"
android:visibility="visible"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/circular_shape"
android:progressDrawable="#drawable/circular_progress_bar"
android:textAlignment="center" />
KT class
binding.wwProgressBar.visibility = VISIBLE
binding.wwProgressBar.setProgress(40)
binding.wwProgressBar.max = progressMax
is it possible to bring the required design? can anyone help to finish this design?
you need to use seek bar for it
use custom thumb for it
or
for easy implementation
you can use gihub library
https://github.com/tankery/CircularSeekBar
you should set thumb in your ProgressBar
android:thumb="#drawable/thumb_seekbar"
you can use this link for more information
I am trying to use native Android SDK to create the circular determinate progress bar seen here:
https://material.io/design/components/progress-indicators.html#linear-progress-indicators
I have been reading the docs here:
https://developer.android.com/reference/android/widget/ProgressBar.html
But I can't figure it out. It seems determinate is only able to be used with horizontal progress bar.
I found this stackoverlfow topic here - Android Circular Determinate ProgressBar - but it ussing a custom drawable. Because we can make an indetermiante circular spinner as easily as this:
<ProgressBar
android:id="#+id/determinateBar"
style="#android:style/Widget.ProgressBar.Normal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"/>
I was hoping to just add android:progress="1" and android:indeterminate="false" to get the circular determinate spinner we see above but this is not working.
How can i create circle progress bar on wear border like on video(1:30)? This is built-in widget or custom? I didn't find any information about this.
screen from video
Checkout the DelayedConfirmationView from wearable support library.
If you scroll down about half way through this page you'll see the XAML for the Circular Progress Bar:
https://developer.android.com/reference/android/widget/ProgressBar.html
<ProgressBar
android:id="#+id/indeterminateBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
The IndeterminateBar is default to Circle as it's undefined the actual 'Progress'
There are lots of custom libraries for achieving the FAB menu thing. But I want it to be done without using any custom libraries. I want to achieve this FAB Menu natively.
Please don't suggest me any custom library
You can go for android's design library. add this gradle in to your build file
compile 'com.android.support:design:23.0.1'
and follow this link, which is a stackoverflow link tells how to use. and this is the link of an sample app.
Example :
<android.support.design.widget.FloatingActionButton
android:id="#+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:clickable="true"
android:src="#drawable/ic_done"
app:layout_anchor="#id/viewA"
app:layout_anchorGravity="bottom|right|end"/>
you can create multiple fab and play with its visibility
UPDATE
I think you have to use third party library to do this. please go through this library, this might help you
add this dependency to the app build.gradle
compile 'com.android.support:design:23.1.0'
compile 'com.github.clans:fab:1.6.2'
Add follow the below link Floating Action Menu
You could do this natively using visibility...
Each press on the FAB (ImageView) will toggle visibility with an animation.
I won't write a working sample code, but this should be enough info to help implement a custom floating action button in this way.
XML
android:onClick="fabMainClicked"
JAVA
public void fabMainClicked(View view)
{
ImageView fabDrop1 = (ImageView) findViewById(R.id.fabDrop1);
ImageView fabDrop2 = (ImageView) findViewById(R.id.fabDrop2);
if (fabDrop1.getVisibility() == fabDrop1.GONE)
{
fabDrop1.setVisibility(fabDrop1.VISIBLE);
fabDrop2.setVisibility(fabDrop2.VISIBLE);
}
}
Each ImageView will need to be animated via a custom animator to slide up or onto the screen.
Each ImageView will use a res/drawable as the background to provide a circle and a res/drawable for the center image.
Scale type should be set to center.
Good luck.
I try to customize seek bar like below
But problem is that
-thumb image not set with text
-thumb position can not set above seekbar.
-android:progressDrawable should not repeat as below
My Code is as below:
<SeekBar
android:id="#+id/volume_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:max="100"
android:progress="20"
android:progressDrawable="#drawable/bar"
android:secondaryProgress="0"
android:thumb="#drawable/greenarrow" />
I've tried doing this, but I ran into problems with response time the way I did it. Having to move the margins took a lot of processing power and time. It was close to 400-500ms. So I had to remove it.
However, here are the steps I took:
First, I would suggest creating a frame layout to hold both the SeekBar and a TextView. Then, depending on the percentage of the progress bar, you can set the TextViews layout property margins.
Does that make sense?
If you would like specific code, I can get that to you, but google does pretty good too. :)
Option B: Android seekbar with custom thumb having dynamic text inside it