-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filling progress with drawable texture #39
Comments
Totally quoting!! I want to use a gradient in my progress bar |
I made a temporary implementation while waiting for the official repo to be updated. Step 1 : setupCreate a class with a custom name. In example, let's say CustomDrawableProgressBar.java.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="CustomDrawableProgressBar">
<attr name="rcProgressDrawable" format="reference"></attr>
</declare-styleable>
</resources> where name="rcProgressDrawable" is the name of the attribute to call in the layout.xml, Step 2 : use it!It's simple! Just call your custom attribute on the object you just made, including it in your layout. <com.your.app.package.CustomDrawableProgressBar
android:layout_width="80dp"
android:layout_height="8dp"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_margin="8dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:rcBackgroundPadding="1dp"
app:rcBackgroundColor="#000000"
app:rcProgress="0.3"
app:rcProgressColor="@color/my_progress_bar_color"
app:rcMax="1"
app:rcProgressDrawable="@drawable/my_background_gradient" /> IMPORTANT View.setBackground(Drawable background) before API 17. DemoHere is an example. The grey background is from my external layout, you would not see it if you copy paste. The centered bar position is explained in another issue: #42 I would like to give my thanks to @akexorcist for his awesome work. It really boosted my app development! |
i do everything like that solution but the progress make no effect :(. anything i can try? |
send code and I'll try to help!
2017-02-18 3:56 GMT+01:00 huuchi207 <notifications@github.com>:
… i do everything like that solution but the progress make no effect :(.
anything i can try?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMS8tOzz2e3ivnX0VvIcy1HiPXvVAnNks5rdl3lgaJpZM4G2fUq>
.
|
send code and I'll try to help!
2017-02-18 3:56 GMT+01:00 huuchi207 <notifications@github.com>:
… i do everything like that solution but the progress make no effect :(.
anything i can try?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMS8tOzz2e3ivnX0VvIcy1HiPXvVAnNks5rdl3lgaJpZM4G2fUq>
.
|
Thanks for your thought on my problem. Here is my code:
Value.xml:
button setting in layout.xml:
and gradient_progress_bar.xml:
Help me. Thank u in advance :D |
You'll have to reference the bar in your fragment and manually update it asynchronously. |
Sorry but i have no idea to update this bar asynchronously. Can u give an example? |
I need to know a little more about the context where the bar is used (Activity or Fragment) |
I use it in my fragment. In there, i also have a thread to make an animation to this bar. |
As your process keeps running, you'll just have to update the app:rcProgress attribute. |
I found the way to make an slow updated progressbar animation. My case is progressbar 's gradient. I cant do that. |
CustomRoundCornerProgressBar progressBar =(CustomRoundCornerProgressBar) |
Let me try it. Thank u very much!
Vào 24-02-2017 3:58 CH, "Sergio Sansovini" <notifications@github.com> đã
viết:
… CustomRoundCornerProgressBar progressBar =(CustomRoundCornerProgressBar)
view.findViewById(R.id.progressBar);
progressBar.setProgress( /* Your value here */ );
progressBar.invalidate();
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYeDnZYz7FDJ48c-EvU4dUiruT1qzuQtks5rfpuZgaJpZM4G2fUq>
.
|
You're welcome! Glad to help |
try to remove android:centerX="0.1" in your drawable and tell me if something changes |
there is still no change :( |
can u give me an example project :) |
Hello. Tell me please, can I set drawable resource for progress, not color? Something like
rcProgressDrawable
attribute. I would like to fill progress with drawable texture with tile mode. Can your library provide this feature? If not, is it planned in the future? Thanks in advance.The text was updated successfully, but these errors were encountered: