Git Product home page Git Product logo

Comments (23)

fengdai avatar fengdai commented on August 17, 2024
  1. Delete all the Holo drawables and layouts and copy all Material drawables and layouts.

  2. Change the defValues to Material's. In AlertController.java, the constructor method, replace some lines with below code:

     mAlertDialogLayout = a.getResourceId(R.styleable.AlertDialogProStyle_adpLayout,
            R.layout.alert_dialog_material);
     mListLayout = a.getResourceId(
            R.styleable.AlertDialogProStyle_adpListLayout,
            R.layout.select_dialog_material)
     mMultiChoiceItemLayout = a.getResourceId(
            R.styleable.AlertDialogProStyle_adpMultiChoiceItemLayout,
            R.layout.select_dialog_multichoice_material);
     mSingleChoiceItemLayout = a.getResourceId(
            R.styleable.AlertDialogProStyle_adpSingleChoiceItemLayout,
            R.layout.select_dialog_singlechoice_material)
     mListItemLayout = a.getResourceId(R.styleable.AlertDialogProStyle_adpListItemLayout,
            R.layout.select_dialog_item_material);
    
  3. Delete all styles and theme contain "Holo" in the styles.xml and themes.xml, and copy the Material styles and themes to them.

  4. Replace colors.xml and dimens.xml directly.

  5. Since you delete the holo theme. The demo module which use the holo theme will build fail. You should also delete the related code in it.

There may be other things to do, you can have a try first.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

What do you mean by "replace the holo resources" ? copy the new files of the material library to the new one (overriding them when possible), or should I delete the whole content of the holo library and then copy?

EDIT: both caused errors.
I think I need to perform careful merging of them.

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

You should't delete the whole content of the holo lib. It contains the core codes of the project. Only the resource files and a little code should be modified.
I have updated my answer.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

I'm have issues even after I've carefully removed and merged the files as you've written.
Here's the current library:
https://drive.google.com/file/d/0B-PZZGk2vPohQzdxenBfUE44czA

In my app (link here, BTW: https://play.google.com/store/apps/details?id=com.lb.app_manager ) , even though it seems to compile fine, for some reason I can't use it, as it tells me :
java.lang.NoClassDefFoundError: com.alertdialogpro.AlertDialogPro$Builder

Using the demo of the library, for some reason it can't import the library at all:
style cannot be resolved or is not a field

Could it be an SDK bug?

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

Can't open the link: https://drive.google.com/file/d/0B-PZZGk2vPohQzdxenBfUE44czA
I'm in China. Sad story.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

try again.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

Anyway, since I have too many issues, I've decided to avoid using the material library, but since the other one works, I decided to use it instead.

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

I have downloaded your project and fixed it. Please follow the steps below:

  1. Delete the android-support-v4 lib in your demo module.

  2. In demo module, the styles.xml file should be like this:

      <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"></style>
    
      <!-- Application theme. -->
      <style name="AppTheme" parent="AppBaseTheme">
          <item name="alertDialogProTheme">@style/AppTheme.AlertDialogProTheme</item>
      </style>
    
      <style name="AppTheme.AlertDialogProTheme" parent=“AlertDialogProTheme.Material”></style>
    
  3. In demo module’s AndroidManifest.xml, use the AppTheme style as the application’s theme.

  4. In alertdialogpro module’s layout/alert_dialog_material.xml file, change the custom view FrameLayout’s id from @+android:id/custom to @+id/custom. This is my mistake. And I have fixed it in the master.

Then it will work.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

After re-installing the SDK, and following what you've written, it worked.
I wonder why it had SDK problems, while other projects didn't..

Also, did you remember to change the id as you've written?

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

I tried to build it both in Android Studio and Eclipse. No exception occurred. I think it doesn't have "SDK problems".

Also, did you remember to change the id as you've written?

Yes.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

Now that I think about it, seeing that you have ported the code directly from Android, I think you could have just used the original IDs of Android, and not create your own.

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

Not all the IDs of Android are public. I think it's better to create my own IDs.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

Oh, I see. Ok. Thanks.

On Sun, Oct 26, 2014 at 10:31 AM, Feng Dai [email protected] wrote:

Not all the IDs of Android are public. I think it's better to create my
own IDs.


Reply to this email directly or view it on GitHub
#2 (comment)
.

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

I have separated holo theme resources and code from the core project.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

@fengdai what does it mean?

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

The holo theme files have been moved to a individual module: alertdialogpro-theme-holo. Anyone who want material theme but don't want to contain the holo files can use "alertdialogpro-core + alertdialogpro-theme-material".

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

@fengdai I see, so you won't end up with unused resources inside the app, just what you want to use.
Good.
Say, have you found out how come the dialog text color doesn't quite look like on Android Lollipop?

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

I developed the material theme base on the “preview” L code sometimes ago. It seems that Google made some changes when launched 5.0. I'm trying to let it match the official version's style.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

Nice. Thank you for your efforts.
Where exactly do you look at ? in the SDK folder ?

On Sun, Nov 2, 2014 at 12:05 PM, Feng Dai [email protected] wrote:

I developed the material theme base on the “preview” L code sometimes ago.
It seems that Google made some changes when launched official 5.0. I'm
trying to let it match the official version's style.


Reply to this email directly or view it on GitHub
#2 (comment)
.

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

I use Android Studio, and let my project target SDK 21. Then, I can search and look at the lollipop's source code in Android Studio.

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

How do you do it from withing Android Studio? is there a button for it?
I thought you can just go to the folder of the SDK, as you can download the sources from the SDK-Manager...

from alertdialogpro.

fengdai avatar fengdai commented on August 17, 2024

I just downloaded the sources from the SDK Manager. Android Studio attached the sources automatically. Looks like this:

f5326796-733f-49a7-add8-cfdeadc8a6ba

from alertdialogpro.

AndroidDeveloperLB avatar AndroidDeveloperLB commented on August 17, 2024

Wow cool. So you can perform a full search on the jar file,to find the function/class you wish to check out, for example?

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.