lewisjdeane / l-dialogs Goto Github PK
View Code? Open in Web Editor NEWA small library replicating the new dialogs in android L.
A small library replicating the new dialogs in android L.
Can you add the library to maven central?its more easy to integrate in the app, than download the aar ..etc.
Thanks
08-18 13:23:15.023: E/AndroidRuntime(1508): FATAL EXCEPTION: main
08-18 13:23:15.023: E/AndroidRuntime(1508): Process: com.salut.jumbo, PID: 1508
08-18 13:23:15.023: E/AndroidRuntime(1508): android.view.InflateException: Binary XML file line #25: Error inflating class android.support.v7.internal.widget.ActionBarView
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:814)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
08-18 13:23:15.023: E/AndroidRuntime(1508): at uk.me.lewisdeane.ldialogs.CustomDialog.init(CustomDialog.java:55)
08-18 13:23:15.023: E/AndroidRuntime(1508): at uk.me.lewisdeane.ldialogs.CustomDialog.(CustomDialog.java:48)
08-18 13:23:15.023: E/AndroidRuntime(1508): at some.package.SomeFragment$1.onClick(SomeFragment.java:27)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.View.performClick(View.java:4438)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.View$PerformClick.run(View.java:18422)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.os.Handler.handleCallback(Handler.java:733)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.os.Handler.dispatchMessage(Handler.java:95)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.os.Looper.loop(Looper.java:136)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.app.ActivityThread.main(ActivityThread.java:5017)
08-18 13:23:15.023: E/AndroidRuntime(1508): at java.lang.reflect.Method.invokeNative(Native Method)
08-18 13:23:15.023: E/AndroidRuntime(1508): at java.lang.reflect.Method.invoke(Method.java:515)
08-18 13:23:15.023: E/AndroidRuntime(1508): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-18 13:23:15.023: E/AndroidRuntime(1508): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-18 13:23:15.023: E/AndroidRuntime(1508): at dalvik.system.NativeStart.main(Native Method)
08-18 13:23:15.023: E/AndroidRuntime(1508): Caused by: java.lang.reflect.InvocationTargetException
08-18 13:23:15.023: E/AndroidRuntime(1508): at java.lang.reflect.Constructor.constructNative(Native Method)
08-18 13:23:15.023: E/AndroidRuntime(1508): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
08-18 13:23:15.023: E/AndroidRuntime(1508): ... 22 more
08-18 13:23:15.023: E/AndroidRuntime(1508): Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
08-18 13:23:15.023: E/AndroidRuntime(1508): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.support.v7.internal.widget.ActionBarView.(ActionBarView.java:218)
08-18 13:23:15.023: E/AndroidRuntime(1508): ... 25 more
08-18 13:23:15.023: E/AndroidRuntime(1508): Caused by: java.lang.reflect.InvocationTargetException
08-18 13:23:15.023: E/AndroidRuntime(1508): at java.lang.reflect.Constructor.constructNative(Native Method)
08-18 13:23:15.023: E/AndroidRuntime(1508): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
08-18 13:23:15.023: E/AndroidRuntime(1508): ... 32 more
08-18 13:23:15.023: E/AndroidRuntime(1508): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x2/d=0x7f010012 a=-1}
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.content.res.Resources.loadDrawable(Resources.java:2068)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.widget.ImageView.(ImageView.java:129)
08-18 13:23:15.023: E/AndroidRuntime(1508): at android.widget.ImageView.(ImageView.java:119)
08-18 13:23:15.023: E/AndroidRuntime(1508): ... 35 more
In your screenshots, the light example has the negative to the left of the positive and the dark example has one over the other. How do you code it so the negative is to the left? The default appears to be vertical but I can't find any options for horizontal. I went through the code but can't find any options to use.
Could you add a method to set custom view as content, like setView() in original AlertDialog.Buider? I have tried setCustomView(), but it will replace all views include what I do not want to replace.
sorry for my bad English.
Throwing java.lang.ArrayIndexOutOfBoundsException: length=3; index=5 exception.
I tried adding a layout file to the method and it kept flagging an error... then i tried using the .seContentView() still it kept flagging an error... which makes me confused...by "customView" what do you actually mean?....
I'm using this code:
CustomDialog.Builder builder = new CustomDialog.Builder(
this, "تأیید", "عنوان");
builder.content("بایستی دوباره وارد شوید...")
.negativeText("خروج")
.titleAlignment(BaseDialog.Alignment.RIGHT)
.contentAlignment(BaseDialog.Alignment.RIGHT)
.positiveColorRes(R.color.text_color)
.build().show();
The buttons are shown in a column a the right (like the standard dark themed titled "Factory Reset"). How can I make them aligned in a row (like the standard permission dialog)?
It should be possible to set the color with a resource id.
public Builder positiveColor(@ColorRes int colorResId) {
this.mPositiveColour = mContext.getResources().getColor(colorResId);
return this;
}
Thoughts on adding a custom adapter instead of using the default array adapter?
My thought is for adding icons next to the lists?
Seems fairly easy to do.
I'm new to this so how exactly to handle click events for CustomDialogs. I have 3 dialogs and if I implement CustomDialog.ClickListener and then onConfirmClick() & onCancelClick(), all confirm and cancel buttons from all dialogs use the same method & functionality..
setCustomView()
is good, but when I use it, I found a problem.
When I try to add a WebView
at a L-Dialogs, you know that some web pages are long so they compress the Confirm Button and the Cancel Buttom under the screen, we can't see them.
Meanwhile, the AlertDialog doesn't have this problem, we can still get the Button.
Is it possible to add the version with the neutral button also?
Thanks in advance
Is it possible to implement a multi choice list view and also a single choice list view? I tried using dialog.getListView().setChoiceMode()
but it didn't work.
the builder.titleTextSize(12); isn't working if you don't remove the android:textSize="22sp" in the xml
Could you please tell me how to change the L-ListDialgs selected color?
CustomDialog.Builder builder = new CustomDialog.Builder(context, "Discard Item ?", "Discard");
builder.darkTheme(false);
builder.positiveColor(context.getResources().getColor(R.color.theme_default_primary));
builder.negativeColor(context.getResources().getColor(R.color.theme_default_primary));
builder.negativeText("Cancel");
CustomDialog customDialog = builder.build();
customDialog.show();
return customDialog;
While using the above code, I get two button stacked up instead showing in one row.
Is there any possibility that we could set text sizes for title/items?
This needs to be implemented to achieve default behavior of an android dialog in my humble opinion. I would like to contribute if necessary.
hi there
i like this library but i have a question
is it possible to have the user enter or modify information in the dialog ? Lets say change the title ?
CustomDialog.Builder builder = new CustomDialog.Builder(this, "Bestätigen","Hinzufügen abbrechen");
builder.negativeText("Schließen");
builder.darkTheme(false);
builder.content("Möchtest du das Hinzufügen einer neuen Prüfung wirklich abbrechen?");
builder.titleAlignment(BaseDialog.Alignment.LEFT); // Use either Alignment.LEFT, Alignment.CENTER or Alignment.RIGHT
builder.titleColor(R.color.app_blau); // int res, or int colorRes parameter versions available as well.#
CustomDialog customDialog = builder.build();
customDialog.show();
Any fix or are you not support Android before ICS?
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'uk.me.lewisdeane.ldialogs:ldialog@aar'
}
repositories{
flatDir{
dirs 'libs'
}
}
Error:
Error:Failed to resolve: uk.me.lewisdeane.ldialogs:ldialog:
Open File
Android Studio version 1.1.0
Hey mate,
This is an awesome library. But, I am unable to do so although i commented mDarkTheme, passed false value in it.
Since, I am using eclipse had to copy your src files, style and other values in my project. All worked good except this Light theme issue. :(
Thanks for this lib. :) 👍
My code:
CustomDialog.Builder builder = new CustomDialog.Builder(mActivity,
mActivity.getString(R.string.restart_required), mActivity.getString(R.string.yes_restart));
builder.negativeText(mActivity.getString(R.string.no));
builder.darkTheme(false);
builder.content(mActivity.getString(R.string.restart_now));
builder.titleAlignment(BaseDialog.Alignment.LEFT);
builder.titleColor(R.color.app_blau);
CustomDialog customDialog = builder.build();
customDialog.show();
customDialog.setClickListener(new CustomDialog.ClickListener() {
@Override
public void onConfirmClick() {
[...]
}
@Override
public void onCancelClick() {
[...]
}
});
The Dialog is shown twice on top of another, any fix available?
My content text is very long and it does not have a scroller in order to see all the text.
Thanks
When i try to show CustomListDialog I receive such error: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
at this line: customListDialog.show();
What I did wrong?
Android API 16
Hey,
First I have to say : I wanted to pull this by myself. But i don't know why i can't load this project from Github in Eclipse.
Well, My language is right to left,
So it would be great if you add alignment for content.
Then if content alignment is right to left, set buttons alignment to left to right.
Just in order to differentiate them with the main files of the project, and to avoid "clashes" between them, by having more unique names.
For example, you can add the prefix "ldi__" for each of the resources.
This is done in many libraries, including ActionBarSherlock and even in the support library (though both missed some files for some reason).
Hey these dialogs look great on Pre Android L devices. However on Lollipop I am having a big issue.
https://www.dropbox.com/s/68euvohqyfxrag3/2014-10-27%2023.07.11.png?dl=0
What could be the problem?
Here is the same dialog on Android KitKat
https://www.dropbox.com/s/68euvohqyfxrag3/2014-10-27%2023.07.11.png?dl=0
Hey, first of all, great lib.
I was wondering if it's possible to add custom views to the dialog. I would really like to add images to the dialog. One way of doing that with the default dialogs in Android was to use setView() and set an ImageView, so maybe you can do something similar.
Thanks.
I suppose, that renaming methods titleColor and itemColor to title/itemColour removes backward compatibility with old libs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.