Button not applying accentColor
This is the button layout
<Button
android:id="@+id/retry_button"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
.../>
colors.xml
<resources>
<color name="colorPrimary">#1da1f2</color>
<color name="colorPrimaryDark">#1b95e0</color>
<color name="colorAccent">#003e59</color>
</resources>
styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowContentTransitions">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Screenshot from layout preview
Screenshot from device and emulator
Why the accentColor is not applied at background button on device?
android xml
add a comment |
This is the button layout
<Button
android:id="@+id/retry_button"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
.../>
colors.xml
<resources>
<color name="colorPrimary">#1da1f2</color>
<color name="colorPrimaryDark">#1b95e0</color>
<color name="colorAccent">#003e59</color>
</resources>
styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowContentTransitions">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Screenshot from layout preview
Screenshot from device and emulator
Why the accentColor is not applied at background button on device?
android xml
class SplashScreen : AppCompatActivity()
– Bruno Diego Martins
Nov 23 '18 at 0:15
add a comment |
This is the button layout
<Button
android:id="@+id/retry_button"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
.../>
colors.xml
<resources>
<color name="colorPrimary">#1da1f2</color>
<color name="colorPrimaryDark">#1b95e0</color>
<color name="colorAccent">#003e59</color>
</resources>
styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowContentTransitions">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Screenshot from layout preview
Screenshot from device and emulator
Why the accentColor is not applied at background button on device?
android xml
This is the button layout
<Button
android:id="@+id/retry_button"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
.../>
colors.xml
<resources>
<color name="colorPrimary">#1da1f2</color>
<color name="colorPrimaryDark">#1b95e0</color>
<color name="colorAccent">#003e59</color>
</resources>
styles.xml
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowContentTransitions">true</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
Screenshot from layout preview
Screenshot from device and emulator
Why the accentColor is not applied at background button on device?
android xml
android xml
asked Nov 22 '18 at 23:58
Bruno Diego MartinsBruno Diego Martins
828
828
class SplashScreen : AppCompatActivity()
– Bruno Diego Martins
Nov 23 '18 at 0:15
add a comment |
class SplashScreen : AppCompatActivity()
– Bruno Diego Martins
Nov 23 '18 at 0:15
class SplashScreen : AppCompatActivity()
– Bruno Diego Martins
Nov 23 '18 at 0:15
class SplashScreen : AppCompatActivity()
– Bruno Diego Martins
Nov 23 '18 at 0:15
add a comment |
2 Answers
2
active
oldest
votes
I've found the error.
I set the theme below at this specific Activity:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
To fix, I created this style:
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
And applied:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/AppTheme.NoActionBar">
good. I think my comment helped you :D
– Momen Zaqout
Nov 23 '18 at 0:27
add a comment |
in your Manifest
add the theme
<application
android:theme="@style/AppTheme"
/>
This is already applied.
– Bruno Diego Martins
Nov 23 '18 at 0:20
1
do you have "android:theme.." in your activity inside the manifest?
– Momen Zaqout
Nov 23 '18 at 0:22
@BrunoDiego try to remove this line style="@style/Widget.AppCompat.Button.Colored"
– Momen Zaqout
Nov 23 '18 at 0:23
Doing it, I would get the grey default style. :( But I found the error and the fix, I posted below. Tks
– Bruno Diego Martins
Nov 23 '18 at 0:25
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%2f53439232%2fbutton-not-applying-accentcolor%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I've found the error.
I set the theme below at this specific Activity:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
To fix, I created this style:
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
And applied:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/AppTheme.NoActionBar">
good. I think my comment helped you :D
– Momen Zaqout
Nov 23 '18 at 0:27
add a comment |
I've found the error.
I set the theme below at this specific Activity:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
To fix, I created this style:
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
And applied:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/AppTheme.NoActionBar">
good. I think my comment helped you :D
– Momen Zaqout
Nov 23 '18 at 0:27
add a comment |
I've found the error.
I set the theme below at this specific Activity:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
To fix, I created this style:
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
And applied:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/AppTheme.NoActionBar">
I've found the error.
I set the theme below at this specific Activity:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
To fix, I created this style:
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
And applied:
<activity android:name=".view.activity.SplashScreen"
android:theme="@style/AppTheme.NoActionBar">
answered Nov 23 '18 at 0:24
Bruno Diego MartinsBruno Diego Martins
828
828
good. I think my comment helped you :D
– Momen Zaqout
Nov 23 '18 at 0:27
add a comment |
good. I think my comment helped you :D
– Momen Zaqout
Nov 23 '18 at 0:27
good. I think my comment helped you :D
– Momen Zaqout
Nov 23 '18 at 0:27
good. I think my comment helped you :D
– Momen Zaqout
Nov 23 '18 at 0:27
add a comment |
in your Manifest
add the theme
<application
android:theme="@style/AppTheme"
/>
This is already applied.
– Bruno Diego Martins
Nov 23 '18 at 0:20
1
do you have "android:theme.." in your activity inside the manifest?
– Momen Zaqout
Nov 23 '18 at 0:22
@BrunoDiego try to remove this line style="@style/Widget.AppCompat.Button.Colored"
– Momen Zaqout
Nov 23 '18 at 0:23
Doing it, I would get the grey default style. :( But I found the error and the fix, I posted below. Tks
– Bruno Diego Martins
Nov 23 '18 at 0:25
add a comment |
in your Manifest
add the theme
<application
android:theme="@style/AppTheme"
/>
This is already applied.
– Bruno Diego Martins
Nov 23 '18 at 0:20
1
do you have "android:theme.." in your activity inside the manifest?
– Momen Zaqout
Nov 23 '18 at 0:22
@BrunoDiego try to remove this line style="@style/Widget.AppCompat.Button.Colored"
– Momen Zaqout
Nov 23 '18 at 0:23
Doing it, I would get the grey default style. :( But I found the error and the fix, I posted below. Tks
– Bruno Diego Martins
Nov 23 '18 at 0:25
add a comment |
in your Manifest
add the theme
<application
android:theme="@style/AppTheme"
/>
in your Manifest
add the theme
<application
android:theme="@style/AppTheme"
/>
answered Nov 23 '18 at 0:16
Momen ZaqoutMomen Zaqout
5671410
5671410
This is already applied.
– Bruno Diego Martins
Nov 23 '18 at 0:20
1
do you have "android:theme.." in your activity inside the manifest?
– Momen Zaqout
Nov 23 '18 at 0:22
@BrunoDiego try to remove this line style="@style/Widget.AppCompat.Button.Colored"
– Momen Zaqout
Nov 23 '18 at 0:23
Doing it, I would get the grey default style. :( But I found the error and the fix, I posted below. Tks
– Bruno Diego Martins
Nov 23 '18 at 0:25
add a comment |
This is already applied.
– Bruno Diego Martins
Nov 23 '18 at 0:20
1
do you have "android:theme.." in your activity inside the manifest?
– Momen Zaqout
Nov 23 '18 at 0:22
@BrunoDiego try to remove this line style="@style/Widget.AppCompat.Button.Colored"
– Momen Zaqout
Nov 23 '18 at 0:23
Doing it, I would get the grey default style. :( But I found the error and the fix, I posted below. Tks
– Bruno Diego Martins
Nov 23 '18 at 0:25
This is already applied.
– Bruno Diego Martins
Nov 23 '18 at 0:20
This is already applied.
– Bruno Diego Martins
Nov 23 '18 at 0:20
1
1
do you have "android:theme.." in your activity inside the manifest?
– Momen Zaqout
Nov 23 '18 at 0:22
do you have "android:theme.." in your activity inside the manifest?
– Momen Zaqout
Nov 23 '18 at 0:22
@BrunoDiego try to remove this line style="@style/Widget.AppCompat.Button.Colored"
– Momen Zaqout
Nov 23 '18 at 0:23
@BrunoDiego try to remove this line style="@style/Widget.AppCompat.Button.Colored"
– Momen Zaqout
Nov 23 '18 at 0:23
Doing it, I would get the grey default style. :( But I found the error and the fix, I posted below. Tks
– Bruno Diego Martins
Nov 23 '18 at 0:25
Doing it, I would get the grey default style. :( But I found the error and the fix, I posted below. Tks
– Bruno Diego Martins
Nov 23 '18 at 0:25
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%2f53439232%2fbutton-not-applying-accentcolor%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
class SplashScreen : AppCompatActivity()
– Bruno Diego Martins
Nov 23 '18 at 0:15