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

Please add a prefix for each resource and file, to avoid confusion with app's resources #10

Closed
AndroidDeveloperLB opened this issue Nov 5, 2014 · 28 comments

Comments

@AndroidDeveloperLB
Copy link

Maybe have "adp__" as a prefix for each resource and file.
Also, for the core library, you could use "adp_core__" , for holo, you could use "adp_holo__", and for material, you could use "adp_mat__"

@fengdai
Copy link
Owner

fengdai commented Nov 6, 2014

Fine. This's a good suggestion! I'll add this to my todo list.

@AndroidDeveloperLB
Copy link
Author

Thank you.

fengdai added a commit that referenced this issue Nov 14, 2014
Add a prefix for each resource and file, to avoid confusion with app's
resources #10.
@fengdai
Copy link
Owner

fengdai commented Nov 14, 2014

Hi @AndroidDeveloperLB , I have pushed a commit 1fb809e to meet your suggestion. Please take some time to review this commit. If you do not have any problems about this commit, please close this issue. Thank you.

@AndroidDeveloperLB
Copy link
Author

Thank you.
Have you also made the prefix a bit different for each library?
For example, "adp_mat__" for material library, "adp_core__" for the core library, and "adp_holo__" for the holo library.
Did you change the resource files names too? or just the resources?

EDIT: I see that it was done for the resources (seems like all of them, didn't check), but not for those files (their names) :
styles.xml , themes.xml , dimens.xml, colors.xml, attrs.xml , ids.xml

@fengdai
Copy link
Owner

fengdai commented Nov 14, 2014

Rename them like this: adp_styles_core.xml, adp_themes_core.xml, adp_colors_core.xml...?
That would makes them too hard to distinguish...

@AndroidDeveloperLB
Copy link
Author

no, like this :
"adp_core__styles.xml" , "adp_mat__themes.xml" , etc...

the prefix is just like in the resources. the last part is the type of the resource file.
This is similar to this popular library:
http://actionbarsherlock.com/download.html
This way, if I use Eclipse (and maybe Android-Studio, not sure), and I choose to show "styles.xml", I won't accidentally go to the library's files.

@fengdai
Copy link
Owner

fengdai commented Nov 14, 2014

Fine.

@AndroidDeveloperLB
Copy link
Author

Thank you.

@fengdai
Copy link
Owner

fengdai commented Nov 14, 2014

Another commit: 91761d0

@AndroidDeveloperLB
Copy link
Author

Wow you are fast.

@AndroidDeveloperLB
Copy link
Author

BTW, I think the file "TintManager.java" is missing this import line:
import com.alertdialogpro.R;

@AndroidDeveloperLB
Copy link
Author

I think you've misses some resources to add a prefix to:
the dimensions and the styles' names

fengdai added a commit that referenced this issue Nov 19, 2014
Please add a prefix for each resource and file, to avoid confusion with
app's resources #10
@fengdai
Copy link
Owner

fengdai commented Nov 19, 2014

@AndroidDeveloperLB Hi, I have pushed another commit which renamed colors and dimensions' names but excluded the styles'. What‘s wrong with the way I've named the styles' names?

@AndroidDeveloperLB
Copy link
Author

They have a too similar name to those of Android's , so it's confusing...

@fengdai
Copy link
Owner

fengdai commented Nov 19, 2014

So what's your suggestion?

@AndroidDeveloperLB
Copy link
Author

@fengdai you can use something like that :
https://github.com/JakeWharton/ActionBarSherlock/blob/master/actionbarsherlock/res/values/abs__styles.xml
He chose to put the library name after the word "Widget", for example

@AndroidDeveloperLB
Copy link
Author

@fengdai Also, the support library have prefixes too for the styles. Not sure how they decide where to put the extra text, but here are some examples:
Base.Widget.AppCompat.ActionBar
Widget.AppCompat.Light.ActionButton
Theme.AppCompat.Light

@fengdai
Copy link
Owner

fengdai commented Nov 21, 2014

These days I've been trying to fix this issue. Please take a look at this: 4c8a1be

@AndroidDeveloperLB
Copy link
Author

@fengdai Looks good.

@fengdai
Copy link
Owner

fengdai commented Nov 21, 2014

If there's no problem, please close this issue. Thank you.

@AndroidDeveloperLB
Copy link
Author

I hope I will have the time to check everything soon.
BTW, I think that using material design style on GB (2.3), the title is white, yet the color of the dialog is also white. It makes it hard to read the title this way.

@AndroidDeveloperLB
Copy link
Author

@fengdai I've went over all of the files. Seems you've made a perfect job going over all of them.
Thank you for this good library.

@AndroidDeveloperLB
Copy link
Author

For some reason, the projects don't compile, saying that "adpListItemHeight" isn't declared anywhere...
It's being used in "adp_mtrl_themes.xml" .
Another error is this:
...\res\values-v21\adp_mtrl_themes.xml:17: error: Error: No resource found that matches the given name (at 'adpButtonBarButtonStyle' with value '@style/Widget.Material.Button').
I think you want to use "Widget.AlertDialogPro.Material.Light.Button" .

Same goes for this error:
...\res\values-v21\adp_mtrl_themes.xml:17: error: Error: No resource found that matches the given name (at 'adpButtonBarButtonStyle' with value '@style/Widget.Material.Button').
and here you probably wanted to use "Widget.AlertDialogPro.Material.ButtonBar" .

it also has an issue with this "TextAppearance.Material.Subhead", which I think should be:
"TextAppearance.AlertDialogPro.Material.Subhead" .

@fengdai
Copy link
Owner

fengdai commented Nov 23, 2014

Oh,That's my mistake. I'll fix it soon. Thank you.

@fengdai
Copy link
Owner

fengdai commented Nov 23, 2014

...\res\values-v21\adp_mtrl_themes.xml should be deleted.

@AndroidDeveloperLB
Copy link
Author

@fengdai That's the only thing I need to change?

@fengdai
Copy link
Owner

fengdai commented Nov 23, 2014

Yes.
2014年11月23日 下午2:21于 "AndroidDeveloperLB" notifications@github.com写道:

@fengdai https://github.com/fengdai That's the only thing I need to
change?


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

@AndroidDeveloperLB
Copy link
Author

@fengdai OK, thank you. Did you notice the white title on GB ?

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