项目作者: umairayub79

项目描述 :
Material Alert Dialog
高级语言: Kotlin
项目地址: git://github.com/umairayub79/MaDialog.git
创建时间: 2019-07-01T20:52:15Z
项目社区:https://github.com/umairayub79/MaDialog

开源协议:Apache License 2.0

下载


MaDialog

Material Alert Dialog

  • min SDK 16
  • was written in Java now in Kotlin
  • simple beautiful dialogs with image and GIF support

Screenshots

Example screenshot 1
Example screenshot 2
Example screenshot 3

Installation

Add this into your project’s root build.gradle file

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url 'https://jitpack.io' }
  5. }
  6. }

Add the dependency to your module build.gradle:

  1. dependencies {
  2. implementation 'com.github.umairayub79:MaDialog:1.5'
  3. }

Example Usage

  1. //build a simple dialog
  2. new MaDialog.Builder(MainActivity.this)
  3. .setTitle("Example Dialog")
  4. .setMessage("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis scelerisquevel. ")
  5. .setPositiveButtonText("ok")
  6. .setNegativeButtonText("cancel")
  7. setButtonOrientation(LinearLayout.HORIZONTAL)
  8. .AddNewButton(R.style.AppTheme, "Yes", new MaDialogListener() {
  9. @Override
  10. public void onClick() {
  11. }
  12. })
  13. .setPositiveButtonListener(new MaDialogListener() {
  14. @Override
  15. public void onClick() {
  16. //todo
  17. }
  18. })
  19. .setNegativeButtonListener(new MaDialogListener() {
  20. @Override
  21. public void onClick() {
  22. //todo
  23. }
  24. })
  25. .build();
  26. //Available Methods
  27. .setTitle(String);
  28. .setMessage(String);
  29. .setImage(int);
  30. .setGif(int);
  31. .setMessageTextColor(int);
  32. .setTitleTextColor(int);
  33. .setButtonTextColor(int);
  34. .AddNewButton(int,String,MaDialogListener);
  35. .setButtonOrientation(int);
  36. .setBackgroundColor(int);
  37. .setNegativeButtonText(String);
  38. .setPositiveButtonText(String);
  39. .setPositiveButtonTextColor(int)
  40. .setNegativeButtonTextColor(int)
  41. .setCancelableOnOutsideTouch(boolean);
  42. .setPositiveButtonListener(MaDialogListener);
  43. .setNegativeButtonListener(MaDialogListener);
  44. .build();

LICENSE

  1. Copyright 2020 Umair Ayub
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.