Giter Club home page Giter Club logo

materialstyleddialogs's People

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

materialstyleddialogs's Issues

Suggestion AlertDialog method signature compatibility

I was working on converting a project to use your very nice dialogs, the problem I have is that they are largely compatible concept wise to calling AlertDialog.Builder, but all the names and types change, making it very time consuming to change to using it. Unfortunately I also just noticed you made many breaking changes so this suggestion probably comes too late.

It would be very nice if you used the same names and types as the AlertDialog Builder to help with conversion to using your library.

Various Issues

My application uses either a light or dark theme, the dialogs don't follow that theme, could you follow the theming in the supplied context instead of your own? It especially becomes an issue when using custom views as there is no access to the context you provide.

Another issue is that it would be nice to be able to supply a tint for the icon, mine are dark as they are easier to work with, but I have to manually tint them for all dialogs.

In Android version 7 the header icon is not working correctly .

The icon will cut to half sometimes, I am using this code

  public static void infoDialogue(Context context, String info) {

    final MaterialStyledDialog.Builder dialogHeader_1 = new MaterialStyledDialog.Builder(context)
            .setStyle(Style.HEADER_WITH_ICON)
            .setIcon(new IconicsDrawable(context).icon(MaterialDesignIconic.Icon.gmi_info).color(Color.WHITE))
            .withIconAnimation(false)
            .setTitle("Info")
            .setDescription(info)
            .setHeaderColor(R.color.yellow)
            .setNegativeText("OK");
    dialogHeader_1.show();
}

using a RecyclerView as a custom view

Can anyone help with this?

LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            View Customview = inflater.inflate(R.layout.vh_othersizes,null);
            RecyclerView rvOtheritems = (RecyclerView) Customview.findViewById(R.id.rvOtherSizes);
            OtherSizesAdaptor osa = new OtherSizesAdaptor(allItems, getActivity());
            LinearLayoutManager llm = new LinearLayoutManager(getActivity());
            llm.setOrientation(LinearLayoutManager.VERTICAL);

            rvOtheritems.setLayoutManager(llm);
            rvOtheritems.setAdapter(osa);

            new MaterialStyledDialog(getActivity())
                    .setTitle("Other Sizes")
                    .setCancelable(true)
                    .setIcon(R.drawable.ic_movestock)
                    .withIconAnimation(true)
                    .setHeaderColor(R.color.buttonBlue)
                    .setCancelable(true)
                    .setCustomView(Customview)
                    .build().show();
        });

No errors, the dialog box displays but the RecyclerView doesnt?

setIcon(...) with vector drawables crashes the app

Using vector drawable with setIcon(...) crashes the app on older devices than the lollipop. Looks like library needs to use AppCompatImageViewwithapp:srcCompat attribute now instead of older ImageViewwith android:src.

Slide Up Animations not working correctly

There are some wrong code in slide up animation related xml files. This causes wrong behaviour. If you watch carefully slide up animations you will see.

Currently: md_styled_slide_up_fast.xml :

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
    <translate
        android:duration="@android:integer/config_shortAnimTime"
        android:fromYDelta="100%"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:toXDelta="0" />
</set>

But it must be like this :

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <translate
        android:duration="@android:integer/config_shortAnimTime"
        android:fromYDelta="100%p"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:toYDelta="0%p"/>
</set>

Those small mistakes are in slide up animation related xml files.(all three)

Nothing big, it is just a small mistake.

Thanks for the library.

setHeaderColor a real color

Please allow setHeaderColor to also accept a real color so that dynamic colors can be assigned at runtime.

error with the new support library tations:23.2.0

com.github.afollestad.material-dialogs/core/0.8.5.4/res/values-v11/values-v11.xml/Users/Jorge1Old/AndroidStudioProjects/My_Andorra_Telecom/app/build/intermediates/exploded-aar/com.github.afollestad.material-dialogs/core/0.8.5.4/res/values-v11/values-v11.xml

Error:(3, 5) No resource found that matches the given name (at 'android:actionModeCloseDrawable' with value '@drawable/abc_ic_ab_back_mtrl_am_alpha').

How to set Button Color

I am stuck to set Button color e.g i want to make black positive and red negative button.

I have 3 layout with different 3 color in dialog.

I would like to use 2 colors (HeaderColor = primary color & [Text , Button] = white color).

new MaterialStyledDialog(CargoPlaceActivity.this)
// .setTitle("Logout!")
.setDescription("Are you sure, you want to logout ?")
.setIcon(R.drawable.splash)
.withDialogAnimation(true, Duration.SLOW)
.setCancelable(false)
.setPositive(getResources().getString(R.string.positive_button), new MaterialDialog.SingleButtonCallback() {
@OverRide
public void onClick(MaterialDialog dialog, DialogAction which) {
//
}
})
.setNegative(getResources().getString(R.string.negative_button), new MaterialDialog.SingleButtonCallback() {
@OverRide
public void onClick(MaterialDialog dialog, DialogAction which) {
//
}
})
.show();

2016-02-23_15 16 37 2

Icon animation only plays once

In the first build of Material Styled Dialogs, the icon animation would play every time the dialogue appears. Now, the icon animation only plays the first time the dialogue appears.

EDIT: I've looked a bit further and the cause appears to be update v1.1.1
In that update, the dialogue is not rebuilt everytime show() is called which means the animation would not play again. Is there a way around this?

Text alignment

In description when text size is small then its automatically right aligned. So how to make it left align?
device-2016-08-12-165142

Please check this image and provide a solution for that.

Readme

Maybe add this to let the user know that this is the old standard, In case people want it
//Old standard padding: .setCustomView(your_custom_view, 20, 20, 20, 0)

Custom layout

Is it possible to use my own custom layout on the material dialog? if so, how can i do it?

Could not find a method submit(View)

Hi,

I tried adding the library and repository to my build.gradle without problem. I didn't implement the dialog box code yet.. The problem is, when I click my login button, it shows this error :

Could not find a method submit(View) 
...
 Caused by: java.lang.NoSuchMethodException: submit [class android.view.View]

The error gone when I remove the library and repository.

Can anyone help me why is this happened?

Thank you.

Disabling the onClick event for listview

Hi. I have a custom listview that consists of CheckedTextView elements. I want to be able to check that at least one of the checkboxes is checked, and if not, keep the dialog on the screen. In order to implement this, I loop over the list items and check all of them. However, I could not find any way to keep the dialog open while onClick on positive is set. How should I proceed? Is there a way to implement a check in the onClick listener, and close or keep the dialog open according to the check result?

Thanks.

@javiersantos

How to apply Custom Style

Hello, i love your work.

Everything is working very well, thank you so much. I want to change some colors but i cannot figure it out how to apply my own custom style from style.xml.

Please explain me when you have free time.

Thank you.

Setting layout direction

Details
  • MaterialStyledDialogs version: 2.1

Hi is there any option to set the layout direction to RTL?

If not, can please add this option?
Thank you

header image entrance animation at wrong TranslationY

Details

This issue is purely cosmetic

Reproduction Steps
  1. Set a header image to the dialog
  2. Enable custom entrance animations
  3. Show dialog
Expected Result

I would expect the dialog to animate smoothly from off screen

Actual Result

The dialog appears instantaneously with the header image showing, then the rest of the dialog is animated into view.

Description text does not appear correctly

I just upgraded from Material Styled Dialog v1 to v1.5.5. Unfortunately, the latest version does not format descriptions correctly.
This is how the dialogue appears with v1:
untitled20160922202351

The dialogue appears wrong in v1.5.5:
untitled20160922202020

Am I missing a setting? Please help, thank you!

EDIT: I looked into this a bit further and the bug appears between v1.4 and v1.4.1
Seems that changing from a linear layout to a relative layout messed with the bottom margins/padding.

Binary XML file line #8: You must supply a layout_height attribute

java.lang.RuntimeException: Binary XML file line #8: You must supply a layout_height attribute. at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492) at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5755) at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:5890) at android.widget.LinearLayout$LayoutParams.<init>(LinearLayout.java:1815) at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:1727) at android.widget.LinearLayout.generateLayoutParams(LinearLayout.java:58) at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) at android.view.LayoutInflater.inflate(LayoutInflater.java:495) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at android.view.LayoutInflater.inflate(LayoutInflater.java:353) at com.github.javiersantos.materialstyleddialogs.MaterialStyledDialog.initStyle(MaterialStyledDialog.java:324) at com.github.javiersantos.materialstyleddialogs.MaterialStyledDialog.build(MaterialStyledDialog.java:268) at com.github.javiersantos.materialstyleddialogs.MaterialStyledDialog.show(MaterialStyledDialog.java:307) at com.sjoprz.activity.Main$2.run(Main.java:197) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4947) 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:1038) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) at dalvik.system.NativeStart.main(Native Method)

Get value from edittext

How can I get the value of an editText when I'm using a custom view?

This is my function code:

function askLogin(View view) {
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View customView = inflater.inflate(R.layout.login, null);
EditText school = (EditText) customView.findViewById(R.id.editTextSchool);
new MaterialStyledDialog(this)
.setDescription("Vul hier uw school en koppelcode in.")
.setCustomView(customView)
.setIcon(R.drawable.z)
.show();
}

This is the function I am calling when I click on the login button:

function logMeIn(View view) {
EditText school = (EditText) findViewById(R.id.editTextSchool);
System.out.println(schoolf.getText());
}

And this is my login.xml

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <EditText
        android:id="@+id/editTextSchool"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="School" />

    <EditText
        android:id="@+id/editTextKoppelcode"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Koppelcode"
        android:layout_below="@+id/editTextSchool"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />
</RelativeLayout>
<Button
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:text="Login"
    android:id="@+id/button20"
    android:layout_gravity="center_horizontal"
    android:onClick="aapje2"
    android:layout_centerHorizontal="true" />

What am I doing wrong?

failed to resolve .... while updating from 1.3 to 1.4

The library works fine until i changed 1.3 to 1.4 in below line in gradle:

compile 'com.github.javiersantos:MaterialStyledDialogs:1.4'

error failed to resolve ..... is what i get. But when i change back to 1.3, it works fine.

jitpack.io has already been added to maven. Please help asap

Make Header With Title and Drawable overlay optional

As of now, if I want to have a header with a title (HEADER_WITH_TITLE), as well as a headerDrawable, the dialog builder adds a gray overlay of a color filter over that drawable:

if (this.style == Style.HEADER_WITH_TITLE) {
    dialogHeader.setColorFilter(Color.rgb(123, 123, 123), Mode.MULTIPLY);
}

I have a background drawable that is already dark enough for text to be visible over it, and as such, would not need this filter to be added. It makes my header appear much darker than it should. Can we add a method to turn off this header filter?

I cant clone project

Hi, when clone this project in Android Studio 1.5.1 show me this error :
8
My SDK version : 23.1.1 (lasted). how to fix it?

Custom Typeface method?

Is there a possibility of Adding a method to use custom typeface on all the text in the Dialog?
Somethin like .setTypeface?
it will be great if included ๐Ÿ˜€

items list

how can i add list of items

like string list

thanks

Customize Buttons

The buttons are aligned to the left side, I want them to be aligned to the right side and change the text size. How should I do that?

Dismiss Listener

Hello .
I was wondering if there is any way to Add on Dismiss Listener ?

Button disable

1: Enable / disable buttons
2: avoid Dialog from closing on click

customize header color not work

When I use that .setHeaderColor(R.color.primary_dark) to customize the color ever appera the same color )(like a grey) In the example og Google play the green example has the same problem
I use NExus 5 with Android 6

Set Button Color

Hello @javiersantos, i need to know how to change button color.
I tried to add in styles.xml a style with parent MaterialStyledDialogs_Description in which i add an item called colorAccent but without result.

Could you help me? Thanks! ;)

[Help] [Question] How to Reuse

How can I reuse the dialog's in a separate class?

With my attempt, I get a NullPointerException:

Attempt to invoke virtual method 'android.content.res.Resources$Theme android.content.Context.getTheme()' on a null object reference." at FailDialogs.java:24

I just started diving back into Android/Java after a 5yr layoff so your help will be greatly appreciaded.

public class FailDialogs {

    static Context context;

    public static void invalidPasswordEmail() {

        new MaterialStyledDialog.Builder(context) // <- This would be line 24
                .setHeaderDrawable(R.drawable.shot_down)
                .withDialogAnimation(true)
                .setTitle(context.getString(R.string.dialog_warning))
                .setDescription(context.getString(R.string.login_description_failed))
                .setPositiveText(context.getString(R.string.login_positive_text_failed))
                .onPositive(new MaterialDialog.SingleButtonCallback() {
                    @Override
                    public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) {
                        /**
                         * Send the user to the Signup Activity If they
                         * realize they had not signed up yet or needs to
                         * create a new account via the action button.
                         */
                        context.startActivity(new Intent(context, RegisterActivity.class));
                    }
                })
                .setNegativeText(R.string.login_negative_text_failed)
                .show();

    }
}

I'm accessing it with checkIfEmailVerified();

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.