Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample app? #1

Closed
AndroidDeveloperLB opened this issue Oct 23, 2014 · 11 comments
Closed

Sample app? #1

AndroidDeveloperLB opened this issue Oct 23, 2014 · 11 comments

Comments

@AndroidDeveloperLB
Copy link

How do I use this library?
Can you please post a sample code of how to create an alertDialog ?
Does it work well on Gingerbread?

@fengdai
Copy link
Owner

fengdai commented Oct 24, 2014

Can you please post a sample code of how to create an alertDialog ?

Well. There's already a demo.

Does it work well on Gingerbread?

Yes. It works well on all versions of the Android platform back to v1.0. So it also works well on Gingerbread.

How do I use this library?

Checkout the project and take a look at the alertdialogpro-demo module.
The styles.xml file shows you how to specify a global theme to the AlertDialogPro.
The MainActivity.java file shows you how to build an AlertDialogPro and change the theme of AlertDialogPro in the code.
You can also take a look at the alertdialogpro-theme-material module which implements a material theme. It can show you how to do theme customization with this project.

@AndroidDeveloperLB
Copy link
Author

Oh, sorry for missing this. I was sure I've seen only a very short project for material, and now I see more.
Probably missed a lot by staying up late. :)
I think this is the part I've seen:
https://github.com/fengdai/AlertDialogPro/tree/master/alertdialogpro-theme-material

Anyway, how come the support library doesn't have this functionality ?

@fengdai
Copy link
Owner

fengdai commented Oct 24, 2014

I don't know... Maybe there is no need for Google to do that since this functionality is not as complex as the ActionBar compatibility.

@AndroidDeveloperLB
Copy link
Author

I see.
Say, now I've tried to use Android-Studio and run the demo, but got an error running it. Can you please help me handle it?
here's the error:

Error:Execution failed for task ':alertdialogpro-demo:processDebugResources'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\android\build-tools\21.0.0\aapt.exe package -f --no-crunch -I D:\android\platforms\android-21\android.jar -M D:\android-studio\Android studio Projects\AlertDialogPro\alertdialogpro-demo\build\intermediates\manifests\debug\AndroidManifest.xml -S D:\android-studio\Android studio Projects\AlertDialogPro\alertdialogpro-demo\build\intermediates\res\debug -A D:\android-studio\Android studio Projects\AlertDialogPro\alertdialogpro-demo\build\intermediates\assets\debug -m -J D:\android-studio\Android studio Projects\AlertDialogPro\alertdialogpro-demo\build\generated\source\r\debug -F D:\android-studio\Android studio Projects\AlertDialogPro\alertdialogpro-demo\build\intermediates\libs\alertdialogpro-demo-debug.ap_ --debug-mode --custom-package com.alertdialogpro.demo -0 apk --output-text-symbols D:\android-studio\Android studio Projects\AlertDialogPro\alertdialogpro-demo\build\intermediates\symbols\debug
Error Code:
-1073741819

EDIT: with Eclipse (which I prefer to use anyway), it worked fine.

@fengdai
Copy link
Owner

fengdai commented Oct 24, 2014

Did you install the latest SDK Build-tools v21?

@AndroidDeveloperLB
Copy link
Author

@fengdai Yes. I always install the latest.
Anyway, I've succeeded using Eclipse, so if you wish you can close this thread.

@fengdai
Copy link
Owner

fengdai commented Oct 24, 2014

OK. If any question, be free to ask me : )

@fengdai fengdai closed this as completed Oct 24, 2014
@AndroidDeveloperLB
Copy link
Author

Yes, I actually have a question.
Since I am willing to use only the material design, is it possible to avoid using the rest of the files (of Holo) ?
Is it possible for me to merge the 2 libraries, and use a single one?
BTW, you should check the warnings of the projects.

@fengdai
Copy link
Owner

fengdai commented Oct 24, 2014

Yes. Just delete the Holo files. And change the defValues to Material:

In AlertController.java, the constructor method:

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

@fengdai
Copy link
Owner

fengdai commented Oct 24, 2014

Would you please open another issue for this question?

@AndroidDeveloperLB
Copy link
Author

Yes, here:
#2

Repository owner locked and limited conversation to collaborators Oct 24, 2014
Repository owner unlocked this conversation Oct 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants