Giter Club home page Giter Club logo

dialogplus's Issues

how to set multipleSelectItem?

just like this:
AlertDialog.Builder d = new AlertDialog.Builder(yourcontext);
d.setMultiChoiceItems(elements, null , new OnMultiChoiceClickListener() {
@OverRide
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
if(isChecked){
String str = elements[which];
Toast.makeText(youractivity.this,
"you have selected"+str,
Toast.LENGTH_LONG).show();
}
}
});

Option to handle Back key

It would be nice to have an option to consume Back key event and don't pass it to rest of activity.

Using Fragments within dialog

Hello,

Is there a way to use Fragments within the dialog?

I've been trying to add a view with a FrameLayout element and calling FragmentManager methods to fetch and change views but it says something about IllegalStateException, view has already a parent or something like that.

I'm trying to make a dialog with tabs...

I went for TabHost but I got different problems with deprecated classes.
I went for ViewPager and PagerTabStrip but it's not the UX I was required to implement.
So I decided to make all by hand with Fragments but I cannot communicate with a FrameLayout for content within your dialog. The FragmentManager mess up with the hierarchy I think...

I'd appreciate any clues about this issue.

setHeader() and setFooter() set wrong views

view passet to setHeader() method in DialogPlus.newDialog(context) builder object
actually appears as footer. And view passet to setFooter() appears as header.
version 1.9

bug in DialogPlus class. line line 181
private View createView(LayoutInflater inflater, View footerView, View headerView, BaseAdapter adapter)

params View footerView, View headerView are misplaced

Dialog on tablet issue

I have an issue with dialog on tablets - it stretches on all screen instead of fixed size. Is it possible to set fixed width to it ?
screen shot 2015-07-07 at 12 46 22 pm

L animation

It will be cool to have L animation, when the dialog is at the bottom, scrolling from bottom to top would stretch the dialog to whole screen

Beautify sample

  • Add HolderTypeSelection
  • Add Footer / Header selection
  • Better list items
  • Click Callback to show a toast

Center does not work on horizontal axis

Hi,

First of all tnx very much for such clean and developer friendly library :)

As you can be seen in attachment i could not center on horizontal axis. Does library support this functionality or did i miss something?

Here is my code :

final DialogPlus dialog = new DialogPlus.Builder(this)
            .setOnItemClickListener(new OnItemClickListener() {
                @Override
                public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
                    //
                }
            })
            .setGravity(DialogPlus.Gravity.CENTER)
            .setContentHolder(isparkDetailView)
            .setCancelable(true)
            .create();
dialog.show();

screenshot-2015-06-18_15 23 07 964

King Regards

Error while using inflated view

When I try to set ViewHolder to an inflated view, I receive this error and nothing is displayed :

My code :

View view = mInflater.inflate(R.layout.my_popup, null, false);
    Display display = getWindowManager().getDefaultDisplay();
    Point size = new Point();
    display.getSize(size);
    int height = size.y;
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, (int) (height * .75));
    params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    view.setLayoutParams(params);

    WebView webView = (WebView) view.findViewById(R.id.webView);
    WebSettings settings = webView.getSettings();
    settings.setDefaultTextEncodingName("utf-8");
    webView.setScrollContainer(false);


    webView.loadDataWithBaseURL(null, sample_dictionary_html, "text/html", "utf-8", null);
    dialog_plus = new DialogPlus.Builder(this)
            .setContentHolder(new ViewHolder(view))

            .create();
    dialog_plus.show();

MY ERROR ⚠️

04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at android.widget.AdapterView.setOnClickListener(AdapterView.java:926) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.setClickListener(DialogPlus.java:413) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:402) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:399) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:399) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:399) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:399) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.createView(DialogPlus.java:361) 04-04 12:06:41.839 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.initContentView(DialogPlus.java:286) 04-04 12:06:41.844 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.createDialog(DialogPlus.java:276) 04-04 12:06:41.844 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.(DialogPlus.java:168) 04-04 12:06:41.844 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus.(DialogPlus.java:18) 04-04 12:06:41.844 4282-4282/com.daftar.Abrar.Interface W/System.err﹕ at com.orhanobut.dialogplus.DialogPlus$Builder.create(DialogPlus.java:666)

Cannot open dialog straight after closing another one?

I have a function, which on success shows a dialog. However, if there is an error it will show a different dialog. If they press "OK" on the error dialog the function is recursively called and now ends in success. However the other dialog will not show, it's almost as if the old dialog isnt being dismissed in time.

Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead

Hi, I want to add a whellview to dialogplus, it extend from spinner. but throw a exception.

07-25 22:13:30.493: E/AndroidRuntime(13740): java.lang.RuntimeException: Don't call setOnClickListener for an AdapterView. You probably want setOnItemClickListener instead
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.jyxtec.wheel.TosAdapterView.setOnClickListener(TosAdapterView.java:803)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.setClickListener(DialogPlus.java:315)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:300)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:297)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:297)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:297)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.assignClickListenerRecursively(DialogPlus.java:297)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.createView(DialogPlus.java:259)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.initContentView(DialogPlus.java:227)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlus.(DialogPlus.java:111)
07-25 22:13:30.493: E/AndroidRuntime(13740): at com.orhanobut.dialogplus.DialogPlusBuilder.create(DialogPlusBuilder.java:265)

How to cancel backpress listening?

This setup is invalid.

builder.setOnCancelListener(new OnCancelListener() {
@OverRide
public void onCancel(DialogPlus dialogPlus) {
dialogPlus.show();
}
});

        builder.setOnBackPressListener(new OnBackPressListener() {
            @Override
            public void onBackPressed(DialogPlus dialogPlus) {
                dialogPlus.show();
            }
        });

Show dialog from dialog

I have two dialog method. If the user press the button in first dialog (from Gravity.TOP) i want show the next dialog (Gravity.Bottom). But the second dialog not present on view. In debug i see the dialog.create() and show() run. The two dialog born from MainActivity.

I need some clear someWhere before show the second dialog?

First dialog:

public void shareButtonClickced()
{
    ShareNoConnectionAdapter shAdapter = new ShareNoConnectionAdapter(this);
    DialogPlus dialog = new DialogPlus.Builder(this)
        .setAdapter(shAdapter)
        .setGravity(DialogPlus.Gravity.TOP)
        .setHeader(R.layout.dialog_share_header)
        .setOnItemClickListener(new OnItemClickListener() {

             @Override
             public void onItemClick(DialogPlus dialog, Object item, View view, final int position) {
                dialog.dismiss();
                showLoginDialog();
             }
         })
    .create();
    dialog.show();
}

Second dialog:

public void showLoginDialog()
{
    ExitViewAdapter lgAdapter = new ExitViewAdapter(this);
    DialogPlus dialog = new DialogPlus.Builder(this)
        .setAdapter(lgAdapter)
        .setGravity(DialogPlus.Gravity.BOTTOM)
        .setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(DialogPlus dialog, Object item, View view, final int position) {
                dialog.dismiss();
                //my rest of code
            }
        })
        .create();
    dialog.show();
}

Thank you in advance for your help

Nested dialogs?

I was messing around with DialogPlus, and I came accoss this "issue". I'm not able to show a child dialog from parent dialog. Here's the code:

        final ArrayAdapter<String> childAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, new String[]{"Nothing to do", "do nothing"});

    final DialogPlus child = DialogPlus.newDialog(Settings.this)
            .setInAnimation(R.anim.dialogin).setBackgroundColorResourceId(R.color.bg)
            .setOutAnimation(R.anim.dialogout)
            .setAdapter(childAdapter)
            .create();


    final ArrayAdapter<String> parentAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, new String[]{"Dismiss", "Show another dialog"});

    final DialogPlus parent = DialogPlus.newDialog(Settings.this)
            .setInAnimation(R.anim.dialogin).setBackgroundColorResourceId(R.color.bg)
            .setOutAnimation(R.anim.dialogout)
            .setAdapter(parentAdapter)
            .setOnItemClickListener(new OnItemClickListener() {
                @Override
                public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
                    switch (position) {
                        case 0:
                            dialog.dismiss();

                            break;

                        case 1:
                            child.show();
                            dialog.dismiss();

                            break;

                    }
                    Log.v("Issue", parentAdapter.getItem(position));


                }
            })
            .create();

    parent.show();

Logcat report of clicks:
08-16 02:56:16.702 28131-28131/net.darkion.test V/Issue﹕ Dismiss
08-16 02:56:20.980 28131-28131/net.darkion.test V/Issue﹕ Show another dialog

However, the second dialog is shown when child.show(); is added an OnDismissListener()

Conflict with Attribute 'Corner Radius'

Hi

I want to report a conflict error:

AGPBI: {"kind":"ERROR","text":"Attribute \"corner_radius\" has already been defined","sourcePath":"{Path to app}\\app\\build\\intermediates\\exploded-aar\\com.orhanobut\\dialogplus\\1.10\\res\\values\\values.xml","position":{"startLine":1},"original":""}

The conflict is reported for the library: https://github.com/kanytu/ImageWindow

GirdHolder

SetOnClickItem doesnt work for grid Holder
actually , it select the whole line read the first item in the line only
thnx

OnItemClickListener is not working.

I am trying below code in my activity but is not calling the click listener.

DialogPlus dialogPlus = new DialogPlus.Builder(MainActivity.this)
                    .setAdapter(new SimpleAdapter(MainActivity.this,false))
                    .setOnClickListener(new OnClickListener() {
                        @Override
                        public void onClick(DialogPlus dialog, View view) {
                            dialog.dismiss();
                        }
                    })
                    .setOnItemClickListener(new OnItemClickListener() {
                        @Override
                        public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
                            dialog.dismiss();
                        }
                    })
                    .create();
            dialogPlus.show();

Am I doing anything wrong?

setPadding

setPadding method should be introduced

The demo will be cashed!!!!

The demo will be cashed when the dialog dismissed,and the logcat print the error:java.lang.NullPointerException
at android.view.View.drawAnimation(View.java:13968).......
at android.os.Looper.loop(Looper.java:136)...

I don't know why, I can't location the error. The API level is 21 and 4.4

Show panel in bottom centre

Doing DialogPlusBuilder#setGravity(Gravity.CENTER | Gravity.CENTER_HORIZONTAL) causes a crash because it can't work out the animation to play in #getOutAnimation(). I think it just requires a bit mask check rather than using equals.

Callback when the dialog has been dismissed

As Ordinary Dialog does, DialogPlus seems like to have the listener that notifies the user when DialogPlus dismisses. mind if I push a pull request for this issue and review for my code? thanks.

Gravity.bottom seems not to work

hi, i ran the sample in genymotion and clicked the bottom button, but it turns out like this
image
clicking the space under the dialog could not dismiss the dialog,
rather than clicking the space above it.

i ran it in my android testing machine, and came across the same problem

Transparent black background can not be removed

Hello,

Even i used :

setBackgroundColorResourceId(R.color.transparent_color)

there is still a transparent background i could change it like this :

((FrameLayout) findViewById(R.id.content_container).getParent()).setBackgroundColor(getResources().getColor(R.color.transparent_color))

FYI

Layout items onClicks not working

Hello,

onClick attributes are not working in dialog hich i define in layout xml. Here is an example :

<ImageButton
                android:id="@+id/genderMaleButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/button_male"
                android:background="@color/transparent_color"
                android:onClick="selectMale"/>

selectMale method is defined in caller activity and it works if i embed layout xml contents into main layout xml.

King Regards

PS : i found that parent must be defined while inflating : http://stackoverflow.com/questions/5444516/inflated-layouts-buttons-onclick-listener-not-working i do not know if this is the solution but wanted to share if in any case it has any help

(NullpointerException) Hardware acceleration issue on older Android versions

DialogPlus has an issue on older Android versions (I tested on an Incredible S running 4.0.4).

Gives the following exception:
java.lang.NullPointerException
at android.view.GLES20RecordingCanvas.drawPatch(GLES20RecordingCanvas.java:97)...

Can be solved by changing line 256 in the DialogPlus class from:
decorView.removeView(rootView);

to:

decorView.post(new Runnable() {
@OverRide
public void run() {
decorView.removeView(rootView);
}
});

Handle gravity center

  • Default margins (ex. setMargins(0, 0, 0, 0))
  • Wrap horizontal content as option in the builder (setWidth(DialogPlus.LayoutParam.WRAP_CONTENT))

NumberFormatException

java.lang.NumberFormatException
at org.apache.harmony.luni.util.FloatingPointParser.parseFltImpl(Native Method)
at org.apache.harmony.luni.util.FloatingPointParser.parseFloat(FloatingPointParser.java:321)
at java.lang.Float.parseFloat(Float.java:323)
at android.content.res.TypedArray.getFloat(TypedArray.java:304)
at android.view.animation.ScaleAnimation.<init>(ScaleAnimation.java:54)
at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:110)
at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:106)
at android.view.animation.AnimationUtils.createAnimationFromXml(AnimationUtils.java:83)
at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:64)
at com.orhanobut.dialogplus.DialogPlus.onAttached(DialogPlus.java:506)
at com.orhanobut.dialogplus.DialogPlus.show(DialogPlus.java:202)

trying:

        DialogPlus dialog = new DialogPlus.Builder(getActivity())
                .setAdapter(new AdapterAssist(getActivity(), adapter.event.status))
                .setGravity(DialogPlus.Gravity.CENTER)
                .setContentHolder(new GridHolder(3))
                .setOnItemClickListener( ...).create();

    dialog.show();

Bug on:
Galaxy S2 (GT-I9100)
Android 2.3.3 - 2.3.7

setHeader() and setFooter() in big lists

I would like the header and footer to always be visible. Right now, in a big list, you have to scroll to the bottom to find the footer (containing cancel, accept, etc buttons), which feels wrong.

Also, because of this implementation (I suppose), they do not show up if I use the GridHolder.

Do I have to use a custom ViewHolder for the behavior I want?

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.