Comments (23)
-
Delete all the Holo drawables and layouts and copy all Material drawables and layouts.
-
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);
-
Delete all styles and theme contain "Holo" in the styles.xml and themes.xml, and copy the Material styles and themes to them.
-
Replace colors.xml and dimens.xml directly.
-
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.
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.
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.
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.
Can't open the link: https://drive.google.com/file/d/0B-PZZGk2vPohQzdxenBfUE44czA
I'm in China. Sad story.
from alertdialogpro.
try again.
from alertdialogpro.
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.
I have downloaded your project and fixed it. Please follow the steps below:
-
Delete the android-support-v4 lib in your demo module.
-
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>
-
In demo module’s AndroidManifest.xml, use the
AppTheme
style as the application’s theme. -
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.
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.
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.
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.
Not all the IDs of Android are public. I think it's better to create my own IDs.
from alertdialogpro.
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.
I have separated holo theme resources and code from the core project.
from alertdialogpro.
@fengdai what does it mean?
from alertdialogpro.
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.
@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.
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.
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.
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.
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.
I just downloaded the sources from the SDK Manager. Android Studio attached the sources automatically. Looks like this:
from alertdialogpro.
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)
- Compatibility with support v20 HOT 3
- Suggestion: publish on those websites HOT 3
- Possible to use AlertDialogPro with ListPreference widget?
- White buttons in Activity when using dark theme with AppCompat 22 HOT 2
- ProgressDialogPro exception HOT 12
- adpButtonBarPositiveButtonStyle with Holo theme HOT 5
- Add support for the new Support library 22.1 HOT 6
- Resource not found Exception for Api > 21 HOT 4
- Checkbox Buttons Offset on Xperia T HOT 1
- Error when tryin do compile 23 SDK version HOT 3
- Do it support accent color of edittext in the alert dialog pro? HOT 1
- NoClassDefFoundError AllCapsTransformationMethod HOT 2
- Caused by: java.lang.NoClassDefFoundError: android.support.v7.internal.widget.TintTypedArray HOT 1
- hope upgrade to compile 'com.android.support:appcompat-v7:23.1.1' HOT 2
- in support v7 23.1.1 android.support.v7.internal become private how to solve this problem? HOT 1
- Failed to resolve: com.github.fengdai:alertdialogpro-theme-material:0.2.6 HOT 2
- Changing texts' typeface HOT 3
- have error with compile 'com.android.support:appcompat-v7:23.2.1' HOT 2
- 示例代码报错? HOT 1
- Issue About Deprecated Then How Can Handle That Issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alertdialogpro.