avast / android-styled-dialogs Goto Github PK
View Code? Open in Web Editor NEWBackport of Material dialogs with easy-to-use API based on DialogFragment
License: Apache License 2.0
Backport of Material dialogs with easy-to-use API based on DialogFragment
License: Apache License 2.0
everytime i want to show the dialog, it will create an instance every time, is it waste of memory. I just want to create a dialog one time, and call the show method and hide method. is it possible?
ISimpleDialogCancelListener and ISimpleDialogListener is very powerfull way to handle user response in fragment or activity level in save way (handle orientation change). But now is possible use it only with SimpleDialogFragment and it's not good think to use SimpleDialogFragment as parent for new custom dialogs. It is not designed for that.
Hey, I'm trying to include your project via Gradle and I keep on getting the following error:
Error:Failed to find: eu.inmite.android.lib:android-styled-dialogs:1.2.0
My gradle file looks like:
dependencies {
....
compile project(':plugins:Android-PullToRefresh:library')
compile 'com.android.support:support-v4:+'
compile 'eu.inmite.android.lib:android-styled-dialogs:1.2.0'
}
Any suggestions on how to get this to work?
there are some problem in the library,for example
1.the ListFragmentDialog can't set the choicemode
2.the DatePickerFragmentDialog can't change the color of datepicker divider
can you give me a permission to edit the library
Divider is not showing when neutral button added.
private void addDivider(ViewGroup parent) {
View view = mInflater.inflate(R.layout.dialog_part_button_separator, parent, true);
view.findViewById(R.id.dialog_button_separator).setBackgroundDrawable(new ColorDrawable(mButtonSeparatorColor));
}
Hello! First of all thank you for nice lib :)
SimpleDialogFragment.createBuilder(this, getSupportFragmentManager())
.setTitle(R.string.title)
// There is no such method
.setIcon(R.drawable.icon)
.setMessage(R.string.message)
.setPositiveButtonText(R.string.positive_button)
.setNegativeButtonText(R.string.negative_button)
.show();
In the sources I have found this interface and for me it looks like I should provide new implemntation on the basis of BaseDialogFragment
.
Is there any simple way to setup icon?
There is a way to show a StyledDialog with a Activity argument instead of FragmentActivity?
I wanted to change the @style/SDL.Progress to extend from different theme.
Hello,
I use your library in particular the class "Basic Dialog Fragment" how do you do to properly focus an icon and the title? Currently there is a gap the title is higher than the icon.
Using a CustomTitle?
thank you in advance
SimpleDialogFragment.createBuilder(this, getSupportFragmentManager()).setIcon(R.drawable.icon).setTitle(R.string.enter_title).setMessage(R.string.about).show();
And it says this:The method setIcon(int) is undefined for the type SimpleDialogFragment.SimpleDialogBuilder
is there away i can change the message gravity, i'm working in a project that has a right to left language, and i need to put the message to the right of the dialog
I have been looking for this for soooo long time. But I'm having problems importing the library into Android Studio 0.3.2.
Is there a .jar file available?
Hello,
i'm trying to use your library within my project using gradle + your maven group+artifactid.
The first problem I came across is that you're referencing a support library that is different from the "official" one in google repos. This prompts an error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl;
after fixing that by writing the following in my gradle.build:
dependencies {
compile ('eu.inmite.android.lib:android-styled-dialogs:0.5.7') {
exclude group: 'com.google.android'
}
I experienced this other problem below:
Error: duplicate files during packaging of APK /home/abaccega/gitStuff/AppsBuilderProject/AppsBuilder/build/apk/AppsBuilder-ALHHotels-debug-unaligned.apk
Path in archive: AndroidManifest.xml
Hey,
I'd like to user your library but I find the targetFragment set up for defining positive and negative listeners to be annoying.
It would be significantly better to be able to set a listener on your dialog directly. Forcing you to have the fragment implement some listener interface fails because now all the state you have available when you launch the dialog has to be translated somehow to the onPositiveButtonClicked method, which would probably mean adding a ton of member variables where you had none before.
Does this make sense?
SetMessage() in the SimpleDialogBuilder should accept CharSequence instead of String to allow to use Spanned as message.
Create and upload an .aar file instead of an apklib for use in gradle's dependency management.
Everytime the dialog is shown, I get this errors. BTW, the dialog is shown correctly.
11-28 01:31:39.203: E/ResourceType(2540): Style contains key with bad entry: 0x010102dd
11-28 01:31:39.203: E/ResourceType(2540): Style contains key with bad entry: 0x0101035b
11-28 01:31:40.753: E/ResourceType(2540): Style contains key with bad entry: 0x010102dd
And so on...
Tested on API 8 and 9.
Hi there, is it possible if you could provide a JAR file for this? I tried using Library dependency in Android Studio, but there is UNEXPECTED TOP-LEVEL EXCEPTION. Appreciate it! Thanks!
How can i change subj in my theme?
Whoops nvm..
Is there a reason why you don't make BaseDialogBuilder public to allow it to be extended and create custom dialogs that follow the same structure as the internal dialogs without having to fork the project?
Hello,I have a problem to use it, it always show "Can not perform this action after onSaveInstanceState", and my app crash。Did you have this problem on develop. I need your help! Thanks. [email protected]
Hello.
I dont know if really is a issue, but im using your library and i have the theme declared, is working fine for a custom dialog.
In my theme active:
<item name="sdlDialogStyle">@style/Ruby.Dialog</item>
and in styles XML
<style name="Ruby.Dialog" parent="DialogStyleLight">
<item name="titleTextColor">@color/background_ruby</item>
<item name="titleSeparatorColor">@color/background_ruby</item>
<item name="messageTextColor">@color/foreground_ruby_inverse</item>
<item name="buttonTextColor">@color/foreground_ruby_inverse</item>
<item name="buttonSeparatorColor">@color/divider_ruby</item>
<item name="buttonBackgroundColorPressed">@color/background_ruby</item>
<item name="buttonBackgroundColorFocused">@color/background_ruby</item>
</style>
Now i setup a simple Progress BUT the text dont take the style from styles.
ProgressDialogFragment.createBuilder(this, getSupportFragmentManager())
.setMessage(R.string.loading)
.show();
The text color (String loading) is WHITE and must be foreground_ruby_inverse (BLACK) like my first dialog.
Thanks!
I want a input dialog fragment let user can type some thing and get the response.
Is there any way to build a customized builder based on this library?
I've added this library to my project with gradle (compile 'eu.inmite.android.lib:android-styled-dialogs:1.1.2@aar'
) and my project won't compile if I want to style dialogs in styles.xml because it can't find custom attributes from this library. I have other libraries that use custom attributes (like ActionBarCompat or SmoothProgressBar) and in my project structure I can see build/exploded-aar folder where I can find all libs that are distributed with resources included but there is no android-styled-dialogs there.
Hi,
I'm using Eclipse and I get this error after entering the library:
" The container 'Android Dependencies' references non existing library 'C:\Users\richi\work\main\bin\main.jar' "
Why?
I'm getting clashes with my own applications on the names of some attributes. Libraries should always prefix its resource names (in this case, probably "sdl") so that application won't have problem.
For instance, titleTextColor will probably be used by many applications.. :)
I simply imported the library project into Eclipse workspace and this error is shown...
I want to use this library with my application targeting API 14+. Hence I am only extending Activity in my activities, which gives access to only getFragmentManager()(not the support version) but the constructor requires the supportFragmentManager. How do i resolve this? I would like to avoid extending FragmentActivity if possible. Sorry If i missed something obvious here.
Excellent work on the library!!
Hello i want to include your Library in my project but i always get this error on compiling
Im using a theme derived from AppCombat and i included the lib like this in build.gradle
compile 'eu.inmite.android.lib:android-styled-dialogs:1.1.2@aar'
Then i followed the instructions from the readme with including a style like this:
<style name="DialogStyleLight.Custom">
<!-- anything can be left out: -->
<item name="titleTextColor">@color/dialog_title_text</item>
<item name="titleSeparatorColor">@color/dialog_title_separator</item>
<item name="messageTextColor">@color/dialog_message_text</item>
<item name="buttonTextColor">@color/dialog_button_text</item>
<item name="buttonSeparatorColor">@color/dialog_button_separator</item>
<item name="buttonBackgroundColorNormal">@color/dialog_button_normal</item>
<item name="buttonBackgroundColorPressed">@color/dialog_button_pressed</item>
<item name="buttonBackgroundColorFocused">@color/dialog_button_focused</item>
<item name="dialogBackground">@drawable/dialog_background</item>
</style>
Afterwards i cant build my project anymore.
Do you have a hint what im doing wrong ?
Im using recent versions of support library
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:20.0.+'
Do you have a hint for me ?
thx c
Hi, I wonder can this library work with progress bar? Cause this library use builder to create object, so I don't know how to keep progress bar reference to force update progress.
I tried using custom dialog with progress bar on create builder method like this one:
@Override
protected Builder build(Builder builder) {
LinearLayout layout = new LinearLayout(getActivity());
final ProgressBar progressBar = new ProgressBar(getActivity());
layout.addView(progressBar, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
progressBar.setProgress(0);
progressBar.setMax(100);
builder.setView(layout);
return super.build(builder);
}
And show the dialog
public ProgressDialog show(FragmentActivity activity, String title){
ProgressDialog dialog = new ProgressDialog();
Bundle args = new Bundle();
args.putString(ARG_TITLE, title);
dialog.setArguments(args);
dialog.show(activity.getSupportFragmentManager(), TAG);
return dialog;
}
The problem is I don't know how to update the progress to this dialog and dismiss it. Is there any way to do this?
Your lib has the dependency com.google.android:android:4.2.2_r2
but there is no artifact with such version neither in maven repository http://mvnrepository.com/artifact/com.google.android/android
nor in my local repository deployed with mosabua sdk deployer
When I import the library in Eclipse, I got many errors in the sdl_theme.xml file like this:
"No resource found that matches the given name: attr 'android:spinnersShown'"
Bad background 9 patch images for DialogStyleLight. This lead to deadlock on 2.2.3 Android.
Unless parent Fragment is retained, setting parent-Fragment as targetFragment will cause an IllegalStateException
when changing orientation (or restoring from savedInstance), because the SimpleDialogFragment will be recreated before the parent has been restored.
This:
mBuilder.setTargetFragment((Fragment) this, mRequestCode)
Will cause:
java.lang.IllegalStateException: Fragement no longer exists for key android:target_state: index 1
Proposed solution: fallback first to parent-Fragment if no targetFragment is set, then fallback to Activity if SimpleDialogFragment has no parent-Fragment.
Somebody asked on G+:
Good project. One question though: aren't you leaking an activity reference as the dialog listener (not nulled when activity is destroyed/fragment is detached)?
And I think he has a point for SimpleDialogFragment - references are not nulled.
How about not casting listeners in onActivityCreated() method, but instead when they are needed (click of the button or when dialog was cancelled)?
03-05 20:27:25.396 7380-7380/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Binary XML file line #4: You must supply a layout_width attribute.
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:491)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5614)
at android.view.ViewGroup$MarginLayoutParams.(ViewGroup.java:5756)
at android.widget.LinearLayout$LayoutParams.(LinearLayout.java:1823)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1735)
at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:58)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:748)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at eu.inmite.android.lib.dialogs.BaseDialogFragment$Builder.getDialogLayoutAndInitTitle(BaseDialogFragment.java:325)
at eu.inmite.android.lib.dialogs.BaseDialogFragment$Builder.create(BaseDialogFragment.java:287)
at eu.inmite.android.lib.dialogs.BaseDialogFragment.onCreateView(BaseDialogFragment.java:66)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
I have this issue. Anyone experienced the same?
I have this custom dialog implementation
public static String TAG = "MainContainerDialogHelpers";
static String dialog_title, contentUrl_to_load;
public static void show(SherlockFragmentActivity activity, String title, String contentURL) {
dialog_title = title;
contentUrl_to_load = contentURL;
//contentURL is html file from assests in this form "file:///android_asset/help_documentation.html"
new MainContainerDialogHelpers().show(activity.getSupportFragmentManager(), TAG);
}
@OverRide
public BaseDialogFragment.Builder build(BaseDialogFragment.Builder builder) {
builder.setTitle(dialog_title);
LayoutInflater layoutInflater = LayoutInflater.from(getActivity());
View v = layoutInflater.inflate(R.layout.about_it_ebooks, null);
WebView webview = (WebView)v.findViewById(R.id.about_it_ebooks_wv);
webview.setOnLongClickListener(new OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
return true;
}
});
webview.setLongClickable(false);
webview.loadUrl(contentUrl_to_load);
//contentUrl_to_load is html file from assests in this form "file:///android_asset/help_documentation.html"
builder.setView(v);
builder.setPositiveButton("Dismiss", new View.OnClickListener() {
@Override
public void onClick(View v) {
ISimpleDialogListener listener = getDialogListener();
if (listener != null) {
listener.onPositiveButtonClicked(0);
}
dismiss();
}
});
return builder;
}
and this is my layout
The problem is when dialog builds it gives IMAGE1 (webview is not expanded)
When i change the orientation to horizontal it gives IMAGE2(Webview is now expanded)
Again When i change the orientation to potrait it gives me IMAGE3(Webview is expanded by default)
So i want to know if i'm doing some wrong thing or it's an issue known to you Guys.
Can anyone help me figure out why dialog "drop shadows" around the edges of the dialog don't appear when using android-styled-dialogs conjunction with the following libraries?
There is a sample application setup that demonstrates this issue @ https://github.com/justingarrick/sdltest. Both of the aforementioned libraries need to be available and added as Android Libraries in addition to android-styled-dialogs.
The normal dialogs spawned by android-support-v4-preferencefragment have the shadow:
However, when a custom dialog using andrid-styled-dialogs is launched, the shadow is missing and everything feels flat:
Is there a way to change the background color of the dialog generated by the builder without relying on the inherited parent themes of the application?
I am using the 1.1.1 aar with Gradle.
I think because this library references the "r7" version of the support library that is in Maven Central, but I'm using the latest version of the support library provided by the local repository provided by the Android SDK, I'm getting the following error:
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice
Can the library be changed to use the (latest) version of the support library that is provided by the Android SDK? I know that works with Gradle but not sure about Maven.
// custom dialog background
final TypedArray a = getActivity().getTheme().obtainStyledAttributes(null, R.styleable.DialogStyle, R.attr.sdlDialogStyle, 0);
Drawable dialogBackground = a.getDrawable(R.styleable.DialogStyle_dialogBackground);
a.recycle();
dialog.getWindow().setBackgroundDrawable(dialogBackground);
a is nullpoint and dialogBackground is null too
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.