How to apply ProgressBarStyle?
I'm trying to apply a theme to all of the progress bars in my application. In the manifest, I apply a custom theme called AppTheme
. Within this style, I add an additional progressBarStyle
item like so:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
...
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
And I define the custom bar progress style as such:
<style name="my_progress_bar" parent="Base.Widget.AppCompat.ProgressBar">
<item name="android:indeterminateTint">@color/app_black</item>
<item name="android:indeterminateTintMode">src_in</item>
</style>
If I apply this style to individual ProgressBar views, it works, but I want to apply it in my manifest through the AppTheme so that I don't have to specify the same tint and tintMode for every progress bar across the app. I am using a device running API 25.
What am I doing wrong? Thanks for any insight.
Edit: after further investigation, for some reason adding the style to the AppTheme doesn't propagate through to the manifest. If I replace the AppTheme with my progress bar style entirely, it works. But I still need the styles defined in AppTheme
.
this works:
<application ...
android:theme="@style/my_progress_bar">
but this does not:
<application ...
android:theme="@style/AppTheme">
What's interesting is that if I remove everything in AppTheme except for the progress bar styling I define, it doesn't work. Is there a bug with nested styles in android? My manifest doesn't see the progressBarStyle defined when I just pass it this AppTheme:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
android android-manifest android-theme android-progressbar
add a comment |
I'm trying to apply a theme to all of the progress bars in my application. In the manifest, I apply a custom theme called AppTheme
. Within this style, I add an additional progressBarStyle
item like so:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
...
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
And I define the custom bar progress style as such:
<style name="my_progress_bar" parent="Base.Widget.AppCompat.ProgressBar">
<item name="android:indeterminateTint">@color/app_black</item>
<item name="android:indeterminateTintMode">src_in</item>
</style>
If I apply this style to individual ProgressBar views, it works, but I want to apply it in my manifest through the AppTheme so that I don't have to specify the same tint and tintMode for every progress bar across the app. I am using a device running API 25.
What am I doing wrong? Thanks for any insight.
Edit: after further investigation, for some reason adding the style to the AppTheme doesn't propagate through to the manifest. If I replace the AppTheme with my progress bar style entirely, it works. But I still need the styles defined in AppTheme
.
this works:
<application ...
android:theme="@style/my_progress_bar">
but this does not:
<application ...
android:theme="@style/AppTheme">
What's interesting is that if I remove everything in AppTheme except for the progress bar styling I define, it doesn't work. Is there a bug with nested styles in android? My manifest doesn't see the progressBarStyle defined when I just pass it this AppTheme:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
android android-manifest android-theme android-progressbar
add a comment |
I'm trying to apply a theme to all of the progress bars in my application. In the manifest, I apply a custom theme called AppTheme
. Within this style, I add an additional progressBarStyle
item like so:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
...
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
And I define the custom bar progress style as such:
<style name="my_progress_bar" parent="Base.Widget.AppCompat.ProgressBar">
<item name="android:indeterminateTint">@color/app_black</item>
<item name="android:indeterminateTintMode">src_in</item>
</style>
If I apply this style to individual ProgressBar views, it works, but I want to apply it in my manifest through the AppTheme so that I don't have to specify the same tint and tintMode for every progress bar across the app. I am using a device running API 25.
What am I doing wrong? Thanks for any insight.
Edit: after further investigation, for some reason adding the style to the AppTheme doesn't propagate through to the manifest. If I replace the AppTheme with my progress bar style entirely, it works. But I still need the styles defined in AppTheme
.
this works:
<application ...
android:theme="@style/my_progress_bar">
but this does not:
<application ...
android:theme="@style/AppTheme">
What's interesting is that if I remove everything in AppTheme except for the progress bar styling I define, it doesn't work. Is there a bug with nested styles in android? My manifest doesn't see the progressBarStyle defined when I just pass it this AppTheme:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
android android-manifest android-theme android-progressbar
I'm trying to apply a theme to all of the progress bars in my application. In the manifest, I apply a custom theme called AppTheme
. Within this style, I add an additional progressBarStyle
item like so:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
...
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
And I define the custom bar progress style as such:
<style name="my_progress_bar" parent="Base.Widget.AppCompat.ProgressBar">
<item name="android:indeterminateTint">@color/app_black</item>
<item name="android:indeterminateTintMode">src_in</item>
</style>
If I apply this style to individual ProgressBar views, it works, but I want to apply it in my manifest through the AppTheme so that I don't have to specify the same tint and tintMode for every progress bar across the app. I am using a device running API 25.
What am I doing wrong? Thanks for any insight.
Edit: after further investigation, for some reason adding the style to the AppTheme doesn't propagate through to the manifest. If I replace the AppTheme with my progress bar style entirely, it works. But I still need the styles defined in AppTheme
.
this works:
<application ...
android:theme="@style/my_progress_bar">
but this does not:
<application ...
android:theme="@style/AppTheme">
What's interesting is that if I remove everything in AppTheme except for the progress bar styling I define, it doesn't work. Is there a bug with nested styles in android? My manifest doesn't see the progressBarStyle defined when I just pass it this AppTheme:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:progressBarStyle">@style/my_progress_bar</item>
</style>
android android-manifest android-theme android-progressbar
android android-manifest android-theme android-progressbar
edited Nov 14 '18 at 18:30
Nick Borisenko
asked Nov 13 '18 at 16:01
Nick BorisenkoNick Borisenko
314114
314114
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In your manifest file, you have the following:
<application
android:name="app"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
.......
</application>
add the following to your AppTheme within your style.xml file:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<!--This will change the color of your progress bar throughout the whole app-->
<item name="colorControlActivated">@color/app_black</item>
</style>
unfortunately,colorControlActivated
item does fix the issue for me
– Nick Borisenko
Nov 13 '18 at 18:30
does or does not?
– Red M
Nov 13 '18 at 19:09
apologies, I mean't does not
– Nick Borisenko
Nov 13 '18 at 19:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284897%2fhow-to-apply-progressbarstyle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In your manifest file, you have the following:
<application
android:name="app"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
.......
</application>
add the following to your AppTheme within your style.xml file:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<!--This will change the color of your progress bar throughout the whole app-->
<item name="colorControlActivated">@color/app_black</item>
</style>
unfortunately,colorControlActivated
item does fix the issue for me
– Nick Borisenko
Nov 13 '18 at 18:30
does or does not?
– Red M
Nov 13 '18 at 19:09
apologies, I mean't does not
– Nick Borisenko
Nov 13 '18 at 19:13
add a comment |
In your manifest file, you have the following:
<application
android:name="app"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
.......
</application>
add the following to your AppTheme within your style.xml file:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<!--This will change the color of your progress bar throughout the whole app-->
<item name="colorControlActivated">@color/app_black</item>
</style>
unfortunately,colorControlActivated
item does fix the issue for me
– Nick Borisenko
Nov 13 '18 at 18:30
does or does not?
– Red M
Nov 13 '18 at 19:09
apologies, I mean't does not
– Nick Borisenko
Nov 13 '18 at 19:13
add a comment |
In your manifest file, you have the following:
<application
android:name="app"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
.......
</application>
add the following to your AppTheme within your style.xml file:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<!--This will change the color of your progress bar throughout the whole app-->
<item name="colorControlActivated">@color/app_black</item>
</style>
In your manifest file, you have the following:
<application
android:name="app"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
.......
</application>
add the following to your AppTheme within your style.xml file:
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
<!--This will change the color of your progress bar throughout the whole app-->
<item name="colorControlActivated">@color/app_black</item>
</style>
answered Nov 13 '18 at 16:46
Red MRed M
98631127
98631127
unfortunately,colorControlActivated
item does fix the issue for me
– Nick Borisenko
Nov 13 '18 at 18:30
does or does not?
– Red M
Nov 13 '18 at 19:09
apologies, I mean't does not
– Nick Borisenko
Nov 13 '18 at 19:13
add a comment |
unfortunately,colorControlActivated
item does fix the issue for me
– Nick Borisenko
Nov 13 '18 at 18:30
does or does not?
– Red M
Nov 13 '18 at 19:09
apologies, I mean't does not
– Nick Borisenko
Nov 13 '18 at 19:13
unfortunately,
colorControlActivated
item does fix the issue for me– Nick Borisenko
Nov 13 '18 at 18:30
unfortunately,
colorControlActivated
item does fix the issue for me– Nick Borisenko
Nov 13 '18 at 18:30
does or does not?
– Red M
Nov 13 '18 at 19:09
does or does not?
– Red M
Nov 13 '18 at 19:09
apologies, I mean't does not
– Nick Borisenko
Nov 13 '18 at 19:13
apologies, I mean't does not
– Nick Borisenko
Nov 13 '18 at 19:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53284897%2fhow-to-apply-progressbarstyle%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown