Button not applying accentColor












0















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



enter image description here



Screenshot from device and emulator



enter image description here



Why the accentColor is not applied at background button on device?










share|improve this question























  • class SplashScreen : AppCompatActivity()

    – Bruno Diego Martins
    Nov 23 '18 at 0:15
















0















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



enter image description here



Screenshot from device and emulator



enter image description here



Why the accentColor is not applied at background button on device?










share|improve this question























  • class SplashScreen : AppCompatActivity()

    – Bruno Diego Martins
    Nov 23 '18 at 0:15














0












0








0


1






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



enter image description here



Screenshot from device and emulator



enter image description here



Why the accentColor is not applied at background button on device?










share|improve this question














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



enter image description here



Screenshot from device and emulator



enter image description here



Why the accentColor is not applied at background button on device?







android xml






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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



















  • 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












2 Answers
2






active

oldest

votes


















2














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">





share|improve this answer
























  • good. I think my comment helped you :D

    – Momen Zaqout
    Nov 23 '18 at 0:27



















0














in your Manifest



add the theme



<application
android:theme="@style/AppTheme"
/>





share|improve this answer
























  • 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













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
});


}
});














draft saved

draft discarded


















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









2














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">





share|improve this answer
























  • good. I think my comment helped you :D

    – Momen Zaqout
    Nov 23 '18 at 0:27
















2














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">





share|improve this answer
























  • good. I think my comment helped you :D

    – Momen Zaqout
    Nov 23 '18 at 0:27














2












2








2







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">





share|improve this answer













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">






share|improve this answer












share|improve this answer



share|improve this answer










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



















  • 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













0














in your Manifest



add the theme



<application
android:theme="@style/AppTheme"
/>





share|improve this answer
























  • 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


















0














in your Manifest



add the theme



<application
android:theme="@style/AppTheme"
/>





share|improve this answer
























  • 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
















0












0








0







in your Manifest



add the theme



<application
android:theme="@style/AppTheme"
/>





share|improve this answer













in your Manifest



add the theme



<application
android:theme="@style/AppTheme"
/>






share|improve this answer












share|improve this answer



share|improve this answer










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





















  • 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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







這個網誌中的熱門文章

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Xamarin.form Move up view when keyboard appear

JBPM : POST request for execute process go wrong