Git Product home page Git Product logo

tutorialsandroid / kalertdialog Goto Github PK

View Code? Open in Web Editor NEW
171.0 6.0 42.0 255.86 MB

AlertDialog for Android, a beautiful and material alert dialog to use in your android app.

License: Apache License 2.0

Java 100.00%
android android-app android-library android-development alertdialog customalertview edittext-dialog progressdialog progressdialog-library alertview dialog material-alert-dialog

kalertdialog's Issues

Hide title when is empty.

hi,
most of messages dont need a title. message like "do you want to move this?" not really need a title like "warning!". when we set title as empty "" , title textview can sets to gone for a better looking dialog.
thanks.

Hidden Navigation Bar not working after dismiss dialog

Hi.

I add these to my fragments and activities to enable full screen and hide navigation bar

view.setSystemUiVisibility(
              View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                      | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                      | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                      | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                      | View.SYSTEM_UI_FLAG_FULLSCREEN
                      | View.SYSTEM_UI_FLAG_IMMERSIVE);

view.setOnSystemUiVisibilityChangeListener(
              new View.OnSystemUiVisibilityChangeListener() {
                  @Override
                  public void onSystemUiVisibilityChange(int visibility) {
                      if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
                          view.setSystemUiVisibility(
                                  View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                                          | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                                          | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                                          | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
                                          | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                                          | View.SYSTEM_UI_FLAG_IMMERSIVE);
                      }
                  }
              });

But somehow after dialog dismiss, if I swipe up from the bottom, the navigation bar will show and never hidden anymore.
I'm not sure is this because of the behavior of the kAlertDialog or my code problem.

Auto dark mode

Hi,
I think forcing auto dark mode isn't a great design. Please add a method to avoid this.
Thanks!

Great library btw!

How to change default text on input?

Hi,

I want show the input, but i need that the input come filled with a text on EditText (not hint, but the text).

val dialog = KAlertDialog(context, KAlertDialog.INPUT_TYPE)
dialog.titleText = Kite.string[R.string.ai_chat_edit_thread_title]
dialog.setCancelClickListener(Kite.string[R.string.dialog_cancel_button]) { kAlertDialog: KAlertDialog ->
    kAlertDialog.dismissWithAnimation()
}
dialog.setConfirmClickListener(Kite.string[R.string.dialog_ok_button]) { kAlertDialog: KAlertDialog ->
    kAlertDialog.dismissWithAnimation()
    viewModel.editThreadTitle(thread, kAlertDialog.inputText)
}
dialog.confirmButtonColor(R.color.blue_800)
dialog.cancelButtonColor(R.color.blue_800)
dialog.show()

I tried this, but it is a val:

dialog.inputText = ???

How can i do this?

Thanks.

Custom text color and text font

Hello,
Great library! I am using it in my project with over 2mil+ downloads.

It would be great to be able to set the text color and the text font "out of the box" with a method like .setTitleTextFont(TypeFace), but until then, alternatively there is another way to do this if anyone else is interested:

 KAlertDialog kAlertDialog = new KAlertDialog(VideoActivity.this)
                    .setTitleText("MyTitle")
                    .setContentText("MyContent")
                    .setConfirmText("Sure")
                    .setCancelText("No thanks");

  kAlertDialog.show();

Typeface typeFace= ResourcesCompat.getFont(VideoActivity.this, R.font.myTypeFace);

// For Title
TextView titleText = kAlertDialog.getWindow().findViewById(R.id.title_text);
titleText.setTextColor(getResources().getColor(R.color.black));
titleText.setTypeface(leagueSpartan);

// For Content
TextView contentText = kAlertDialog.getWindow().findViewById(R.id.content_text);

// For Confirm Button
TextView confirmButton = kAlertDialog.getWindow().findViewById(R.id.custom_confirm_button);

// For Cancel Button
TextView cancelButton = kAlertDialog.getWindow().findViewById(R.id.cancel_button);

That's it!

Fonts Location

Could someone kindly explain why the font needs to be placed in the "assets/fonts" folder instead of the "res/font" folder which is recommended by the android studio? It seems quite inconvenient to create an additional folder solely for applying fonts in the alert dialog. It could potentially create unnecessary clutter and make the file structure more complicated. Thanks

How can i display keyboard when i use editText

	KAlertDialog pDialog = new KAlertDialog(this, KAlertDialog.SUCCESS_TYPE);
	pDialog.setCustomView(EditText.ID);

HI

i want to know how to display the keyboard when i touch the editText view

can someone help me?

New Logo Proposal

Hi...
Just Came across your project and I really like it, I am a Logo/Icon Designer who really has the passion and loves to contribute to very nice open source projects, I want to create and Propose a new Logo/Icon for your project that will represent what your project is all about.

Currently working on a few Idea Concept, I will share it here All For Free once I am done creating it, so you can give your feedback on any changes or adjustments you might want to suit your needs.

Your response would be really appreciated...

Regards!

New Feature :- Button size

Option to change button size , since the default button is too small (also button text size change would be very helpful).

NoClassDefFoundError: Failed resolution of: Landroid/webkit/TracingController;

KAlertDialog: v19.0.19
Device API 26

Compile SDk 32
Gradle Version 7.3.3
Gradle Plugin 7.2.1
Kotlin 1.6.10

Log:
I/zygote: Rejecting re-init on previously-failed class java.lang.Class: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/webkit/TracingController;
I/zygote: at java.lang.Class java.lang.Class.classForName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:-2)
I/zygote: at java.lang.Class java.lang.Class.forName(java.lang.String, boolean, java.lang.ClassLoader) (Class.java:453)
I/zygote: at java.lang.Class android.webkit.WebViewFactory.getWebViewProviderClass(java.lang.ClassLoader) (WebViewFactory.java:150)
I/zygote: at java.lang.Class android.webkit.WebViewFactory.getProviderClass() (WebViewFactory.java:417)
I/zygote: at android.webkit.WebViewFactoryProvider android.webkit.WebViewFactory.getProvider() (WebViewFactory.java:211)
I/zygote: at android.webkit.WebViewFactoryProvider android.webkit.WebView.getFactory() (WebView.java:2467)
I/zygote: at java.lang.String android.webkit.WebView.findAddress(java.lang.String) (WebView.java:1738)
I/zygote: at void android.text.util.Linkify.gatherMapLinks(java.util.ArrayList, android.text.Spannable) (Linkify.java:550)
I/zygote: at boolean android.text.util.Linkify.addLinks(android.text.Spannable, int) (Linkify.java:253)
I/zygote: at void android.widget.TextView.setText(java.lang.CharSequence, android.widget.TextView$BufferType, boolean, int) (TextView.java:5328)
I/zygote: at void android.widget.TextView.setText(java.lang.CharSequence, android.widget.TextView$BufferType) (TextView.java:5248)
I/zygote: at void android.widget.TextView.setText(java.lang.CharSequence) (TextView.java:5205)
I/zygote: at com.developer.kalert.KAlertDialog com.developer.kalert.KAlertDialog.setContentText(java.lang.String) (KAlertDialog.java:380)
I/zygote: at void com.developer.kalert.KAlertDialog.onCreate(android.os.Bundle) (KAlertDialog.java:135)
I/zygote: at void android.app.Dialog.dispatchOnCreate(android.os.Bundle) (Dialog.java:403)
I/zygote: at void android.app.Dialog.show() (Dialog.java:302)

version

please update version api level 18

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.