Git Product home page Git Product logo

Comments (8)

fengdai avatar fengdai commented on August 17, 2024

It uses colorControlActivated as its color:

final int color = getThemeAttrColor(context, R.attr.colorControlActivated);

So, you can specify your color with attribute colorControlActivated in your AlertDialogPro's theme like this:

<style name="YourAlertDialogProTheme">
     ...
    <item name="colorControlActivated">@color/your_color</item>
</style>

Since colorControlActivated use colorAccent by default:

<item name="colorControlActivated">?attr/colorAccent</item>

So you can also specify your color with attribute colorAccent directly:

<style name="YourAlertDialogProTheme">
     ...
    <item name="colorAccent">@color/your_color</item>
</style>

from alertdialogpro.

epint avatar epint commented on August 17, 2024

That is exactly what I did, see updated question (forgot to apply code style). That doesn't seem to work.

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

Update: My mistake. You should add it to your AlertDialogPro's theme.

from alertdialogpro.

epint avatar epint commented on August 17, 2024

Yes, works.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

@fengdai I'm not sure, but I think that the support library has some styles for the material-style. Maybe you could use theirs?
Example:
style="@style/Widget.AppCompat.ProgressBar.Horizontal"

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

@AndroidDeveloperLB Yes. I have used some of them. But must of them are not useful for backward compatibility. Like Widget.AppCompat.ProgressBar.Horizontal which is defined as below:

   <style name="Widget.AppCompat.ProgressBar.Horizontal" parent="Base.Widget.AppCompat.ProgressBar.Horizontal"></style>

Look into Base.Widget.AppCompat.ProgressBar.Horizontal. Defined in default values dir:

   <style name="Base.Widget.AppCompat.ProgressBar.Horizontal" parent="android:Widget.ProgressBar.Horizontal"></style>

In v11 values dir:

 <style name="Base.Widget.AppCompat.ProgressBar.Horizontal" parent="android:Widget.Holo.ProgressBar.Horizontal"></style>

And in v21 values dir:

    <style name="Base.Widget.AppCompat.ProgressBar.Horizontal" parent="android:Widget.Material.ProgressBar.Horizontal"></style>

That means ProgressBar with this style will be material-style only on Lollipop...

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

@fengdai Oh, I see. Just though it might be useful. Sorry.

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

That's fine ; )

from alertdialogpro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.