Giter VIP home page Giter VIP logo

android-styled-dialogs's People

Contributors

arriolac avatar cermakcz avatar davidvavra avatar evant avatar franklinharper avatar jfragosoperez avatar kd7uiy avatar marianeum avatar martarodriguezm avatar monikajethani avatar mr-const avatar mrgoltstein avatar petrsimek avatar samerzmd avatar tomas-vondracek avatar tomaskypta avatar tprochazka avatar veinhorn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-styled-dialogs's Issues

instantiate the dialog many times.

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?

Allow to use ISimpleDialogCancelListener and ISimpleDialogListener with any dialog

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.

Include via Gradle not working

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

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 not showing when using setNeutralButton

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

How can I setup icon with builder API?

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?

Problem icon and title

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

Why I cant set the icon next to title?

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

message gravity

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

Cannot build with gradle build system

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

Current listener structure is clunky

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() and Spanned

SetMessage() in the SimpleDialogBuilder should accept CharSequence instead of String to allow to use Spanned as message.

Style contains key with bad entry

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.

JAR File for this Library

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!

BaseDialogBuilder

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?

new Issue about

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]

ProgressDialogFragment cannot set the theme

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!

Problem with gradle and resources

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.

It gives me an error (Eclipse)

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?

Add sdl prefix on all resource names

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.. :)

Regarding usage with API 14+ and FragmentManager

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!!

No resource found that matches the given name (at 'buttonBackgroundColorFocused' with value '@color/dialog_button_focused')

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

How to custom styled dialog with progress bar?

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?

Errors in sdl_theme.xml

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'"

IllegalStateException when changing orientation with parent-Fragment as targetFragment

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.

Leaking reference to activity/fragment in SimpleDialogFragment

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

Binary XML file line #4: You must supply a layout_width attribute.

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?

Custom Dialog and WebView Issue

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)
image1 potrait

When i change the orientation to horizontal it gives IMAGE2(Webview is now expanded)
image2 horizontal

Again When i change the orientation to potrait it gives me IMAGE3(Webview is expanded by default)
image3 potrait again

So i want to know if i'm doing some wrong thing or it's an issue known to you Guys.

Dialog drop shadows missing w/ v7-appcompat and v4-preferencefragment?

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:
correct

However, when a custom dialog using andrid-styled-dialogs is launched, the shadow is missing and everything feels flat:
incorrect

Dialog Background Color

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?

Problem when using latest support library with aar.

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.

Is this bug?

// 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.