Browse Source

Initial commit

kongzue 4 years ago
commit
1f07066022
100 changed files with 4746 additions and 0 deletions
  1. 14 0
      .gitignore
  2. 134 0
      .idea/codeStyles/Project.xml
  3. 24 0
      .idea/gradle.xml
  4. 25 0
      .idea/jarRepositories.xml
  5. 93 0
      .idea/misc.xml
  6. 12 0
      .idea/runConfigurations.xml
  7. 1 0
      DialogX/.gitignore
  8. 31 0
      DialogX/build.gradle
  9. 0 0
      DialogX/consumer-rules.pro
  10. 21 0
      DialogX/proguard-rules.pro
  11. 5 0
      DialogX/src/main/AndroidManifest.xml
  12. 47 0
      DialogX/src/main/java/com/kongzue/dialogx/DialogX.java
  13. 256 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/InputDialog.java
  14. 653 0
      DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java
  15. 75 0
      DialogX/src/main/java/com/kongzue/dialogx/impl/ActivityLifecycleImpl.java
  16. 30 0
      DialogX/src/main/java/com/kongzue/dialogx/impl/AnimatorListenerEndCallBack.java
  17. 179 0
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java
  18. 20 0
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogLifecycleCallback.java
  19. 66 0
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java
  20. 12 0
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnBackPressedListener.java
  21. 16 0
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnDialogButtonClickListener.java
  22. 15 0
      DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnInputDialogButtonClickListener.java
  23. 101 0
      DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java
  24. 62 0
      DialogX/src/main/java/com/kongzue/dialogx/util/InputInfo.java
  25. 62 0
      DialogX/src/main/java/com/kongzue/dialogx/util/TextInfo.java
  26. 431 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/BlurView.java
  27. 122 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/DialogXBaseRelativeLayout.java
  28. 86 0
      DialogX/src/main/java/com/kongzue/dialogx/util/views/MaxRelativeLayout.java
  29. 17 0
      DialogX/src/main/res/anim/anim_dialogx_default_enter.xml
  30. 9 0
      DialogX/src/main/res/anim/anim_dialogx_default_exit.xml
  31. 7 0
      DialogX/src/main/res/drawable/button_dialogx_material_light.xml
  32. 7 0
      DialogX/src/main/res/drawable/button_dialogx_material_night.xml
  33. 6 0
      DialogX/src/main/res/drawable/rect_dialogx_material_bkg_light.xml
  34. 6 0
      DialogX/src/main/res/drawable/rect_dialogx_material_bkg_night.xml
  35. 6 0
      DialogX/src/main/res/drawable/rect_dialogx_material_button_light_forword.xml
  36. 6 0
      DialogX/src/main/res/drawable/rect_dialogx_material_button_night_forword.xml
  37. 150 0
      DialogX/src/main/res/layout/layout_dialogx_material.xml
  38. 150 0
      DialogX/src/main/res/layout/layout_dialogx_material_dark.xml
  39. 16 0
      DialogX/src/main/res/values/attrs.xml
  40. 47 0
      DialogX/src/main/res/values/colors.xml
  41. 18 0
      DialogX/src/main/res/values/styles.xml
  42. BIN
      DialogXDemo_backup@20200926.zip
  43. 1 0
      DialogXIOSStyle/.gitignore
  44. 24 0
      DialogXIOSStyle/build.gradle
  45. 0 0
      DialogXIOSStyle/consumer-rules.pro
  46. 21 0
      DialogXIOSStyle/proguard-rules.pro
  47. 5 0
      DialogXIOSStyle/src/main/AndroidManifest.xml
  48. 66 0
      DialogXIOSStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java
  49. 130 0
      DialogXIOSStyle/src/main/java/com/kongzue/dialogx/style/IOSStyle.java
  50. 17 0
      DialogXIOSStyle/src/main/res/anim/anim_dialogx_ios_enter.xml
  51. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_bottom_light.xml
  52. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_bottom_night.xml
  53. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_center_light.xml
  54. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_center_night.xml
  55. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_left_light.xml
  56. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_left_night.xml
  57. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_right_light.xml
  58. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_right_night.xml
  59. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_top_light.xml
  60. 6 0
      DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_top_night.xml
  61. 14 0
      DialogXIOSStyle/src/main/res/drawable/editbox_dialogx_ios_dark.xml
  62. 13 0
      DialogXIOSStyle/src/main/res/drawable/editbox_dialogx_ios_light.xml
  63. 11 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_bottom_light.xml
  64. 11 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_bottom_night.xml
  65. 10 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_left_light.xml
  66. 10 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_left_night.xml
  67. 10 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_right_light.xml
  68. 10 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_right_night.xml
  69. 11 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_top_light.xml
  70. 11 0
      DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_top_night.xml
  71. 164 0
      DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios.xml
  72. 164 0
      DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios_dark.xml
  73. 41 0
      DialogXIOSStyle/src/main/res/values/colors.xml
  74. 1 0
      DialogXKongzueStyle/.gitignore
  75. 24 0
      DialogXKongzueStyle/build.gradle
  76. 0 0
      DialogXKongzueStyle/consumer-rules.pro
  77. 21 0
      DialogXKongzueStyle/proguard-rules.pro
  78. 5 0
      DialogXKongzueStyle/src/main/AndroidManifest.xml
  79. 66 0
      DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java
  80. 71 0
      DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/style/KongzueStyle.java
  81. 6 0
      DialogXKongzueStyle/src/main/res/drawable/button_dialogx_kongzue_night.xml
  82. 6 0
      DialogXKongzueStyle/src/main/res/drawable/button_dialogx_kongzue_ok_light.xml
  83. 6 0
      DialogXKongzueStyle/src/main/res/drawable/button_dialogx_kongzue_other_light.xml
  84. 6 0
      DialogXKongzueStyle/src/main/res/drawable/editbox_dialogx_kongzue_light.xml
  85. 6 0
      DialogXKongzueStyle/src/main/res/drawable/editbox_dialogx_kongzue_night.xml
  86. 10 0
      DialogXKongzueStyle/src/main/res/drawable/rect_dialogx_kongzue_editbox_focus.xml
  87. 10 0
      DialogXKongzueStyle/src/main/res/drawable/rect_dialogx_kongzue_editbox_normal.xml
  88. 10 0
      DialogXKongzueStyle/src/main/res/drawable/rect_dialogx_kongzue_editbox_normal_dark.xml
  89. 148 0
      DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue.xml
  90. 150 0
      DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue_dark.xml
  91. 42 0
      DialogXKongzueStyle/src/main/res/values/colors.xml
  92. 1 0
      app/.gitignore
  93. 37 0
      app/build.gradle
  94. 21 0
      app/proguard-rules.pro
  95. BIN
      app/release/KongzueDialogXPreview20200925.apk
  96. 20 0
      app/release/output-metadata.json
  97. 23 0
      app/src/main/AndroidManifest.xml
  98. 18 0
      app/src/main/java/com/kongzue/dialogxdemo/App.java
  99. 166 0
      app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java
  100. 30 0
      app/src/main/res/drawable-v24/ic_launcher_foreground.xml

+ 14 - 0
.gitignore

@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx

+ 134 - 0
.idea/codeStyles/Project.xml

@@ -0,0 +1,134 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <JetCodeStyleSettings>
+      <option name="PACKAGES_TO_USE_STAR_IMPORTS">
+        <value>
+          <package name="java.util" alias="false" withSubpackages="false" />
+          <package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
+          <package name="io.ktor" alias="false" withSubpackages="true" />
+        </value>
+      </option>
+      <option name="PACKAGES_IMPORT_LAYOUT">
+        <value>
+          <package name="" alias="false" withSubpackages="true" />
+          <package name="java" alias="false" withSubpackages="true" />
+          <package name="javax" alias="false" withSubpackages="true" />
+          <package name="kotlin" alias="false" withSubpackages="true" />
+          <package name="" alias="true" withSubpackages="true" />
+        </value>
+      </option>
+    </JetCodeStyleSettings>
+    <codeStyleSettings language="XML">
+      <indentOptions>
+        <option name="CONTINUATION_INDENT_SIZE" value="4" />
+      </indentOptions>
+      <arrangement>
+        <rules>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:android</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:id</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>style</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>ANDROID_ATTRIBUTE_ORDER</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>.*</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+        </rules>
+      </arrangement>
+    </codeStyleSettings>
+  </code_scheme>
+</component>

+ 24 - 0
.idea/gradle.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="testRunner" value="PLATFORM" />
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="gradleJvm" value="1.8 (2)" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/DialogX" />
+            <option value="$PROJECT_DIR$/DialogXIOSStyle" />
+            <option value="$PROJECT_DIR$/DialogXKongzueStyle" />
+            <option value="$PROJECT_DIR$/app" />
+          </set>
+        </option>
+        <option name="resolveModulePerSourceSet" value="false" />
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>

+ 25 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google" />
+      <option name="name" value="Google" />
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
+    </remote-repository>
+  </component>
+</project>

+ 93 - 0
.idea/misc.xml

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="MarkdownNavigator.ProfileManager" plain-text-search-scope="Project Files" />
+  <component name="MarkdownProjectSettings" wasCopied="true">
+    <PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="false" showSelectionInPreview="true" openRemoteLinks="true" replaceUnicodeEmoji="false" lastLayoutSetsDefault="false">
+      <PanelProvider>
+        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
+      </PanelProvider>
+    </PreviewSettings>
+    <ParserSettings gitHubSyntaxChange="false" emojiShortcuts="0" emojiImages="0">
+      <PegdownExtensions>
+        <option name="ABBREVIATIONS" value="false" />
+        <option name="ANCHORLINKS" value="true" />
+        <option name="ASIDE" value="false" />
+        <option name="ATXHEADERSPACE" value="true" />
+        <option name="AUTOLINKS" value="false" />
+        <option name="DEFINITIONS" value="false" />
+        <option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
+        <option name="FENCED_CODE_BLOCKS" value="true" />
+        <option name="FOOTNOTES" value="false" />
+        <option name="HARDWRAPS" value="false" />
+        <option name="HTML_DEEP_PARSER" value="false" />
+        <option name="INSERTED" value="false" />
+        <option name="QUOTES" value="false" />
+        <option name="RELAXEDHRULES" value="true" />
+        <option name="SMARTS" value="false" />
+        <option name="STRIKETHROUGH" value="true" />
+        <option name="SUBSCRIPT" value="false" />
+        <option name="SUPERSCRIPT" value="false" />
+        <option name="SUPPRESS_HTML_BLOCKS" value="false" />
+        <option name="SUPPRESS_INLINE_HTML" value="false" />
+        <option name="TABLES" value="true" />
+        <option name="TASKLISTITEMS" value="true" />
+        <option name="TOC" value="false" />
+        <option name="WIKILINKS" value="true" />
+      </PegdownExtensions>
+      <ParserOptions>
+        <option name="ADMONITION_EXT" value="false" />
+        <option name="ATTRIBUTES_EXT" value="false" />
+        <option name="COMMONMARK_LISTS" value="true" />
+        <option name="DUMMY" value="false" />
+        <option name="EMOJI_SHORTCUTS" value="true" />
+        <option name="ENUMERATED_REFERENCES_EXT" value="false" />
+        <option name="FLEXMARK_FRONT_MATTER" value="false" />
+        <option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
+        <option name="GFM_TABLE_RENDERING" value="true" />
+        <option name="GITBOOK_URL_ENCODING" value="false" />
+        <option name="GITHUB_LISTS" value="false" />
+        <option name="GITHUB_WIKI_LINKS" value="true" />
+        <option name="GITLAB_EXT" value="false" />
+        <option name="GITLAB_MATH_EXT" value="false" />
+        <option name="GITLAB_MERMAID_EXT" value="false" />
+        <option name="HEADER_ID_NON_ASCII_TO_LOWERCASE" value="false" />
+        <option name="HEADER_ID_NO_DUPED_DASHES" value="false" />
+        <option name="JEKYLL_FRONT_MATTER" value="false" />
+        <option name="MACROS_EXT" value="false" />
+        <option name="NO_TEXT_ATTRIBUTES" value="false" />
+        <option name="PARSE_HTML_ANCHOR_ID" value="false" />
+        <option name="PLANTUML_FENCED_CODE" value="false" />
+        <option name="PUML_FENCED_CODE" value="false" />
+        <option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
+      </ParserOptions>
+    </ParserSettings>
+    <HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true" embedImages="false" embedHttpImages="false" imageUriSerials="false" addDocTypeHtml="true" noParaTags="false" plantUmlConversion="0" mathConversion="0">
+      <GeneratorProvider>
+        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
+      </GeneratorProvider>
+      <headerTop />
+      <headerBottom />
+      <bodyTop />
+      <bodyBottom />
+    </HtmlSettings>
+    <CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssUriSerial="true" isCssTextEnabled="false" isDynamicPageWidth="true">
+      <StylesheetProvider>
+        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
+      </StylesheetProvider>
+      <ScriptProviders />
+      <cssText />
+      <cssUriHistory />
+    </CssSettings>
+    <AnnotatorSettings targetHasSpaces="true" linkCaseMismatch="true" wikiCaseMismatch="true" wikiLinkHasDashes="true" notUnderWikiHome="true" targetNotWikiPageExt="true" notUnderSourceWikiHome="true" targetNameHasAnchor="true" targetPathHasAnchor="true" wikiLinkHasSlash="true" wikiLinkHasSubdir="true" wikiLinkHasOnlyAnchor="true" linkTargetsWikiHasExt="true" linkTargetsWikiHasBadExt="true" notUnderSameRepo="true" targetNotUnderVcs="false" linkNeedsExt="true" linkHasBadExt="true" linkTargetNeedsExt="true" linkTargetHasBadExt="true" wikiLinkNotInWiki="true" imageTargetNotInRaw="true" repoRelativeAcrossVcsRoots="true" multipleWikiTargetsMatch="true" unresolvedLinkReference="true" linkIsIgnored="true" anchorIsIgnored="true" anchorIsUnresolved="true" anchorLineReferenceIsUnresolved="true" anchorLineReferenceFormat="true" anchorHasDuplicates="true" abbreviationDuplicates="true" abbreviationNotUsed="true" attributeIdDuplicateDefinition="true" attributeIdNotUsed="true" footnoteDuplicateDefinition="true" footnoteUnresolved="true" footnoteDuplicates="true" footnoteNotUsed="true" macroDuplicateDefinition="true" macroUnresolved="true" macroDuplicates="true" macroNotUsed="true" referenceDuplicateDefinition="true" referenceUnresolved="true" referenceDuplicates="true" referenceNotUsed="true" referenceUnresolvedNumericId="true" enumRefDuplicateDefinition="true" enumRefUnresolved="true" enumRefDuplicates="true" enumRefNotUsed="true" enumRefLinkUnresolved="true" enumRefLinkDuplicates="true" simTocUpdateNeeded="true" simTocTitleSpaceNeeded="true" />
+    <HtmlExportSettings updateOnSave="false" parentDir="" targetDir="" cssDir="css" scriptDir="js" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetPathType="2" targetExt="" useTargetExt="false" noCssNoScripts="false" useElementStyleAttribute="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" linkFormatType="HTTP_ABSOLUTE" />
+    <LinkMapSettings>
+      <textMaps />
+    </LinkMapSettings>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>

+ 12 - 0
.idea/runConfigurations.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 1 - 0
DialogX/.gitignore

@@ -0,0 +1 @@
+/build

+ 31 - 0
DialogX/build.gradle

@@ -0,0 +1,31 @@
+apply plugin: 'com.android.library'
+
+android {
+    compileSdkVersion 30
+
+    defaultConfig {
+        minSdkVersion 21
+        targetSdkVersion 30
+        versionCode 1
+        versionName "1.0"
+
+        consumerProguardFiles "consumer-rules.pro"
+
+        renderscriptTargetApi 21
+        renderscriptSupportModeEnabled true    // Enable RS support
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation project(path: ':DialogXIOSStyle')
+    implementation project(path: ':DialogXKongzueStyle')
+}

+ 0 - 0
DialogX/consumer-rules.pro


+ 21 - 0
DialogX/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 5 - 0
DialogX/src/main/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.kongzue.dialogx">
+
+    /
+</manifest>

+ 47 - 0
DialogX/src/main/java/com/kongzue/dialogx/DialogX.java

@@ -0,0 +1,47 @@
+package com.kongzue.dialogx;
+
+import android.content.Context;
+import android.util.Log;
+
+import com.kongzue.dialogx.interfaces.BaseDialog;
+import com.kongzue.dialogx.interfaces.DialogXStyle;
+import com.kongzue.dialogx.style.IOSStyle;
+import com.kongzue.dialogx.style.KongzueStyle;
+import com.kongzue.dialogx.style.MaterialStyle;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/21 17:07
+ */
+public class DialogX {
+    
+    public static boolean DEBUGMODE = true;
+    
+    public static DialogXStyle globalStyle = MaterialStyle.style();
+    public static DialogX.THEME globalTheme = DialogX.THEME.LIGHT;
+    public static int dialogMaxWidth;
+    public static boolean autoShowInputKeyboard = true;
+    
+    public enum THEME {
+        LIGHT, DARK
+    }
+    
+    public static void init(Context context) {
+        if (context == null) {
+            error("DialogX.init: 初始化异常,context 为 null");
+            return;
+        }
+        BaseDialog.init(context);
+    }
+    
+    public static void log(Object o) {
+        if (DEBUGMODE) Log.i(">>>", o.toString());
+    }
+    
+    public static void error(Object o) {
+        if (DEBUGMODE) Log.e(">>>", o.toString());
+    }
+}

+ 256 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/InputDialog.java

@@ -0,0 +1,256 @@
+package com.kongzue.dialogx.dialogs;
+
+import com.kongzue.dialogx.interfaces.OnBackPressedListener;
+import com.kongzue.dialogx.interfaces.OnDialogButtonClickListener;
+import com.kongzue.dialogx.interfaces.OnInputDialogButtonClickListener;
+import com.kongzue.dialogx.util.InputInfo;
+import com.kongzue.dialogx.util.TextInfo;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/24 13:53
+ */
+public class InputDialog extends MessageDialog {
+    
+    public InputDialog() {
+        me = this;
+    }
+    
+    public InputDialog(CharSequence title, CharSequence message, CharSequence okText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+    }
+    
+    public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+    }
+    
+    public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, String inputText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+        this.inputText = inputText;
+    }
+    
+    public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+        this.otherText = otherText;
+    }
+    
+    public InputDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText, String inputText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+        this.otherText = otherText;
+        this.inputText = inputText;
+    }
+    
+    public CharSequence getOkButton() {
+        return okText;
+    }
+    
+    public InputDialog setOkButton(CharSequence okText) {
+        this.okText = okText;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getCancelButton() {
+        return cancelText;
+    }
+    
+    public InputDialog setCancelButton(CharSequence cancelText) {
+        this.cancelText = cancelText;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getOtherButton() {
+        return otherText;
+    }
+    
+    public InputDialog setOtherButton(CharSequence otherText) {
+        this.otherText = otherText;
+        refreshUI();
+        return this;
+    }
+    
+    public OnDialogButtonClickListener getOkButtonClickListener() {
+        return okButtonClickListener;
+    }
+    
+    public InputDialog setOkButtonClickListener(OnDialogButtonClickListener okButtonClickListener) {
+        this.okButtonClickListener = okButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public OnDialogButtonClickListener getCancelButtonClickListener() {
+        return cancelButtonClickListener;
+    }
+    
+    public InputDialog setCancelButtonClickListener(OnDialogButtonClickListener cancelButtonClickListener) {
+        this.cancelButtonClickListener = cancelButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public OnDialogButtonClickListener getOtherButtonClickListener() {
+        return otherButtonClickListener;
+    }
+    
+    public InputDialog setOtherButtonClickListener(OnDialogButtonClickListener otherButtonClickListener) {
+        this.otherButtonClickListener = otherButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getTitle() {
+        return title;
+    }
+    
+    public InputDialog setTitle(CharSequence title) {
+        this.title = title;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getMessage() {
+        return message;
+    }
+    
+    public InputDialog setMessage(CharSequence message) {
+        this.message = message;
+        refreshUI();
+        return this;
+    }
+    
+    public String getInputText() {
+        return inputText;
+    }
+    
+    public InputDialog setInputText(String inputText) {
+        this.inputText = inputText;
+        refreshUI();
+        return this;
+    }
+    
+    public String getInputHintText() {
+        return inputHintText;
+    }
+    
+    public InputDialog setInputHintText(String inputHintText) {
+        this.inputHintText = inputHintText;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getTitleTextInfo() {
+        return titleTextInfo;
+    }
+    
+    public InputDialog setTitleTextInfo(TextInfo titleTextInfo) {
+        this.titleTextInfo = titleTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getMessageTextInfo() {
+        return messageTextInfo;
+    }
+    
+    public InputDialog setMessageTextInfo(TextInfo messageTextInfo) {
+        this.messageTextInfo = messageTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getOkTextInfo() {
+        return okTextInfo;
+    }
+    
+    public InputDialog setOkTextInfo(TextInfo okTextInfo) {
+        this.okTextInfo = okTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getCancelTextInfo() {
+        return cancelTextInfo;
+    }
+    
+    public InputDialog setCancelTextInfo(TextInfo cancelTextInfo) {
+        this.cancelTextInfo = cancelTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getOtherTextInfo() {
+        return otherTextInfo;
+    }
+    
+    public InputDialog setOtherTextInfo(TextInfo otherTextInfo) {
+        this.otherTextInfo = otherTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public InputInfo getInputInfo() {
+        return inputInfo;
+    }
+    
+    public InputDialog setInputInfo(InputInfo inputInfo) {
+        this.inputInfo = inputInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public int getButtonOrientation() {
+        return buttonOrientation;
+    }
+    
+    public InputDialog setButtonOrientation(int buttonOrientation) {
+        this.buttonOrientation = buttonOrientation;
+        refreshUI();
+        return this;
+    }
+    
+    public boolean isCancelable() {
+        return cancelable;
+    }
+    
+    public InputDialog setCancelable(boolean cancelable) {
+        this.cancelable = cancelable;
+        return this;
+    }
+    
+    public OnBackPressedListener getOnBackPressedListener() {
+        return onBackPressedListener;
+    }
+    
+    public InputDialog setOnBackPressedListener(OnBackPressedListener onBackPressedListener) {
+        this.onBackPressedListener = onBackPressedListener;
+        return this;
+    }
+    
+    public boolean isAutoShowInputKeyboard() {
+        return autoShowInputKeyboard;
+    }
+    
+    public InputDialog setAutoShowInputKeyboard(boolean autoShowInputKeyboard) {
+        this.autoShowInputKeyboard = autoShowInputKeyboard;
+        return this;
+    }
+}

+ 653 - 0
DialogX/src/main/java/com/kongzue/dialogx/dialogs/MessageDialog.java

@@ -0,0 +1,653 @@
+package com.kongzue.dialogx.dialogs;
+
+import android.animation.Animator;
+import android.content.Context;
+import android.text.InputFilter;
+import android.text.InputType;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.animation.AccelerateInterpolator;
+import android.view.animation.Animation;
+import android.view.animation.AnimationUtils;
+import android.view.animation.DecelerateInterpolator;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.Space;
+import android.widget.TextView;
+
+import com.kongzue.dialogx.DialogX;
+import com.kongzue.dialogx.R;
+import com.kongzue.dialogx.impl.AnimatorListenerEndCallBack;
+import com.kongzue.dialogx.interfaces.BaseDialog;
+import com.kongzue.dialogx.interfaces.DialogLifecycleCallback;
+import com.kongzue.dialogx.interfaces.DialogXStyle;
+import com.kongzue.dialogx.interfaces.OnBackPressedListener;
+import com.kongzue.dialogx.interfaces.OnDialogButtonClickListener;
+import com.kongzue.dialogx.interfaces.OnInputDialogButtonClickListener;
+import com.kongzue.dialogx.util.views.BlurView;
+import com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout;
+import com.kongzue.dialogx.util.InputInfo;
+import com.kongzue.dialogx.util.views.MaxRelativeLayout;
+import com.kongzue.dialogx.util.TextInfo;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/21 17:08
+ */
+public class MessageDialog extends BaseDialog {
+    
+    protected MessageDialog me;
+    
+    private DialogLifecycleCallback<MessageDialog> dialogLifecycleCallback;
+    
+    public MessageDialog() {
+        me = this;
+    }
+    
+    private View dialogView;
+    
+    protected CharSequence title;
+    protected CharSequence message;
+    protected CharSequence okText;
+    protected CharSequence cancelText;
+    protected CharSequence otherText;
+    protected String inputText;
+    protected String inputHintText;
+    
+    protected TextInfo titleTextInfo;
+    protected TextInfo messageTextInfo;
+    protected TextInfo okTextInfo;
+    protected TextInfo cancelTextInfo;
+    protected TextInfo otherTextInfo;
+    protected InputInfo inputInfo;
+    
+    protected OnDialogButtonClickListener okButtonClickListener;
+    protected OnDialogButtonClickListener cancelButtonClickListener;
+    protected OnDialogButtonClickListener otherButtonClickListener;
+    
+    protected int buttonOrientation;
+    
+    public MessageDialog(CharSequence title, CharSequence message, CharSequence okText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+    }
+    
+    public MessageDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+    }
+    
+    public MessageDialog(CharSequence title, CharSequence message, CharSequence okText, CharSequence cancelText, CharSequence otherText) {
+        this.title = title;
+        this.message = message;
+        this.okText = okText;
+        this.cancelText = cancelText;
+        this.otherText = otherText;
+    }
+    
+    protected DialogImpl dialogImpl;
+    
+    public void show() {
+        int layoutId = R.layout.layout_dialogx_material;
+        switch (theme) {
+            case LIGHT:
+                layoutId = style.layout(true);
+                break;
+            case DARK:
+                layoutId = style.layout(false);
+                break;
+        }
+        dialogView = createView(layoutId);
+        dialogImpl = new DialogImpl(dialogView);
+        show(dialogView);
+    }
+    
+    public void refreshUI() {
+        if (dialogImpl == null) return;
+        dialogImpl.refreshView();
+    }
+    
+    class DialogImpl {
+        BlurView blurView;
+        
+        DialogXBaseRelativeLayout boxRoot;
+        MaxRelativeLayout bkg;
+        TextView txtDialogTitle;
+        TextView txtDialogTip;
+        RelativeLayout boxCustom;
+        EditText txtInput;
+        LinearLayout boxButton;
+        TextView btnSelectOther;
+        View spaceOtherButton;
+        TextView btnSelectNegative;
+        TextView btnSelectPositive;
+        
+        public DialogImpl(View convertView) {
+            boxRoot = convertView.findViewById(R.id.box_root);
+            bkg = convertView.findViewById(R.id.bkg);
+            txtDialogTitle = convertView.findViewById(R.id.txt_dialog_title);
+            txtDialogTip = convertView.findViewById(R.id.txt_dialog_tip);
+            boxCustom = convertView.findViewById(R.id.box_custom);
+            txtInput = convertView.findViewById(R.id.txt_input);
+            boxButton = convertView.findViewById(R.id.box_button);
+            btnSelectOther = convertView.findViewById(R.id.btn_selectOther);
+            spaceOtherButton = convertView.findViewById(R.id.space_other_button);
+            btnSelectNegative = convertView.findViewById(R.id.btn_selectNegative);
+            btnSelectPositive = convertView.findViewById(R.id.btn_selectPositive);
+            init();
+            refreshView();
+        }
+        
+        private void init() {
+            txtDialogTitle.getPaint().setFakeBoldText(true);
+            btnSelectNegative.getPaint().setFakeBoldText(true);
+            btnSelectPositive.getPaint().setFakeBoldText(true);
+            btnSelectOther.getPaint().setFakeBoldText(true);
+            
+            boxRoot.setOnLifecycleCallBack(new DialogXBaseRelativeLayout.OnLifecycleCallBack() {
+                @Override
+                public void onShow() {
+                    isShow = true;
+                    boxRoot.setAlpha(0f);
+                    int enterAnimResId = style.enterAnimResId() == 0 ? R.anim.anim_dialogx_default_enter : style.enterAnimResId();
+                    Animation enterAnim = AnimationUtils.loadAnimation(getContext(), enterAnimResId);
+                    enterAnim.setInterpolator(new DecelerateInterpolator());
+                    bkg.startAnimation(enterAnim);
+                    
+                    boxRoot.animate().setDuration(enterAnim.getDuration()).alpha(1f).setInterpolator(new DecelerateInterpolator()).setDuration(300).setListener(null);
+                    
+                    getDialogLifecycleCallback().onShow(me);
+                    
+                    if (style.blurSettings() != null && style.blurSettings().blurBackground()) {
+                        bkg.post(new Runnable() {
+                            @Override
+                            public void run() {
+                                int blurFrontColor = getResources().getColor(style.blurSettings().blurForwardColorRes(isLightTheme()));
+                                blurView = new BlurView(bkg.getContext(), null);
+                                RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(bkg.getWidth(), bkg.getHeight());
+                                params.addRule(RelativeLayout.CENTER_IN_PARENT);
+                                blurView.setOverlayColor(blurFrontColor);
+                                blurView.setTag("blurView");
+                                blurView.setRadiusPx(style.blurSettings().blurBackgroundRoundRadiusPx());
+                                bkg.addView(blurView, 0, params);
+                            }
+                        });
+                    }
+                    
+                    if (autoShowInputKeyboard) {
+                        txtInput.postDelayed(new Runnable() {
+                            @Override
+                            public void run() {
+                                txtInput.requestFocus();
+                                txtInput.setFocusableInTouchMode(true);
+                                InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+                                imm.showSoftInput(txtInput, InputMethodManager.RESULT_UNCHANGED_SHOWN);
+                                txtInput.setSelection(txtInput.getText().length());
+                            }
+                        }, 300);
+                    }
+                }
+                
+                @Override
+                public void onDismiss() {
+                    isShow = false;
+                    getDialogLifecycleCallback().onDismiss(me);
+                }
+            });
+        }
+        
+        private void refreshView() {
+            bkg.setMaxWidth(DialogX.dialogMaxWidth);
+            if (me instanceof InputDialog) {
+                txtInput.setVisibility(View.VISIBLE);
+            } else {
+                txtInput.setVisibility(View.GONE);
+            }
+            boxRoot.setClickable(true);
+            
+            showText(txtDialogTitle, title);
+            showText(txtDialogTip, message);
+            showText(btnSelectPositive, okText);
+            showText(btnSelectNegative, cancelText);
+            showText(btnSelectOther, otherText);
+            showText(txtInput, inputText);
+            if (spaceOtherButton != null) {
+                if (otherText == null) {
+                    spaceOtherButton.setVisibility(View.GONE);
+                } else {
+                    spaceOtherButton.setVisibility(View.VISIBLE);
+                }
+            }
+            
+            useTextInfo(txtDialogTitle, titleTextInfo);
+            useTextInfo(txtDialogTip, messageTextInfo);
+            useTextInfo(btnSelectPositive, okTextInfo);
+            useTextInfo(btnSelectNegative, cancelTextInfo);
+            useTextInfo(btnSelectOther, otherTextInfo);
+            if (inputInfo != null) {
+                if (inputInfo.getMAX_LENGTH() != -1)
+                    txtInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(inputInfo.getMAX_LENGTH())});
+                int inputType = InputType.TYPE_CLASS_TEXT | inputInfo.getInputType();
+                if (inputInfo.isMultipleLines()) {
+                    inputType = inputType | InputType.TYPE_TEXT_FLAG_MULTI_LINE;
+                }
+                txtInput.setInputType(inputType);
+                if (inputInfo.getTextInfo() != null)
+                    useTextInfo(txtInput, inputInfo.getTextInfo());
+                
+                if (inputInfo.isSelectAllText()) {
+                    txtInput.post(new Runnable() {
+                        @Override
+                        public void run() {
+                            txtInput.selectAll();
+                        }
+                    });
+                }
+            }
+            
+            int visibleButtonCount = 0;
+            if (!isNull(okText)) {
+                visibleButtonCount = visibleButtonCount + 1;
+            }
+            if (!isNull(cancelText)) {
+                visibleButtonCount = visibleButtonCount + 1;
+            }
+            if (!isNull(otherText)) {
+                visibleButtonCount = visibleButtonCount + 1;
+            }
+            
+            boxButton.setOrientation(buttonOrientation);
+            if (buttonOrientation == LinearLayout.VERTICAL) {
+                //纵向
+                if (style.verticalButtonOrder() != null && style.verticalButtonOrder().length != 0) {
+                    boxButton.removeAllViews();
+                    for (int buttonType : style.verticalButtonOrder()) {
+                        switch (buttonType) {
+                            case DialogXStyle.BUTTON_OK:
+                                boxButton.addView(btnSelectPositive);
+                                if (style.overrideVerticalButtonRes() != null) {
+                                    btnSelectPositive.setBackgroundResource(
+                                            style.overrideVerticalButtonRes().overrideVerticalOkButtonBackgroundRes(visibleButtonCount, isLightTheme())
+                                    );
+                                }
+                                break;
+                            case DialogXStyle.BUTTON_OTHER:
+                                boxButton.addView(btnSelectOther);
+                                if (style.overrideVerticalButtonRes() != null) {
+                                    btnSelectOther.setBackgroundResource(
+                                            style.overrideVerticalButtonRes().overrideVerticalOtherButtonBackgroundRes(visibleButtonCount, isLightTheme())
+                                    );
+                                }
+                                break;
+                            case DialogXStyle.BUTTON_CANCEL:
+                                boxButton.addView(btnSelectNegative);
+                                if (style.overrideVerticalButtonRes() != null) {
+                                    btnSelectNegative.setBackgroundResource(
+                                            style.overrideVerticalButtonRes().overrideVerticalCancelButtonBackgroundRes(visibleButtonCount, isLightTheme())
+                                    );
+                                }
+                                break;
+                            case DialogXStyle.SPACE:
+                                Space space = new Space(getContext());
+                                LinearLayout.LayoutParams spaceLp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
+                                spaceLp.weight = 1;
+                                boxButton.addView(space, spaceLp);
+                                break;
+                            case DialogXStyle.SPLIT:
+                                View splitView = new View(getContext());
+                                splitView.setBackgroundColor(getResources().getColor(style.splitColorRes(isLightTheme())));
+                                LinearLayout.LayoutParams viewLp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, style.splitWidthPx());
+                                boxButton.addView(splitView, viewLp);
+                                break;
+                        }
+                    }
+                }
+            } else {
+                //横向
+                if (style.horizontalButtonOrder() != null && style.horizontalButtonOrder().length != 0) {
+                    boxButton.removeAllViews();
+                    for (int buttonType : style.horizontalButtonOrder()) {
+                        switch (buttonType) {
+                            case DialogXStyle.BUTTON_OK:
+                                boxButton.addView(btnSelectPositive);
+                                if (style.overrideHorizontalButtonRes() != null) {
+                                    btnSelectPositive.setBackgroundResource(
+                                            style.overrideHorizontalButtonRes().overrideHorizontalOkButtonBackgroundRes(visibleButtonCount, isLightTheme())
+                                    );
+                                }
+                                break;
+                            case DialogXStyle.BUTTON_OTHER:
+                                boxButton.addView(btnSelectOther);
+                                if (style.overrideHorizontalButtonRes() != null) {
+                                    btnSelectOther.setBackgroundResource(
+                                            style.overrideHorizontalButtonRes().overrideHorizontalOtherButtonBackgroundRes(visibleButtonCount, isLightTheme())
+                                    );
+                                }
+                                break;
+                            case DialogXStyle.BUTTON_CANCEL:
+                                boxButton.addView(btnSelectNegative);
+                                if (style.overrideHorizontalButtonRes() != null) {
+                                    btnSelectNegative.setBackgroundResource(
+                                            style.overrideHorizontalButtonRes().overrideHorizontalCancelButtonBackgroundRes(visibleButtonCount, isLightTheme())
+                                    );
+                                }
+                                break;
+                            case DialogXStyle.SPACE:
+                                if (boxButton.getChildCount() >= 1) {
+                                    if (boxButton.getChildAt(boxButton.getChildCount() - 1).getVisibility() == View.GONE) {
+                                        break;
+                                    }
+                                } else {
+                                    break;
+                                }
+                                Space space = new Space(getContext());
+                                LinearLayout.LayoutParams spaceLp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+                                spaceLp.weight = 1;
+                                boxButton.addView(space, spaceLp);
+                                break;
+                            case DialogXStyle.SPLIT:
+                                if (boxButton.getChildCount() >= 1) {
+                                    if (boxButton.getChildAt(boxButton.getChildCount() - 1).getVisibility() == View.GONE) {
+                                        break;
+                                    }
+                                } else {
+                                    break;
+                                }
+                                View splitView = new View(getContext());
+                                splitView.setBackgroundColor(getResources().getColor(style.splitColorRes(isLightTheme())));
+                                LinearLayout.LayoutParams viewLp = new LinearLayout.LayoutParams(style.splitWidthPx(), ViewGroup.LayoutParams.MATCH_PARENT);
+                                boxButton.addView(splitView, viewLp);
+                                break;
+                        }
+                    }
+                }
+            }
+            
+            //Events
+            if (cancelable) {
+                boxRoot.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        doDismiss(v);
+                    }
+                });
+            } else {
+                boxRoot.setOnClickListener(null);
+            }
+            boxRoot.setOnBackPressedListener(new OnBackPressedListener() {
+                @Override
+                public boolean onBackPressed() {
+                    if (cancelable) {
+                        dismiss();
+                    }
+                    return false;
+                }
+            });
+            btnSelectNegative.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (okButtonClickListener != null) {
+                        if (okButtonClickListener instanceof OnInputDialogButtonClickListener) {
+                            String s = txtInput == null ? "" : txtInput.getText().toString();
+                            if (!((OnInputDialogButtonClickListener) okButtonClickListener).onClick(me, v, s)) {
+                                doDismiss(v);
+                            }
+                        } else {
+                            if (!okButtonClickListener.onClick(me, v)) {
+                                doDismiss(v);
+                            }
+                        }
+                    } else {
+                        doDismiss(v);
+                    }
+                }
+            });
+            btnSelectPositive.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (cancelButtonClickListener != null) {
+                        if (cancelButtonClickListener instanceof OnInputDialogButtonClickListener) {
+                            String s = txtInput == null ? "" : txtInput.getText().toString();
+                            if (!((OnInputDialogButtonClickListener) cancelButtonClickListener).onClick(me, v, s)) {
+                                doDismiss(v);
+                            }
+                        } else {
+                            if (!cancelButtonClickListener.onClick(me, v)) {
+                                doDismiss(v);
+                            }
+                        }
+                    } else {
+                        doDismiss(v);
+                    }
+                }
+            });
+            btnSelectOther.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    if (otherButtonClickListener != null) {
+                        if (otherButtonClickListener instanceof OnInputDialogButtonClickListener) {
+                            String s = txtInput == null ? "" : txtInput.getText().toString();
+                            if (!((OnInputDialogButtonClickListener) otherButtonClickListener).onClick(me, v, s)) {
+                                doDismiss(v);
+                            }
+                        } else {
+                            if (!otherButtonClickListener.onClick(me, v)) {
+                                doDismiss(v);
+                            }
+                        }
+                    } else {
+                        doDismiss(v);
+                    }
+                }
+            });
+            
+        }
+        
+        public void doDismiss(View v) {
+            if (v != null) v.setEnabled(false);
+            
+            int exitAnimResId = style.exitAnimResId() == 0 ? R.anim.anim_dialogx_default_exit : style.exitAnimResId();
+            Animation enterAnim = AnimationUtils.loadAnimation(getContext(), exitAnimResId);
+            enterAnim.setInterpolator(new AccelerateInterpolator());
+            bkg.startAnimation(enterAnim);
+            
+            boxRoot.animate().setDuration(300).alpha(0f).setInterpolator(new AccelerateInterpolator()).setDuration(enterAnim.getDuration()).setListener(new AnimatorListenerEndCallBack() {
+                @Override
+                public void onAnimationEnd(Animator animation) {
+                    dismiss(dialogView);
+                }
+            });
+        }
+    }
+    
+    public void dismiss() {
+        if (dialogImpl == null) return;
+        dialogImpl.doDismiss(null);
+    }
+    
+    public DialogLifecycleCallback<MessageDialog> getDialogLifecycleCallback() {
+        return dialogLifecycleCallback == null ? new DialogLifecycleCallback<MessageDialog>() {
+        } : dialogLifecycleCallback;
+    }
+    
+    public MessageDialog setDialogLifecycleCallback(DialogLifecycleCallback<MessageDialog> dialogLifecycleCallback) {
+        this.dialogLifecycleCallback = dialogLifecycleCallback;
+        return this;
+    }
+    
+    public MessageDialog setStyle(DialogXStyle style) {
+        this.style = style;
+        return this;
+    }
+    
+    public MessageDialog setTheme(DialogX.THEME theme) {
+        this.theme = theme;
+        return this;
+    }
+    
+    public CharSequence getOkButton() {
+        return okText;
+    }
+    
+    public MessageDialog setOkButton(CharSequence okText) {
+        this.okText = okText;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getCancelButton() {
+        return cancelText;
+    }
+    
+    public MessageDialog setCancelButton(CharSequence cancelText) {
+        this.cancelText = cancelText;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getOtherButton() {
+        return otherText;
+    }
+    
+    public MessageDialog setOtherButton(CharSequence otherText) {
+        this.otherText = otherText;
+        refreshUI();
+        return this;
+    }
+    
+    public OnDialogButtonClickListener getOkButtonClickListener() {
+        return okButtonClickListener;
+    }
+    
+    public MessageDialog setOkButtonClickListener(OnDialogButtonClickListener okButtonClickListener) {
+        this.okButtonClickListener = okButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public OnDialogButtonClickListener getCancelButtonClickListener() {
+        return cancelButtonClickListener;
+    }
+    
+    public MessageDialog setCancelButtonClickListener(OnDialogButtonClickListener cancelButtonClickListener) {
+        this.cancelButtonClickListener = cancelButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public OnDialogButtonClickListener getOtherButtonClickListener() {
+        return otherButtonClickListener;
+    }
+    
+    public MessageDialog setOtherButtonClickListener(OnDialogButtonClickListener otherButtonClickListener) {
+        this.otherButtonClickListener = otherButtonClickListener;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getTitle() {
+        return title;
+    }
+    
+    public MessageDialog setTitle(CharSequence title) {
+        this.title = title;
+        refreshUI();
+        return this;
+    }
+    
+    public CharSequence getMessage() {
+        return message;
+    }
+    
+    public MessageDialog setMessage(CharSequence message) {
+        this.message = message;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getTitleTextInfo() {
+        return titleTextInfo;
+    }
+    
+    public MessageDialog setTitleTextInfo(TextInfo titleTextInfo) {
+        this.titleTextInfo = titleTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getMessageTextInfo() {
+        return messageTextInfo;
+    }
+    
+    public MessageDialog setMessageTextInfo(TextInfo messageTextInfo) {
+        this.messageTextInfo = messageTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getOkTextInfo() {
+        return okTextInfo;
+    }
+    
+    public MessageDialog setOkTextInfo(TextInfo okTextInfo) {
+        this.okTextInfo = okTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getCancelTextInfo() {
+        return cancelTextInfo;
+    }
+    
+    public MessageDialog setCancelTextInfo(TextInfo cancelTextInfo) {
+        this.cancelTextInfo = cancelTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public TextInfo getOtherTextInfo() {
+        return otherTextInfo;
+    }
+    
+    public MessageDialog setOtherTextInfo(TextInfo otherTextInfo) {
+        this.otherTextInfo = otherTextInfo;
+        refreshUI();
+        return this;
+    }
+    
+    public int getButtonOrientation() {
+        return buttonOrientation;
+    }
+    
+    public MessageDialog setButtonOrientation(int buttonOrientation) {
+        this.buttonOrientation = buttonOrientation;
+        refreshUI();
+        return this;
+    }
+    
+    public boolean isCancelable() {
+        return cancelable;
+    }
+    
+    public MessageDialog setCancelable(boolean cancelable) {
+        this.cancelable = cancelable;
+        return this;
+    }
+    
+    public OnBackPressedListener getOnBackPressedListener() {
+        return onBackPressedListener;
+    }
+    
+    public MessageDialog setOnBackPressedListener(OnBackPressedListener onBackPressedListener) {
+        this.onBackPressedListener = onBackPressedListener;
+        return this;
+    }
+}

+ 75 - 0
DialogX/src/main/java/com/kongzue/dialogx/impl/ActivityLifecycleImpl.java

@@ -0,0 +1,75 @@
+package com.kongzue.dialogx.impl;
+
+import android.app.Activity;
+import android.app.Application;
+import android.content.Context;
+import android.os.Bundle;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/22 11:31
+ */
+public class ActivityLifecycleImpl implements Application.ActivityLifecycleCallbacks {
+    
+    private onActivityResumeCallBack onActivityResumeCallBack;
+    
+    public ActivityLifecycleImpl(ActivityLifecycleImpl.onActivityResumeCallBack onActivityResumeCallBack) {
+        this.onActivityResumeCallBack = onActivityResumeCallBack;
+    }
+    
+    public static void init(Context context, ActivityLifecycleImpl.onActivityResumeCallBack onActivityResumeCallBack) {
+        ((Application) context.getApplicationContext()).registerActivityLifecycleCallbacks(new ActivityLifecycleImpl(onActivityResumeCallBack));
+    }
+    
+    @Override
+    public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
+    
+    }
+    
+    @Override
+    public void onActivityStarted(@NonNull Activity activity) {
+    
+    }
+    
+    @Override
+    public void onActivityResumed(@NonNull Activity activity) {
+        if (activity.isDestroyed() || activity.isFinishing()) {
+            return;
+        }
+        if (onActivityResumeCallBack != null) {
+            onActivityResumeCallBack.onResume(activity);
+        }
+    }
+    
+    @Override
+    public void onActivityPaused(@NonNull Activity activity) {
+    
+    }
+    
+    @Override
+    public void onActivityStopped(@NonNull Activity activity) {
+    
+    }
+    
+    @Override
+    public void onActivitySaveInstanceState(@NonNull Activity activity, @NonNull Bundle outState) {
+    
+    }
+    
+    @Override
+    public void onActivityDestroyed(@NonNull Activity activity) {
+    
+    }
+    
+    public interface onActivityResumeCallBack {
+        void onResume(Activity activity);
+    }
+}

+ 30 - 0
DialogX/src/main/java/com/kongzue/dialogx/impl/AnimatorListenerEndCallBack.java

@@ -0,0 +1,30 @@
+package com.kongzue.dialogx.impl;
+
+import android.animation.Animator;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/22 14:37
+ */
+public abstract class AnimatorListenerEndCallBack implements Animator.AnimatorListener {
+    @Override
+    public void onAnimationStart(Animator animation) {
+    
+    }
+    
+    @Override
+    public abstract void onAnimationEnd(Animator animation);
+    
+    @Override
+    public void onAnimationCancel(Animator animation) {
+    
+    }
+    
+    @Override
+    public void onAnimationRepeat(Animator animation) {
+    
+    }
+}

+ 179 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/BaseDialog.java

@@ -0,0 +1,179 @@
+package com.kongzue.dialogx.interfaces;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.Typeface;
+import android.util.Log;
+import android.util.TypedValue;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.kongzue.dialogx.DialogX;
+import com.kongzue.dialogx.R;
+import com.kongzue.dialogx.impl.ActivityLifecycleImpl;
+import com.kongzue.dialogx.util.TextInfo;
+
+import java.lang.ref.WeakReference;
+
+import static com.kongzue.dialogx.DialogX.DEBUGMODE;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/22 14:10
+ */
+public class BaseDialog {
+    
+    private static WeakReference<FrameLayout> rootFrameLayout;
+    private static WeakReference<Context> applicationContextWeakReference;
+    
+    public static void init(Context context) {
+        applicationContextWeakReference = new WeakReference<>(context.getApplicationContext());
+        ActivityLifecycleImpl.init(context, new ActivityLifecycleImpl.onActivityResumeCallBack() {
+            @Override
+            public void onResume(Activity activity) {
+                try {
+                    rootFrameLayout = new WeakReference<>((FrameLayout) activity.getWindow().getDecorView().findViewById(android.R.id.content));
+                } catch (Exception e) {
+                    error("DialogX.init: 初始化异常,找不到Activity的根布局");
+                }
+            }
+        });
+    }
+    
+    public static void log(Object o) {
+        if (DEBUGMODE) Log.i(">>>", o.toString());
+    }
+    
+    public static void error(Object o) {
+        if (DEBUGMODE) Log.e(">>>", o.toString());
+    }
+    
+    public static void show(View view) {
+        if (rootFrameLayout == null || view == null) return;
+        rootFrameLayout.get().addView(view);
+    }
+    
+    public static void dismiss(View dialogView) {
+        if (rootFrameLayout == null || dialogView == null) return;
+        if (dialogView.isAttachedToWindow()) {
+            rootFrameLayout.get().removeView(dialogView);
+        }
+    }
+    
+    public static Context getContext() {
+        if (applicationContextWeakReference == null) return null;
+        return applicationContextWeakReference.get();
+    }
+    
+    protected boolean cancelable = true;
+    protected OnBackPressedListener onBackPressedListener;
+    protected boolean isShow;
+    protected DialogXStyle style;
+    protected DialogX.THEME theme;
+    protected boolean autoShowInputKeyboard;
+    
+    public BaseDialog() {
+        style = DialogX.globalStyle;
+        theme = DialogX.globalTheme;
+        autoShowInputKeyboard=  DialogX.autoShowInputKeyboard;
+    }
+    
+    public View createView(int layoutId) {
+        return LayoutInflater.from(getContext()).inflate(layoutId, null);
+    }
+    
+    public boolean isShow() {
+        return isShow;
+    }
+    
+    public DialogXStyle getStyle() {
+        return style;
+    }
+    
+    public DialogX.THEME getTheme() {
+        return theme;
+    }
+    
+    protected void useTextInfo(TextView textView, TextInfo textInfo) {
+        if (textInfo == null) return;
+        if (textView == null) return;
+        if (textInfo.getFontSize() > 0) {
+            textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, textInfo.getFontSize());
+        }
+        if (textInfo.getFontColor() != 1) {
+            textView.setTextColor(textInfo.getFontColor());
+        }
+        if (textInfo.getGravity() != -1) {
+            textView.setGravity(textInfo.getGravity());
+        }
+        Typeface font = Typeface.create(Typeface.SANS_SERIF, textInfo.isBold() ? Typeface.BOLD : Typeface.NORMAL);
+        textView.setTypeface(font);
+    }
+    
+    protected void showText(TextView textView, CharSequence text) {
+        if (text == null) {
+            textView.setVisibility(View.GONE);
+            textView.setText("");
+        } else {
+            textView.setVisibility(View.VISIBLE);
+            textView.setText(text);
+        }
+    }
+    
+    protected View createHorizontalSplitView(int color) {
+        View splitView = new View(getContext());
+        splitView.setBackgroundColor(color);
+        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 1);
+        splitView.setLayoutParams(lp);
+        return splitView;
+    }
+    
+    protected View createVerticalSplitView(int color,int height) {
+        View splitView = new View(getContext());
+        splitView.setBackgroundColor(color);
+        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(1, dip2px(height));
+        splitView.setLayoutParams(lp);
+        return splitView;
+    }
+    
+    public static boolean isNull(String s) {
+        if (s == null || s.trim().isEmpty() || "null".equals(s) || "(null)".equals(s)) {
+            return true;
+        }
+        return false;
+    }
+    
+    public static boolean isNull(CharSequence c) {
+        String s = String.valueOf(c);
+        if (c == null || s.trim().isEmpty() || "null".equals(s) || "(null)".equals(s)) {
+            return true;
+        }
+        return false;
+    }
+    
+    public Resources getResources() {
+        if (getContext() == null) return Resources.getSystem();
+        return getContext().getResources();
+    }
+    
+    public int dip2px(float dpValue) {
+        final float scale = getContext().getResources().getDisplayMetrics().density;
+        return (int) (dpValue * scale + 0.5f);
+    }
+    
+    public boolean isLightTheme(){
+        return theme == DialogX.THEME.LIGHT;
+    }
+    
+    public static FrameLayout getRootFrameLayout() {
+        return rootFrameLayout.get();
+    }
+}

+ 20 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogLifecycleCallback.java

@@ -0,0 +1,20 @@
+package com.kongzue.dialogx.interfaces;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/22 14:09
+ */
+public abstract class DialogLifecycleCallback<T extends BaseDialog> {
+    
+    public void onShow(T dialog){
+    
+    }
+    
+    public void onDismiss(T dialog){
+    
+    }
+    
+}

+ 66 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java

@@ -0,0 +1,66 @@
+package com.kongzue.dialogx.interfaces;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/26 13:14
+ */
+public interface DialogXStyle {
+    
+    int styleVer = 1;
+    
+    int BUTTON_OK = 1;
+    int BUTTON_CANCEL = 2;
+    int BUTTON_OTHER = 3;
+    int SPACE = 4;
+    int SPLIT = 5;
+    
+    int layout(boolean light);
+    
+    int enterAnimResId();
+    
+    int exitAnimResId();
+    
+    int[] verticalButtonOrder();
+    
+    int[] horizontalButtonOrder();
+    
+    int splitWidthPx();
+    
+    int splitColorRes(boolean light);
+    
+    BlurBackgroundSetting blurSettings();
+    
+    HorizontalButtonRes overrideHorizontalButtonRes();
+    
+    VerticalButtonRes overrideVerticalButtonRes();
+    
+    interface BlurBackgroundSetting {
+        
+        boolean blurBackground();
+        
+        int blurForwardColorRes(boolean light);
+        
+        int blurBackgroundRoundRadiusPx();
+    }
+    
+    interface HorizontalButtonRes {
+        
+        int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
+    }
+    
+    interface VerticalButtonRes {
+        
+        int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
+    }
+}

+ 12 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnBackPressedListener.java

@@ -0,0 +1,12 @@
+package com.kongzue.dialogx.interfaces;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/25 15:48
+ */
+public interface OnBackPressedListener {
+    boolean onBackPressed();
+}

+ 16 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnDialogButtonClickListener.java

@@ -0,0 +1,16 @@
+package com.kongzue.dialogx.interfaces;
+
+import android.view.View;
+
+/**
+ * Author: @Kongzue
+ * Github: https://github.com/kongzue/
+ * Homepage: http://kongzue.com/
+ * Mail: myzcxhh@live.cn
+ * CreateTime: 2019/3/29 18:44
+ */
+public interface OnDialogButtonClickListener {
+    
+    boolean onClick(BaseDialog baseDialog, View v);
+    
+}

+ 15 - 0
DialogX/src/main/java/com/kongzue/dialogx/interfaces/OnInputDialogButtonClickListener.java

@@ -0,0 +1,15 @@
+package com.kongzue.dialogx.interfaces;
+
+import android.view.View;
+
+/**
+ * Author: @Kongzue
+ * Github: https://github.com/kongzue/
+ * Homepage: http://kongzue.com/
+ * Mail: myzcxhh@live.cn
+ * CreateTime: 2019/4/8 21:09
+ */
+public interface OnInputDialogButtonClickListener extends OnDialogButtonClickListener{
+    
+    boolean onClick(BaseDialog baseDialog, View v, String inputStr);
+}

+ 101 - 0
DialogX/src/main/java/com/kongzue/dialogx/style/MaterialStyle.java

@@ -0,0 +1,101 @@
+package com.kongzue.dialogx.style;
+
+import com.kongzue.dialogx.R;
+import com.kongzue.dialogx.interfaces.DialogXStyle;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/26 13:09
+ */
+public class MaterialStyle implements DialogXStyle {
+    
+    private MaterialStyle() {
+    }
+    
+    public static MaterialStyle style() {
+        return new MaterialStyle();
+    }
+    
+    @Override
+    public int layout(boolean light) {
+        return light ? R.layout.layout_dialogx_material : R.layout.layout_dialogx_material_dark;
+    }
+    
+    @Override
+    public int enterAnimResId() {
+        return R.anim.anim_dialogx_default_enter;
+    }
+    
+    @Override
+    public int exitAnimResId() {
+        return R.anim.anim_dialogx_default_exit;
+    }
+    
+    @Override
+    public int[] verticalButtonOrder() {
+        return new int[]{BUTTON_OK, BUTTON_OTHER, BUTTON_CANCEL};
+    }
+    
+    @Override
+    public int[] horizontalButtonOrder() {
+        return new int[]{BUTTON_OTHER, SPACE, BUTTON_CANCEL, BUTTON_OK};
+    }
+    
+    @Override
+    public int splitWidthPx() {
+        return 1;
+    }
+    
+    @Override
+    public int splitColorRes(boolean light) {
+        return 0;
+    }
+    
+    @Override
+    public BlurBackgroundSetting blurSettings() {
+        return null;
+    }
+    
+    @Override
+    public HorizontalButtonRes overrideHorizontalButtonRes() {
+        return new HorizontalButtonRes() {
+            @Override
+            public int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_material_light : R.drawable.button_dialogx_material_night;
+            }
+            
+            @Override
+            public int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_material_light : R.drawable.button_dialogx_material_night;
+            }
+            
+            @Override
+            public int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_material_light : R.drawable.button_dialogx_material_night;
+            }
+        };
+    }
+    
+    @Override
+    public VerticalButtonRes overrideVerticalButtonRes() {
+        return new VerticalButtonRes() {
+            @Override
+            public int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_material_light : R.drawable.button_dialogx_material_night;
+            }
+            
+            @Override
+            public int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_material_light : R.drawable.button_dialogx_material_night;
+            }
+            
+            @Override
+            public int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_material_light : R.drawable.button_dialogx_material_night;
+            }
+        };
+    }
+}

+ 62 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/InputInfo.java

@@ -0,0 +1,62 @@
+package com.kongzue.dialogx.util;
+
+/**
+ * Author: @Kongzue
+ * Github: https://github.com/kongzue/
+ * Homepage: http://kongzue.com/
+ * Mail: myzcxhh@live.cn
+ * CreateTime: 2018/11/8 21:41
+ */
+public class InputInfo {
+    
+    private int MAX_LENGTH = -1;    //最大长度,-1不生效
+    private int inputType;          //类型详见 android.text.InputType
+    private TextInfo textInfo;      //默认字体样式
+    private boolean multipleLines;  //支持多行
+    private boolean selectAllText;  //默认选中所有文字(便于修改)
+    
+    public int getMAX_LENGTH() {
+        return MAX_LENGTH;
+    }
+    
+    public InputInfo setMAX_LENGTH(int MAX_LENGTH) {
+        this.MAX_LENGTH = MAX_LENGTH;
+        return this;
+    }
+    
+    public int getInputType() {
+        return inputType;
+    }
+    
+    public InputInfo setInputType(int inputType) {
+        this.inputType = inputType;
+        return this;
+    }
+    
+    public TextInfo getTextInfo() {
+        return textInfo;
+    }
+    
+    public InputInfo setTextInfo(TextInfo textInfo) {
+        this.textInfo = textInfo;
+        return this;
+    }
+    
+    public boolean isMultipleLines() {
+        return multipleLines;
+    }
+    
+    public InputInfo setMultipleLines(boolean multipleLines) {
+        this.multipleLines = multipleLines;
+        return this;
+    }
+    
+    public boolean isSelectAllText() {
+        return selectAllText;
+    }
+    
+    public InputInfo setSelectAllText(boolean selectAllText) {
+        this.selectAllText = selectAllText;
+        return this;
+    }
+}

+ 62 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/TextInfo.java

@@ -0,0 +1,62 @@
+package com.kongzue.dialogx.util;
+
+/**
+ * Author: @Kongzue
+ * Github: https://github.com/kongzue/
+ * Homepage: http://kongzue.com/
+ * Mail: myzcxhh@live.cn
+ * CreateTime: 2018/11/10 22:01
+ */
+public class TextInfo {
+    
+    private int fontSize = -1;              //字号大小,值为-1时使用默认样式,单位:dp
+    private int gravity = -1;               //对齐方式,值为-1时使用默认样式,取值可使用Gravity.CENTER等对齐方式
+    private int fontColor = 1;              //文字颜色,值为1时使用默认样式,取值可以用Color.rgb(r,g,b)等方式获取
+    private boolean bold = false;           //是否粗体
+    
+    public int getFontSize() {
+        return fontSize;
+    }
+    
+    public TextInfo setFontSize(int fontSize) {
+        this.fontSize = fontSize;
+        return this;
+    }
+    
+    public int getGravity() {
+        return gravity;
+    }
+    
+    public TextInfo setGravity(int gravity) {
+        this.gravity = gravity;
+        return this;
+    }
+    
+    public int getFontColor() {
+        return fontColor;
+    }
+    
+    public TextInfo setFontColor(int fontColor) {
+        this.fontColor = fontColor;
+        return this;
+    }
+    
+    public boolean isBold() {
+        return bold;
+    }
+    
+    public TextInfo setBold(boolean bold) {
+        this.bold = bold;
+        return this;
+    }
+    
+    @Override
+    public String toString() {
+        return "TextInfo{" +
+                "fontSize=" + fontSize +
+                ", gravity=" + gravity +
+                ", fontColor=" + fontColor +
+                ", bold=" + bold +
+                '}';
+    }
+}

+ 431 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/views/BlurView.java

@@ -0,0 +1,431 @@
+package com.kongzue.dialogx.util.views;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.ContextWrapper;
+import android.content.res.TypedArray;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffXfermode;
+import android.graphics.Rect;
+import android.graphics.RectF;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.util.TypedValue;
+import android.view.View;
+import android.view.ViewTreeObserver;
+
+import androidx.annotation.ColorInt;
+import androidx.renderscript.Allocation;
+import androidx.renderscript.Element;
+import androidx.renderscript.RenderScript;
+import androidx.renderscript.ScriptIntrinsicBlur;
+
+import com.kongzue.dialogx.DialogX;
+import com.kongzue.dialogx.R;
+import com.kongzue.dialogx.interfaces.BaseDialog;
+
+import static com.kongzue.dialogx.DialogX.DEBUGMODE;
+
+public class BlurView extends View {
+    private float mDownsampleFactor; // default 4
+    private int mOverlayColor; // default #aaffffff
+    private float mBlurRadius; // default 10dp (0 < r <= 25)
+    
+    private boolean mDirty;
+    private Bitmap mBitmapToBlur, mBlurredBitmap;
+    private Canvas mBlurringCanvas;
+    private RenderScript mRenderScript;
+    private ScriptIntrinsicBlur mBlurScript;
+    private Allocation mBlurInput, mBlurOutput;
+    private boolean mIsRendering;
+    private final Rect mRectSrc = new Rect(), mRectDst = new Rect();
+    // mDecorView should be the root view of the activity (even if you are on a different window like a dialog)
+    private View mDecorView;
+    // If the view is on different root view (usually means we are on a PopupWindow),
+    // we need to manually call invalidate() in onPreDraw(), otherwise we will not be able to see the changes
+    private boolean mDifferentRoot;
+    private static int RENDERING_COUNT;
+    
+    private Paint mPaint;
+    private RectF mRectF;
+    private float mXRadius;
+    private float mYRadius;
+    
+    private Bitmap mRoundBitmap;
+    private Canvas mTmpCanvas;
+    
+    public BlurView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        
+        TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.RealtimeBlurView);
+        mBlurRadius = a.getDimension(
+                R.styleable.RealtimeBlurView_realtimeBlurRadius,
+                TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 35, context.getResources().getDisplayMetrics())
+        );
+        mDownsampleFactor = a.getFloat(R.styleable.RealtimeBlurView_realtimeDownsampleFactor, 4);
+        mOverlayColor = a.getColor(R.styleable.RealtimeBlurView_realtimeOverlayColor, 0x00ffffff);
+        
+        //ready rounded corner
+        mPaint = new Paint();
+        mPaint.setAntiAlias(true);
+        mRectF = new RectF();
+        
+        mXRadius = a.getDimension(R.styleable.RealtimeBlurView_xRadius, TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 15, context.getResources().getDisplayMetrics()));
+        mYRadius = a.getDimension(R.styleable.RealtimeBlurView_yRadius, TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 15, context.getResources().getDisplayMetrics()));
+        a.recycle();
+    }
+    
+    public void setBlurRadius(float radius) {
+        if (mBlurRadius != radius) {
+            mBlurRadius = radius;
+            mDirty = true;
+            invalidate();
+        }
+    }
+    
+    public void setRadius(float x, float y) {
+        if (mXRadius != x || mYRadius != y) {
+            mXRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, x, getContext().getResources().getDisplayMetrics());
+            mYRadius = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, y, getContext().getResources().getDisplayMetrics());
+            mDirty = true;
+            invalidate();
+        }
+    }
+    
+    public void setRadiusPx(float r) {
+        if (mXRadius != r || mYRadius != r) {
+            mXRadius = r;
+            mYRadius = r;
+            mDirty = true;
+            invalidate();
+        }
+    }
+    
+    public void setDownsampleFactor(float factor) {
+        if (factor <= 0) {
+            throw new IllegalArgumentException("Downsample factor must be greater than 0.");
+        }
+        
+        if (mDownsampleFactor != factor) {
+            mDownsampleFactor = factor;
+            mDirty = true; // may also change blur radius
+            releaseBitmap();
+            invalidate();
+        }
+    }
+    
+    public void setOverlayColor(int color) {
+        if (mOverlayColor != color) {
+            mOverlayColor = color;
+            invalidate();
+        }
+    }
+    
+    private void releaseBitmap() {
+        if (mBlurInput != null) {
+            mBlurInput.destroy();
+            mBlurInput = null;
+        }
+        if (mBlurOutput != null) {
+            mBlurOutput.destroy();
+            mBlurOutput = null;
+        }
+        if (mBitmapToBlur != null) {
+            mBitmapToBlur.recycle();
+            mBitmapToBlur = null;
+        }
+        if (mBlurredBitmap != null) {
+            mBlurredBitmap.recycle();
+            mBlurredBitmap = null;
+        }
+    }
+    
+    private void releaseScript() {
+        if (mRenderScript != null) {
+            mRenderScript.destroy();
+            mRenderScript = null;
+        }
+        if (mBlurScript != null) {
+            mBlurScript.destroy();
+            mBlurScript = null;
+        }
+    }
+    
+    protected void release() {
+        releaseBitmap();
+        releaseScript();
+    }
+    
+    protected boolean prepare() {
+        if (mBlurRadius == 0) {
+            release();
+            return false;
+        }
+        
+        float downsampleFactor = mDownsampleFactor;
+        
+        if (mDirty || mRenderScript == null) {
+            if (supportRenderScript) {
+                if (mRenderScript == null) {
+                    try {
+                        mRenderScript = RenderScript.create(getContext());
+                        mBlurScript = ScriptIntrinsicBlur.create(mRenderScript, Element.U8_4(mRenderScript));
+                        
+                    } catch (Exception e) {
+                        if (isDebug()) {
+                            e.printStackTrace();
+                        }
+                    }
+                }
+                
+                mDirty = false;
+                float radius = mBlurRadius / downsampleFactor;
+                if (radius > 25) {
+                    downsampleFactor = downsampleFactor * radius / 25;
+                    radius = 25;
+                }
+                mBlurScript.setRadius(radius);
+            }
+        }
+        
+        final int width = getWidth();
+        final int height = getHeight();
+        
+        int scaledWidth = Math.max(1, (int) (width / downsampleFactor));
+        int scaledHeight = Math.max(1, (int) (height / downsampleFactor));
+        
+        if (mBlurringCanvas == null || mBlurredBitmap == null || mBlurredBitmap.getWidth() != scaledWidth || mBlurredBitmap.getHeight() != scaledHeight) {
+            releaseBitmap();
+            
+            boolean r = false;
+            try {
+                mBitmapToBlur = Bitmap.createBitmap(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);
+                if (mBitmapToBlur == null) {
+                    return false;
+                }
+                mBlurringCanvas = new Canvas(mBitmapToBlur);
+                
+                mBlurInput = Allocation.createFromBitmap(mRenderScript, mBitmapToBlur,
+                        Allocation.MipmapControl.MIPMAP_NONE, Allocation.USAGE_SCRIPT
+                );
+                mBlurOutput = Allocation.createTyped(mRenderScript, mBlurInput.getType());
+                
+                mBlurredBitmap = Bitmap.createBitmap(scaledWidth, scaledHeight, Bitmap.Config.ARGB_8888);
+                if (mBlurredBitmap == null) {
+                    return false;
+                }
+                
+                r = true;
+            } catch (OutOfMemoryError e) {
+                if (isDebug()) e.printStackTrace();
+            } catch (Exception e) {
+                if (isDebug()) e.printStackTrace();
+            } finally {
+                if (!r) {
+                    releaseBitmap();
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+    
+    protected void blur(Bitmap bitmapToBlur, Bitmap blurredBitmap) {
+        mBlurInput.copyFrom(bitmapToBlur);
+        mBlurScript.setInput(mBlurInput);
+        mBlurScript.forEach(mBlurOutput);
+        mBlurOutput.copyTo(blurredBitmap);
+    }
+    
+    private final ViewTreeObserver.OnPreDrawListener preDrawListener = new ViewTreeObserver.OnPreDrawListener() {
+        @Override
+        public boolean onPreDraw() {
+            final int[] locations = new int[2];
+            Bitmap oldBmp = mBlurredBitmap;
+            View decor = mDecorView;
+            if (decor != null && isShown() && prepare()) {
+                boolean redrawBitmap = mBlurredBitmap != oldBmp;
+                oldBmp = null;
+                decor.getLocationOnScreen(locations);
+                int x = -locations[0];
+                int y = -locations[1];
+                
+                getLocationOnScreen(locations);
+                x += locations[0];
+                y += locations[1];
+                
+                // just erase transparent
+                mBitmapToBlur.eraseColor(mOverlayColor & 0xffffff);
+                
+                int rc = mBlurringCanvas.save();
+                mIsRendering = true;
+                RENDERING_COUNT++;
+                try {
+                    mBlurringCanvas.scale(1.f * mBitmapToBlur.getWidth() / getWidth(), 1.f * mBitmapToBlur.getHeight() / getHeight());
+                    mBlurringCanvas.translate(-x, -y);
+                    if (decor.getBackground() != null) {
+                        decor.getBackground().draw(mBlurringCanvas);
+                    }
+                    decor.draw(mBlurringCanvas);
+                } catch (Exception e) {
+                    if (isDebug()) e.printStackTrace();
+                } finally {
+                    mIsRendering = false;
+                    RENDERING_COUNT--;
+                    mBlurringCanvas.restoreToCount(rc);
+                }
+                
+                blur(mBitmapToBlur, mBlurredBitmap);
+                
+                if (redrawBitmap || mDifferentRoot) {
+                    invalidate();
+                }
+            }
+            
+            return true;
+        }
+    };
+    
+    protected View getActivityDecorView() {
+        Context ctx = getContext();
+        for (int i = 0; i < 4 && ctx != null && !(ctx instanceof Activity) && ctx instanceof ContextWrapper; i++) {
+            ctx = ((ContextWrapper) ctx).getBaseContext();
+        }
+        if (ctx instanceof Activity) {
+            return ((Activity) ctx).getWindow().getDecorView();
+        } else {
+            return null;
+        }
+    }
+    
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        mDecorView = BaseDialog.getRootFrameLayout();
+        if (mDecorView != null) {
+            mDecorView.getViewTreeObserver().addOnPreDrawListener(preDrawListener);
+            mDifferentRoot = mDecorView.getRootView() != getRootView();
+            if (mDifferentRoot) {
+                mDecorView.postInvalidate();
+            }
+        } else {
+            mDifferentRoot = false;
+        }
+    }
+    
+    @Override
+    protected void onDetachedFromWindow() {
+        if (mDecorView != null) {
+            mDecorView.getViewTreeObserver().removeOnPreDrawListener(preDrawListener);
+        }
+        release();
+        super.onDetachedFromWindow();
+    }
+    
+    @Override
+    public void draw(Canvas canvas) {
+        if (mIsRendering) {
+            // Quit here, don't draw views above me
+            //throw STOP_EXCEPTION;
+        } else if (RENDERING_COUNT > 0) {
+            // Doesn't support blurview overlap on another blurview
+        } else {
+            super.draw(canvas);
+        }
+    }
+    
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+        drawBlurredBitmap(canvas, mBlurredBitmap, mOverlayColor);
+    }
+    
+    /**
+     * Custom draw the blurred bitmap and color to define your own shape
+     *
+     * @param canvas
+     * @param blurredBitmap
+     * @param overlayColor
+     */
+    protected void drawBlurredBitmap(Canvas canvas, Bitmap blurredBitmap, int overlayColor) {
+        if (getWidth() > 0 && getHeight() > 0) {
+            Bitmap output = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
+            Canvas cacheCanvas = new Canvas(output);
+            if (blurredBitmap != null) {
+                mRectSrc.right = blurredBitmap.getWidth();
+                mRectSrc.bottom = blurredBitmap.getHeight();
+                mRectDst.right = getWidth();
+                mRectDst.bottom = getHeight();
+                cacheCanvas.drawBitmap(blurredBitmap, mRectSrc, mRectDst, null);
+            }
+            cacheCanvas.drawColor(supportRenderScript ? overlayColor : removeAlphaColor(overlayColor));
+            
+            //Rounded corner
+            mRectF.right = getWidth();
+            mRectF.bottom = getHeight();
+            
+            mRoundBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
+            mTmpCanvas = new Canvas(mRoundBitmap);
+            Paint cutPaint = new Paint();
+            cutPaint.setAntiAlias(true);
+            cutPaint.setColor(Color.WHITE);
+            mTmpCanvas.drawRoundRect(mRectF, mXRadius, mYRadius, cutPaint);
+            
+            mPaint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));
+            if (mRoundBitmap != null && !mRoundBitmap.isRecycled()) {
+                cacheCanvas.drawBitmap(mRoundBitmap, 0, 0, mPaint);
+            }
+            canvas.drawBitmap(output, 0, 0, null);
+        }
+    }
+    
+    private static class StopException extends RuntimeException {
+    }
+    
+    private static boolean supportRenderScript = false;
+    
+    private static int removeAlphaColor(@ColorInt int color) {
+        int alpha = 255;
+        int red = Color.red(color);
+        int green = Color.green(color);
+        int blue = Color.blue(color);
+        return Color.argb(alpha, red, green, blue);
+    }
+    
+    static {
+        /**
+         * 之所以需要启动一个新线程检测RenderScript是否可用的原因是不清楚Android什么时候对loadClass做了变更,
+         * 会直接抛出NoClassDefFoundError无法拦截,在主线程检测会导致程序直接闪退,因此改为异步检测。
+         * 检测后会给定(boolean)supportRenderScript用于判断时光支持
+         */
+        new Thread() {
+            @Override
+            public void run() {
+                try {
+                    BlurView.class.getClassLoader().loadClass(RenderScript.class.getCanonicalName());
+                    supportRenderScript = true;
+                } catch (Throwable e) {
+                    error("\n错误!\nRenderScript支持库未启用,要启用模糊效果,请在您的app的Gradle配置文件中添加以下语句:" +
+                            "\nandroid { \n...\n  defaultConfig { \n    ...\n    renderscriptTargetApi 17 \n    renderscriptSupportModeEnabled true \n  }\n}");
+                    supportRenderScript = false;
+                }
+            }
+        }.start();
+    }
+    
+    static boolean isDebug() {
+        return DialogX.DEBUGMODE;
+    }
+    
+    public static void log(Object o) {
+        if (DEBUGMODE) Log.i(">>>", o.toString());
+    }
+    
+    public static void error(Object o) {
+        if (DEBUGMODE) Log.e(">>>", o.toString());
+    }
+}

+ 122 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/views/DialogXBaseRelativeLayout.java

@@ -0,0 +1,122 @@
+package com.kongzue.dialogx.util.views;
+
+import android.content.Context;
+import android.os.Build;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.WindowInsets;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.RelativeLayout;
+
+import com.kongzue.dialogx.interfaces.OnBackPressedListener;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/22 13:53
+ */
+public class DialogXBaseRelativeLayout extends RelativeLayout {
+    
+    private OnLifecycleCallBack onLifecycleCallBack;
+    private OnBackPressedListener onBackPressedListener;
+    
+    public DialogXBaseRelativeLayout(Context context) {
+        super(context);
+        init();
+    }
+    
+    public DialogXBaseRelativeLayout(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        init();
+    }
+    
+    public DialogXBaseRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init();
+    }
+    
+    public DialogXBaseRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+        init();
+    }
+    
+    private void init() {
+        setFocusableInTouchMode(true);
+        requestFocus();
+    }
+    
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        if (event.getAction() == KeyEvent.ACTION_UP && event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
+            if (onBackPressedListener != null) {
+                onBackPressedListener.onBackPressed();
+            }
+            return true;
+        }
+        return super.dispatchKeyEvent(event);
+    }
+    
+    @Override
+    public boolean onTouchEvent(MotionEvent event) {
+        InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+        imm.hideSoftInputFromWindow(getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
+        return super.onTouchEvent(event);
+    }
+    
+    @Override
+    protected void onAttachedToWindow() {
+        super.onAttachedToWindow();
+        if (onLifecycleCallBack != null) {
+            onLifecycleCallBack.onShow();
+        }
+    }
+    
+    @Override
+    protected void onDetachedFromWindow() {
+        super.onDetachedFromWindow();
+        if (onLifecycleCallBack != null) {
+            onLifecycleCallBack.onDismiss();
+        }
+    }
+    
+    @Override
+    public boolean performClick() {
+        return super.performClick();
+    }
+    
+    public DialogXBaseRelativeLayout setOnLifecycleCallBack(OnLifecycleCallBack onLifecycleCallBack) {
+        this.onLifecycleCallBack = onLifecycleCallBack;
+        return this;
+    }
+    
+    public abstract static class OnLifecycleCallBack {
+        public void onShow() {
+        }
+        
+        ;
+        
+        public abstract void onDismiss();
+    }
+    
+    private void paddingView(int left, int top, int right, int bottom) {
+        setPadding(left, top, right, bottom);
+    }
+    
+    @Override
+    public WindowInsets onApplyWindowInsets(WindowInsets windowInsets) {
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
+            paddingView(windowInsets.getSystemWindowInsetLeft(), windowInsets.getSystemWindowInsetTop(), windowInsets.getSystemWindowInsetRight(), windowInsets.getSystemWindowInsetBottom());
+        }
+        return super.onApplyWindowInsets(windowInsets);
+    }
+    
+    public DialogXBaseRelativeLayout setOnBackPressedListener(OnBackPressedListener onBackPressedListener) {
+        this.onBackPressedListener = onBackPressedListener;
+        return this;
+    }
+}

+ 86 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/views/MaxRelativeLayout.java

@@ -0,0 +1,86 @@
+package com.kongzue.dialogx.util.views;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.View;
+import android.widget.RelativeLayout;
+
+import com.kongzue.dialogx.R;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2019/9/24 17:34
+ */
+public class MaxRelativeLayout extends RelativeLayout {
+    
+    private int maxWidth;
+    private int maxHeight;
+    
+    public MaxRelativeLayout(Context context) {
+        super(context);
+        init(context, null);
+    }
+    
+    public MaxRelativeLayout(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        init(context, attrs);
+    }
+    
+    public MaxRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init(context, attrs);
+    }
+    
+    private void init(Context context, AttributeSet attrs) {
+        if (attrs != null) {
+            TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.MaxRelativeLayout);
+            maxWidth = a.getDimensionPixelSize(R.styleable.MaxRelativeLayout_maxLayoutWidth, 0);
+            maxHeight = a.getDimensionPixelSize(R.styleable.MaxRelativeLayout_maxLayoutHeight, 0);
+            
+            a.recycle();
+        }
+    }
+    
+    public MaxRelativeLayout setMaxHeight(int maxHeight) {
+        this.maxHeight = maxHeight;
+        return this;
+    }
+    
+    public MaxRelativeLayout setMaxWidth(int maxWidth) {
+        if (maxWidth > 0 && this.maxWidth != 0) this.maxWidth = maxWidth;
+        return this;
+    }
+    
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        int heightMode = MeasureSpec.getMode(heightMeasureSpec);
+        int widthMode = MeasureSpec.getMode(widthMeasureSpec);
+        
+        int heightSize = MeasureSpec.getSize(heightMeasureSpec);
+        int widthSize = MeasureSpec.getSize(widthMeasureSpec);
+        
+        if (maxHeight > 0) {
+            heightSize = Math.min(heightSize, maxHeight);
+        }
+        if (maxWidth > 0) {
+            widthSize = Math.min(widthSize, maxWidth);
+        }
+        
+        View blurView = findViewWithTag("blurView");
+        if (blurView != null) {
+            LayoutParams lp = (LayoutParams) blurView.getLayoutParams();
+            lp.width = getMeasuredWidth();
+            lp.height = getMeasuredHeight();
+            blurView.setLayoutParams(lp);
+        }
+        
+        int maxHeightMeasureSpec = MeasureSpec.makeMeasureSpec(heightSize, heightMode);
+        int maxWidthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSize, widthMode);
+        super.onMeasure(maxWidthMeasureSpec, maxHeightMeasureSpec);
+    }
+}

+ 17 - 0
DialogX/src/main/res/anim/anim_dialogx_default_enter.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <scale
+        android:duration="300"
+        android:fromXScale="0.9"
+        android:fromYScale="0.9"
+        android:pivotX="50%"
+        android:pivotY="60%"
+        android:toXScale="1.0"
+        android:toYScale="1.0" />
+
+    <alpha
+        android:duration="300"
+        android:fromAlpha="1.0"
+        android:toAlpha="1.0" />
+</set>

+ 9 - 0
DialogX/src/main/res/anim/anim_dialogx_default_exit.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <alpha
+        android:duration="300"
+        android:fromAlpha="1.0"
+        android:toAlpha="1.0" />
+
+</set>

+ 7 - 0
DialogX/src/main/res/drawable/button_dialogx_material_light.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:color="@color/black10">
+
+    <item android:drawable="@drawable/rect_dialogx_material_button_light_forword"/>
+</ripple>

+ 7 - 0
DialogX/src/main/res/drawable/button_dialogx_material_night.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:color="@color/white10">
+
+    <item android:drawable="@drawable/rect_dialogx_material_button_night_forword"/>
+</ripple>

+ 6 - 0
DialogX/src/main/res/drawable/rect_dialogx_material_bkg_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/white"/>
+    <corners android:radius="10dp" />
+</shape>

+ 6 - 0
DialogX/src/main/res/drawable/rect_dialogx_material_bkg_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/dialogxMaterialDarkDialogBkgColor"/>
+    <corners android:radius="10dp" />
+</shape>

+ 6 - 0
DialogX/src/main/res/drawable/rect_dialogx_material_button_light_forword.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/white"/>
+    <corners android:radius="3dp" />
+</shape>

+ 6 - 0
DialogX/src/main/res/drawable/rect_dialogx_material_button_night_forword.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="@color/dialogxMaterialDarkDialogBkgColor"/>
+    <corners android:radius="3dp" />
+</shape>

+ 150 - 0
DialogX/src/main/res/layout/layout_dialogx_material.xml

@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black20"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.kongzue.dialogx.util.views.MaxRelativeLayout
+            android:id="@+id/bkg"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginHorizontal="35dp"
+            android:background="@drawable/rect_dialogx_material_bkg_light"
+            android:elevation="27dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:clickable="true"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/txt_dialog_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingVertical="15dp"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="center_vertical"
+                    android:paddingHorizontal="20dp"
+                    android:text="Title"
+                    android:textColor="@color/black"
+                    android:textSize="21dp" />
+
+                <ScrollView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/txt_dialog_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="20dp"
+                            android:text="This is content text."
+                            android:textColor="@color/black70"
+                            android:textSize="16dp" />
+
+                        <RelativeLayout
+                            android:id="@+id/box_custom"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:visibility="gone"></RelativeLayout>
+
+                        <EditText
+                            android:id="@+id/txt_input"
+                            android:theme="@style/AppTheme"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="20dp"
+                            android:layout_marginTop="10dp"
+                            android:paddingTop="10dp"
+                            android:maxLines="1"
+                            android:inputType="text"
+                            android:paddingBottom="10dp"
+                            android:scrollbars="vertical"
+                            android:text=""
+                            android:textColor="@color/black90"
+                            android:textSize="18dp" />
+
+                    </LinearLayout>
+
+                </ScrollView>
+
+                <LinearLayout
+                    android:id="@+id/box_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginTop="5dp"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingHorizontal="10dp"
+                    android:paddingVertical="10dp">
+
+                    <TextView
+                        android:id="@+id/btn_selectOther"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="Other"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp"
+                        android:visibility="gone" />
+
+                    <Space
+                        android:id="@+id/space_other_button"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1" />
+
+                    <TextView
+                        android:id="@+id/btn_selectNegative"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="Cancel"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="OK"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+    </RelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 150 - 0
DialogX/src/main/res/layout/layout_dialogx_material_dark.xml

@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black40"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.kongzue.dialogx.util.views.MaxRelativeLayout
+            android:id="@+id/bkg"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginHorizontal="35dp"
+            android:background="@drawable/rect_dialogx_material_bkg_night"
+            android:elevation="27dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:clickable="true"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/txt_dialog_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="center_vertical"
+                    android:paddingHorizontal="20dp"
+                    android:paddingVertical="15dp"
+                    android:text="Title"
+                    android:textColor="@color/white"
+                    android:textSize="21dp" />
+
+                <ScrollView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/txt_dialog_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="20dp"
+                            android:text="This is content text."
+                            android:textColor="@color/white60"
+                            android:textSize="16dp" />
+
+                        <RelativeLayout
+                            android:id="@+id/box_custom"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:visibility="gone"></RelativeLayout>
+
+                        <EditText
+                            android:id="@+id/txt_input"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="20dp"
+                            android:layout_marginTop="10dp"
+                            android:inputType="text"
+                            android:maxLines="1"
+                            android:paddingTop="10dp"
+                            android:paddingBottom="10dp"
+                            android:scrollbars="vertical"
+                            android:text=""
+                            android:textColor="@color/white"
+                            android:textSize="18dp"
+                            android:theme="@style/AppThemeDark" />
+
+                    </LinearLayout>
+
+                </ScrollView>
+
+                <LinearLayout
+                    android:id="@+id/box_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginTop="5dp"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingHorizontal="10dp"
+                    android:paddingVertical="10dp">
+
+                    <TextView
+                        android:id="@+id/btn_selectOther"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="Other"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp"
+                        android:visibility="gone" />
+
+                    <Space
+                        android:id="@+id/space_other_button"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1" />
+
+                    <TextView
+                        android:id="@+id/btn_selectNegative"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="Cancel"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="wrap_content"
+                        android:layout_height="36dp"
+                        android:background="@drawable/button_dialogx_material_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:paddingHorizontal="15dp"
+                        android:text="OK"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+    </RelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 16 - 0
DialogX/src/main/res/values/attrs.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <declare-styleable name="MaxRelativeLayout">
+        <attr name="maxLayoutWidth" format="dimension"/>
+        <attr name="maxLayoutHeight" format="dimension"/>
+    </declare-styleable>
+
+    <declare-styleable name="RealtimeBlurView">
+        <attr name="realtimeBlurRadius" format="dimension"/>
+        <attr name="realtimeDownsampleFactor" format="float"/>
+        <attr name="realtimeOverlayColor" format="color"/>
+        <attr name="xRadius" format="dimension"/>
+        <attr name="yRadius" format="dimension"/>
+    </declare-styleable>
+</resources>

+ 47 - 0
DialogX/src/main/res/values/colors.xml

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorAccent">#2196F3</color>
+
+    <color name="dark">#353535</color>
+    <color name="black">#000</color>
+    <color name="black90">#E6000000</color>
+    <color name="black80">#CC000000</color>
+    <color name="black75">#BF000000</color>
+    <color name="black70">#B3000000</color>
+    <color name="black60">#99000000</color>
+    <color name="black50">#80000000</color>
+    <color name="black40">#66000000</color>
+    <color name="black30">#4D000000</color>
+    <color name="black25">#40000000</color>
+    <color name="black20">#33000000</color>
+    <color name="black10">#1A000000</color>
+    <color name="empty">#00000000</color>
+
+    <color name="white">#fff</color>
+    <color name="white90">#E6ffffff</color>
+    <color name="white80">#CCffffff</color>
+    <color name="white75">#BFffffff</color>
+    <color name="white70">#B3ffffff</color>
+    <color name="white60">#99ffffff</color>
+    <color name="white50">#80ffffff</color>
+    <color name="white40">#66ffffff</color>
+    <color name="white30">#4Dffffff</color>
+    <color name="white25">#40ffffff</color>
+    <color name="white20">#33ffffff</color>
+    <color name="white10">#1Affffff</color>
+
+    <color name="dialogxMaterialDarkDialogBkgColor">#343434</color>
+    <color name="dialogxColorBlue">#2196F3</color>
+    <color name="dialogxKongzueLightOkButtonBkgColor">#E1E9F1</color>
+    <color name="dialogxKongzueLightOkButtonBkgColorPress">#CEDAE6</color>
+    <color name="dialogxKongzueLightOtherButtonBkgColor">#F4F5F6</color>
+    <color name="dialogxKongzueLightOtherButtonBkgColorPress">#E6E8EA</color>
+    <color name="dialogxKongzueDarkBkgColor">#181818</color>
+    <color name="dialogxKongzueDarkButtonBkgColor">#272727</color>
+    <color name="dialogxKongzueDarkButtonBkgColorPress">#33363B</color>
+
+    <color name="dialogxIOSSplitLight">#2c000000</color>
+    <color name="dialogxIOSSplitDark">#4e4e50</color>
+    <color name="dialogxIOSBlue">#007aff</color>
+    <color name="dialogxButtonIOSLightPress">#0f000000</color>
+</resources>

+ 18 - 0
DialogX/src/main/res/values/styles.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorAccent</item>
+        <item name="colorPrimaryDark">@color/colorAccent</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <style name="AppThemeDark" parent="Theme.AppCompat">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorAccent</item>
+        <item name="colorPrimaryDark">@color/colorAccent</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+</resources>

BIN
DialogXDemo_backup@20200926.zip


+ 1 - 0
DialogXIOSStyle/.gitignore

@@ -0,0 +1 @@
+/build

+ 24 - 0
DialogXIOSStyle/build.gradle

@@ -0,0 +1,24 @@
+apply plugin: 'com.android.library'
+
+android {
+    compileSdkVersion 30
+
+    defaultConfig {
+        minSdkVersion 21
+        targetSdkVersion 30
+        versionCode 1
+        versionName "1.0"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+
+}

+ 0 - 0
DialogXIOSStyle/consumer-rules.pro


+ 21 - 0
DialogXIOSStyle/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 5 - 0
DialogXIOSStyle/src/main/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.kongzue.dialogx.iostheme">
+
+    /
+</manifest>

+ 66 - 0
DialogXIOSStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java

@@ -0,0 +1,66 @@
+package com.kongzue.dialogx.interfaces;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/26 13:14
+ */
+public interface DialogXStyle {
+    
+    int styleVer = 1;
+    
+    int BUTTON_OK = 1;
+    int BUTTON_CANCEL = 2;
+    int BUTTON_OTHER = 3;
+    int SPACE = 4;
+    int SPLIT = 5;
+    
+    int layout(boolean light);
+    
+    int enterAnimResId();
+    
+    int exitAnimResId();
+    
+    int[] verticalButtonOrder();
+    
+    int[] horizontalButtonOrder();
+    
+    int splitWidthPx();
+    
+    int splitColorRes(boolean light);
+    
+    BlurBackgroundSetting blurSettings();
+    
+    HorizontalButtonRes overrideHorizontalButtonRes();
+    
+    VerticalButtonRes overrideVerticalButtonRes();
+    
+    interface BlurBackgroundSetting {
+        
+        boolean blurBackground();
+        
+        int blurForwardColorRes(boolean light);
+        
+        int blurBackgroundRoundRadiusPx();
+    }
+    
+    interface HorizontalButtonRes {
+        
+        int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
+    }
+    
+    interface VerticalButtonRes {
+        
+        int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
+    }
+}

+ 130 - 0
DialogXIOSStyle/src/main/java/com/kongzue/dialogx/style/IOSStyle.java

@@ -0,0 +1,130 @@
+package com.kongzue.dialogx.style;
+
+import android.content.res.Resources;
+
+import com.kongzue.dialogx.interfaces.DialogXStyle;
+import com.kongzue.dialogx.iostheme.BuildConfig;
+import com.kongzue.dialogx.iostheme.R;
+
+import java.util.HashMap;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/26 13:09
+ */
+public class IOSStyle implements DialogXStyle {
+    
+    private IOSStyle() {
+    }
+    
+    public static IOSStyle style() {
+        return new IOSStyle();
+    }
+    
+    @Override
+    public int layout(boolean light) {
+        return light ? R.layout.layout_dialogx_ios : R.layout.layout_dialogx_ios_dark;
+    }
+    
+    @Override
+    public int enterAnimResId() {
+        return R.anim.anim_dialogx_ios_enter;
+    }
+    
+    @Override
+    public int exitAnimResId() {
+        return 0;
+    }
+    
+    @Override
+    public int[] verticalButtonOrder() {
+        return new int[]{BUTTON_OK, SPLIT, BUTTON_OTHER, SPLIT, BUTTON_CANCEL};
+    }
+    
+    @Override
+    public int[] horizontalButtonOrder() {
+        return new int[]{BUTTON_CANCEL, SPLIT, BUTTON_OTHER, SPLIT, BUTTON_OK};
+    }
+    
+    @Override
+    public int splitWidthPx() {
+        return 1;
+    }
+    
+    @Override
+    public int splitColorRes(boolean light) {
+        return light ? R.color.dialogxIOSSplitLight : R.color.dialogxIOSSplitDark;
+    }
+    
+    @Override
+    public BlurBackgroundSetting blurSettings() {
+        return new BlurBackgroundSetting() {
+            @Override
+            public boolean blurBackground() {
+                return true;
+            }
+            
+            @Override
+            public int blurForwardColorRes(boolean light) {
+                return light ? R.color.dialogxIOSBkgLight : R.color.dialogxIOSBkgDark;
+            }
+            
+            @Override
+            public int blurBackgroundRoundRadiusPx() {
+                return dip2px(15);
+            }
+        };
+    }
+    
+    private int dip2px(float dpValue) {
+        final float scale = Resources.getSystem().getDisplayMetrics().density;
+        return (int) (dpValue * scale + 0.5f);
+    }
+    
+    @Override
+    public HorizontalButtonRes overrideHorizontalButtonRes() {
+        return new HorizontalButtonRes() {
+            @Override
+            public int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                if (visibleButtonCount == 1) {
+                    return light ? R.drawable.button_dialogx_ios_bottom_light : R.drawable.button_dialogx_ios_bottom_night;
+                } else {
+                    return light ? R.drawable.button_dialogx_ios_right_light : R.drawable.button_dialogx_ios_right_night;
+                }
+            }
+            
+            @Override
+            public int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_ios_left_light : R.drawable.button_dialogx_ios_left_night;
+            }
+            
+            @Override
+            public int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_ios_center_light : R.drawable.button_dialogx_ios_center_night;
+            }
+        };
+    }
+    
+    @Override
+    public VerticalButtonRes overrideVerticalButtonRes() {
+        return new VerticalButtonRes() {
+            @Override
+            public int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_ios_center_light : R.drawable.button_dialogx_ios_center_night;
+            }
+    
+            @Override
+            public int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_ios_bottom_light : R.drawable.button_dialogx_ios_bottom_night;
+            }
+    
+            @Override
+            public int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light) {
+                return light ? R.drawable.button_dialogx_ios_center_light : R.drawable.button_dialogx_ios_center_night;
+            }
+        };
+    }
+}

+ 17 - 0
DialogXIOSStyle/src/main/res/anim/anim_dialogx_ios_enter.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<set xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <scale
+        android:duration="300"
+        android:fromXScale="1.1"
+        android:fromYScale="1.1"
+        android:pivotX="50%"
+        android:pivotY="50%"
+        android:toXScale="1.0"
+        android:toYScale="1.0" />
+
+    <alpha
+        android:duration="300"
+        android:fromAlpha="0.0"
+        android:toAlpha="1.0" />
+</set>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_bottom_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_bottom_light" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_bottom_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_bottom_night" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_center_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@color/dialogxButtonIOSLightPress" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_center_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@color/white10" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_left_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_left_light" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_left_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_left_night" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_right_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_right_light" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_right_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_right_night" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_top_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_top_light" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 6 - 0
DialogXIOSStyle/src/main/res/drawable/button_dialogx_ios_top_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/rect_dialogx_ios_top_night" />
+    <item android:state_focused="true" android:drawable="@color/empty" />
+    <item android:drawable="@color/empty"/>
+</selector>

+ 14 - 0
DialogXIOSStyle/src/main/res/drawable/editbox_dialogx_ios_dark.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <stroke
+        android:color="@color/dialogxIOSSplitDark"
+        android:width="1px"/>
+
+    <solid
+        android:color="#80000000"/>
+
+    <corners android:radius="5dp" />
+
+</shape>

+ 13 - 0
DialogXIOSStyle/src/main/res/drawable/editbox_dialogx_ios_light.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <stroke
+        android:color="#4d4d4f"
+        android:width="1px"/>
+
+    <solid
+        android:color="#fff"/>
+
+    <corners android:radius="5dp" />
+</shape>

+ 11 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_bottom_light.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/dialogxButtonIOSLightPress"/>
+
+    <corners
+        android:bottomRightRadius="15dp"
+        android:bottomLeftRadius="15dp"/>
+
+</shape>

+ 11 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_bottom_night.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/white10"/>
+
+    <corners
+        android:bottomRightRadius="15dp"
+        android:bottomLeftRadius="15dp"/>
+
+</shape>

+ 10 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_left_light.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/dialogxButtonIOSLightPress"/>
+
+    <corners
+        android:bottomLeftRadius="15dp"/>
+
+</shape>

+ 10 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_left_night.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/white10"/>
+
+    <corners
+        android:bottomLeftRadius="15dp"/>
+
+</shape>

+ 10 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_right_light.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/dialogxButtonIOSLightPress"/>
+
+    <corners
+        android:bottomRightRadius="15dp"/>
+
+</shape>

+ 10 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_right_night.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/white10"/>
+
+    <corners
+        android:bottomRightRadius="15dp"/>
+
+</shape>

+ 11 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_top_light.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/dialogxButtonIOSLightPress"/>
+
+    <corners
+        android:topRightRadius="15dp"
+        android:topLeftRadius="15dp"/>
+
+</shape>

+ 11 - 0
DialogXIOSStyle/src/main/res/drawable/rect_dialogx_ios_top_night.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <solid android:color="@color/white10"/>
+
+    <corners
+        android:topRightRadius="15dp"
+        android:topLeftRadius="15dp"/>
+
+</shape>

+ 164 - 0
DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black30"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.kongzue.dialogx.util.views.MaxRelativeLayout
+            android:id="@+id/bkg"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginHorizontal="35dp"
+            app:maxLayoutWidth="270dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:clickable="true"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/txt_dialog_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="center"
+                    android:paddingHorizontal="15dp"
+                    android:paddingTop="15dp"
+                    android:paddingBottom="2dp"
+                    android:text="Title"
+                    android:textColor="@color/black"
+                    android:textSize="17dp" />
+
+                <ScrollView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/txt_dialog_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginHorizontal="15dp"
+                            android:gravity="center"
+                            android:text="This is content text."
+                            android:textColor="@color/black"
+                            android:textSize="13dp" />
+
+                        <RelativeLayout
+                            android:id="@+id/box_custom"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:visibility="gone"></RelativeLayout>
+
+                        <EditText
+                            android:id="@+id/txt_input"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="15dp"
+                            android:layout_marginTop="10dp"
+                            android:background="@drawable/editbox_dialogx_ios_light"
+                            android:inputType="text"
+                            android:maxLines="1"
+                            android:padding="5dp"
+                            android:scrollbars="vertical"
+                            android:text=""
+                            android:textColor="@color/black90"
+                            android:textSize="14dp"
+                            android:theme="@style/AppTheme" />
+
+                    </LinearLayout>
+
+                </ScrollView>
+
+                <ImageView
+                    android:id="@+id/split_horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="1px"
+                    android:layout_marginTop="15dp"
+                    android:background="@color/dialogxIOSSplitLight" />
+
+                <LinearLayout
+                    android:id="@+id/box_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:id="@+id/btn_selectNegative"
+                        android:layout_width="match_parent"
+                        android:layout_height="45dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_ios_left_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:minWidth="65dp"
+                        android:text="Cancel"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                    <ImageView
+                        android:id="@+id/space_other_button"
+                        android:layout_width="1px"
+                        android:layout_height="match_parent"
+                        android:background="@color/dialogxIOSSplitLight"
+                        android:visibility="gone" />
+
+                    <TextView
+                        android:id="@+id/btn_selectOther"
+                        android:layout_width="match_parent"
+                        android:layout_height="45dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_ios_center_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:minWidth="65dp"
+                        android:text="Other"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp"
+                        android:visibility="gone" />
+
+                    <ImageView
+                        android:layout_width="1px"
+                        android:layout_height="match_parent"
+                        android:background="@color/dialogxIOSSplitLight" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="match_parent"
+                        android:layout_height="45dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_ios_right_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:minWidth="65dp"
+                        android:text="OK"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="15dp" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+    </RelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 164 - 0
DialogXIOSStyle/src/main/res/layout/layout_dialogx_ios_dark.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black50"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.kongzue.dialogx.util.views.MaxRelativeLayout
+            android:id="@+id/bkg"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginHorizontal="35dp"
+            app:maxLayoutWidth="270dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:clickable="true"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/txt_dialog_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="center"
+                    android:paddingHorizontal="15dp"
+                    android:paddingTop="15dp"
+                    android:paddingBottom="2dp"
+                    android:text="Title"
+                    android:textColor="@color/white"
+                    android:textSize="17dp" />
+
+                <ScrollView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/txt_dialog_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginHorizontal="15dp"
+                            android:gravity="center"
+                            android:text="This is content text."
+                            android:textColor="@color/white"
+                            android:textSize="13dp" />
+
+                        <RelativeLayout
+                            android:id="@+id/box_custom"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:visibility="gone"></RelativeLayout>
+
+                        <EditText
+                            android:id="@+id/txt_input"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="15dp"
+                            android:layout_marginTop="10dp"
+                            android:background="@drawable/editbox_dialogx_ios_dark"
+                            android:inputType="text"
+                            android:maxLines="1"
+                            android:padding="5dp"
+                            android:scrollbars="vertical"
+                            android:text=""
+                            android:textColor="@color/white"
+                            android:textSize="14dp"
+                            android:theme="@style/AppThemeDark" />
+
+                    </LinearLayout>
+
+                </ScrollView>
+
+                <ImageView
+                    android:id="@+id/split_horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="1px"
+                    android:layout_marginTop="15dp"
+                    android:background="@color/dialogxIOSSplitDark" />
+
+                <LinearLayout
+                    android:id="@+id/box_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:id="@+id/btn_selectNegative"
+                        android:layout_width="match_parent"
+                        android:layout_height="45dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_ios_left_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:minWidth="65dp"
+                        android:text="Cancel"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="16dp" />
+
+                    <ImageView
+                        android:id="@+id/space_other_button"
+                        android:layout_width="1px"
+                        android:layout_height="match_parent"
+                        android:background="@color/dialogxIOSSplitDark"
+                        android:visibility="gone" />
+
+                    <TextView
+                        android:id="@+id/btn_selectOther"
+                        android:layout_width="match_parent"
+                        android:layout_height="45dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_ios_center_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:minWidth="65dp"
+                        android:text="Other"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="16dp"
+                        android:visibility="gone" />
+
+                    <ImageView
+                        android:layout_width="1px"
+                        android:layout_height="match_parent"
+                        android:background="@color/dialogxIOSSplitDark" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="match_parent"
+                        android:layout_height="45dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_ios_right_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:minWidth="65dp"
+                        android:text="OK"
+                        android:textColor="@color/colorAccent"
+                        android:textSize="16dp" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+    </RelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 41 - 0
DialogXIOSStyle/src/main/res/values/colors.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorAccent">#2196F3</color>
+
+    <color name="dark">#353535</color>
+    <color name="black">#000</color>
+    <color name="black90">#E6000000</color>
+    <color name="black80">#CC000000</color>
+    <color name="black75">#BF000000</color>
+    <color name="black70">#B3000000</color>
+    <color name="black60">#99000000</color>
+    <color name="black50">#80000000</color>
+    <color name="black40">#66000000</color>
+    <color name="black30">#4D000000</color>
+    <color name="black25">#40000000</color>
+    <color name="black20">#33000000</color>
+    <color name="black10">#1A000000</color>
+    <color name="empty">#00000000</color>
+
+    <color name="white">#fff</color>
+    <color name="white90">#E6ffffff</color>
+    <color name="white80">#CCffffff</color>
+    <color name="white75">#BFffffff</color>
+    <color name="white70">#B3ffffff</color>
+    <color name="white60">#99ffffff</color>
+    <color name="white50">#80ffffff</color>
+    <color name="white40">#66ffffff</color>
+    <color name="white30">#4Dffffff</color>
+    <color name="white25">#40ffffff</color>
+    <color name="white20">#33ffffff</color>
+    <color name="white10">#1Affffff</color>
+
+    <color name="dialogxColorBlue">#2196F3</color>
+
+    <color name="dialogxIOSSplitLight">#2c000000</color>
+    <color name="dialogxIOSSplitDark">#4e4e50</color>
+    <color name="dialogxIOSBlue">#007aff</color>
+    <color name="dialogxButtonIOSLightPress">#0f000000</color>
+    <color name="dialogxIOSBkgLight">#D1F4F5F6</color>
+    <color name="dialogxIOSBkgDark">#DB161616</color>
+</resources>

+ 1 - 0
DialogXKongzueStyle/.gitignore

@@ -0,0 +1 @@
+/build

+ 24 - 0
DialogXKongzueStyle/build.gradle

@@ -0,0 +1,24 @@
+apply plugin: 'com.android.library'
+
+android {
+    compileSdkVersion 30
+
+    defaultConfig {
+        minSdkVersion 21
+        targetSdkVersion 30
+        versionCode 1
+        versionName "1.0"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+
+}

+ 0 - 0
DialogXKongzueStyle/consumer-rules.pro


+ 21 - 0
DialogXKongzueStyle/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 5 - 0
DialogXKongzueStyle/src/main/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.kongzue.dialogx.kongzuetheme">
+
+    /
+</manifest>

+ 66 - 0
DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/interfaces/DialogXStyle.java

@@ -0,0 +1,66 @@
+package com.kongzue.dialogx.interfaces;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/26 13:14
+ */
+public interface DialogXStyle {
+    
+    int styleVer = 1;
+    
+    int BUTTON_OK = 1;
+    int BUTTON_CANCEL = 2;
+    int BUTTON_OTHER = 3;
+    int SPACE = 4;
+    int SPLIT = 5;
+    
+    int layout(boolean light);
+    
+    int enterAnimResId();
+    
+    int exitAnimResId();
+    
+    int[] verticalButtonOrder();
+    
+    int[] horizontalButtonOrder();
+    
+    int splitWidthPx();
+    
+    int splitColorRes(boolean light);
+    
+    BlurBackgroundSetting blurSettings();
+    
+    HorizontalButtonRes overrideHorizontalButtonRes();
+    
+    VerticalButtonRes overrideVerticalButtonRes();
+    
+    interface BlurBackgroundSetting {
+        
+        boolean blurBackground();
+        
+        int blurForwardColorRes(boolean light);
+        
+        int blurBackgroundRoundRadiusPx();
+    }
+    
+    interface HorizontalButtonRes {
+        
+        int overrideHorizontalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideHorizontalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideHorizontalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
+    }
+    
+    interface VerticalButtonRes {
+        
+        int overrideVerticalOkButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideVerticalCancelButtonBackgroundRes(int visibleButtonCount, boolean light);
+        
+        int overrideVerticalOtherButtonBackgroundRes(int visibleButtonCount, boolean light);
+    }
+}

+ 71 - 0
DialogXKongzueStyle/src/main/java/com/kongzue/dialogx/style/KongzueStyle.java

@@ -0,0 +1,71 @@
+package com.kongzue.dialogx.style;
+
+import com.kongzue.dialogx.interfaces.DialogXStyle;
+import com.kongzue.dialogx.kongzuetheme.R;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/26 13:09
+ */
+public class KongzueStyle implements DialogXStyle {
+    
+    private KongzueStyle() {
+    }
+    
+    public static KongzueStyle style() {
+        return new KongzueStyle();
+    }
+    
+    @Override
+    public int layout(boolean light) {
+        return light ? R.layout.layout_dialogx_kongzue : R.layout.layout_dialogx_kongzue_dark;
+    }
+    
+    @Override
+    public int enterAnimResId() {
+        return 0;
+    }
+    
+    @Override
+    public int exitAnimResId() {
+        return 0;
+    }
+    
+    @Override
+    public int[] verticalButtonOrder() {
+        return new int[]{BUTTON_OK, BUTTON_OTHER, BUTTON_CANCEL};
+    }
+    
+    @Override
+    public int[] horizontalButtonOrder() {
+        return new int[]{BUTTON_CANCEL, BUTTON_OTHER, BUTTON_OK};
+    }
+    
+    @Override
+    public int splitWidthPx() {
+        return 0;
+    }
+    
+    @Override
+    public int splitColorRes(boolean light) {
+        return 0;
+    }
+    
+    @Override
+    public BlurBackgroundSetting blurSettings() {
+        return null;
+    }
+    
+    @Override
+    public HorizontalButtonRes overrideHorizontalButtonRes() {
+        return null;
+    }
+    
+    @Override
+    public VerticalButtonRes overrideVerticalButtonRes() {
+        return null;
+    }
+}

+ 6 - 0
DialogXKongzueStyle/src/main/res/drawable/button_dialogx_kongzue_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:exitFadeDuration="100">
+    <item android:drawable="@color/dialogxKongzueDarkButtonBkgColorPress" android:state_pressed="true" />
+    <item android:drawable="@color/dialogxKongzueDarkButtonBkgColor" android:state_focused="false" />
+</selector>

+ 6 - 0
DialogXKongzueStyle/src/main/res/drawable/button_dialogx_kongzue_ok_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:exitFadeDuration="100">
+    <item android:drawable="@color/dialogxKongzueLightOkButtonBkgColorPress" android:state_pressed="true" />
+    <item android:drawable="@color/dialogxKongzueLightOkButtonBkgColor" android:state_focused="false" />
+</selector>

+ 6 - 0
DialogXKongzueStyle/src/main/res/drawable/button_dialogx_kongzue_other_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:exitFadeDuration="100">
+    <item android:drawable="@color/dialogxKongzueLightOtherButtonBkgColorPress" android:state_pressed="true" />
+    <item android:drawable="@color/dialogxKongzueLightOtherButtonBkgColor" android:state_focused="false" />
+</selector>

+ 6 - 0
DialogXKongzueStyle/src/main/res/drawable/editbox_dialogx_kongzue_light.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:exitFadeDuration="200">
+    <item android:drawable="@drawable/rect_dialogx_kongzue_editbox_focus" android:state_focused="true" />
+    <item android:drawable="@drawable/rect_dialogx_kongzue_editbox_normal" android:state_focused="false" />
+</selector>

+ 6 - 0
DialogXKongzueStyle/src/main/res/drawable/editbox_dialogx_kongzue_night.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:exitFadeDuration="200">
+    <item android:drawable="@drawable/rect_dialogx_kongzue_editbox_focus" android:state_focused="true" />
+    <item android:drawable="@drawable/rect_dialogx_kongzue_editbox_normal_dark" android:state_focused="false" />
+</selector>

+ 10 - 0
DialogXKongzueStyle/src/main/res/drawable/rect_dialogx_kongzue_editbox_focus.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <corners android:radius="2dp" />
+
+    <stroke
+        android:width="1dp"
+        android:color="@color/dialogxColorBlue" />
+</shape>

+ 10 - 0
DialogXKongzueStyle/src/main/res/drawable/rect_dialogx_kongzue_editbox_normal.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <corners android:radius="2dp" />
+
+    <stroke
+        android:width="1dp"
+        android:color="@color/black30" />
+</shape>

+ 10 - 0
DialogXKongzueStyle/src/main/res/drawable/rect_dialogx_kongzue_editbox_normal_dark.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+
+    <corners android:radius="2dp" />
+
+    <stroke
+        android:width="1dp"
+        android:color="@color/white30" />
+</shape>

+ 148 - 0
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue.xml

@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black20"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.kongzue.dialogx.util.views.MaxRelativeLayout
+            android:id="@+id/bkg"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginHorizontal="35dp"
+            android:background="@color/white"
+            android:elevation="40dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:clickable="true"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/txt_dialog_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingTop="15dp"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="center"
+                    android:paddingHorizontal="20dp"
+                    android:text="Title"
+                    android:textColor="@color/black"
+                    android:textSize="20dp" />
+
+                <ScrollView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/txt_dialog_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:gravity="center"
+                            android:paddingTop="5dp"
+                            android:paddingBottom="10dp"
+                            android:layout_marginHorizontal="20dp"
+                            android:text="This is content text."
+                            android:textColor="@color/black70"
+                            android:textSize="14dp" />
+
+                        <RelativeLayout
+                            android:id="@+id/box_custom"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:visibility="gone"></RelativeLayout>
+
+                        <EditText
+                            android:id="@+id/txt_input"
+                            android:theme="@style/AppTheme"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="20dp"
+                            android:visibility="gone"
+                            android:layout_marginTop="10dp"
+                            android:layout_marginBottom="15dp"
+                            android:paddingTop="10dp"
+                            android:maxLines="1"
+                            android:paddingHorizontal="10dp"
+                            android:paddingVertical="10dp"
+                            android:inputType="text"
+                            android:paddingBottom="10dp"
+                            android:background="@drawable/editbox_dialogx_kongzue_light"
+                            android:scrollbars="vertical"
+                            android:text=""
+                            android:textColor="@color/black90"
+                            android:textSize="14dp" />
+
+                    </LinearLayout>
+
+                </ScrollView>
+
+                <LinearLayout
+                    android:id="@+id/box_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:id="@+id/btn_selectNegative"
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_kongzue_other_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:text="Cancel"
+                        android:textColor="@color/black80"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/btn_selectOther"
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_kongzue_other_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:visibility="gone"
+                        android:text="Other"
+                        android:textColor="@color/black80"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_kongzue_ok_light"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:text="OK"
+                        android:textColor="@color/black80"
+                        android:textSize="14dp" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+    </RelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 150 - 0
DialogXKongzueStyle/src/main/res/layout/layout_dialogx_kongzue_dark.xml

@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="utf-8"?>
+<com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/box_root"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/black50"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.kongzue.dialogx.util.views.MaxRelativeLayout
+            android:id="@+id/bkg"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_marginHorizontal="35dp"
+            android:background="@color/dialogxKongzueDarkBkgColor"
+            android:elevation="40dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:clickable="true"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/txt_dialog_title"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="center"
+                    android:paddingHorizontal="20dp"
+                    android:paddingTop="15dp"
+                    android:text="Title"
+                    android:textColor="@color/white"
+                    android:textSize="20dp" />
+
+                <ScrollView
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1">
+
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical">
+
+                        <TextView
+                            android:id="@+id/txt_dialog_tip"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginHorizontal="20dp"
+                            android:gravity="center"
+                            android:paddingTop="5dp"
+                            android:paddingBottom="10dp"
+                            android:text="This is content text."
+                            android:textColor="@color/white80"
+                            android:textSize="14dp" />
+
+                        <RelativeLayout
+                            android:id="@+id/box_custom"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_marginTop="10dp"
+                            android:visibility="gone"></RelativeLayout>
+
+                        <EditText
+                            android:id="@+id/txt_input"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_horizontal"
+                            android:layout_marginHorizontal="20dp"
+                            android:layout_marginTop="10dp"
+                            android:layout_marginBottom="15dp"
+                            android:background="@drawable/editbox_dialogx_kongzue_night"
+                            android:inputType="text"
+                            android:maxLines="1"
+                            android:paddingHorizontal="10dp"
+                            android:paddingVertical="10dp"
+                            android:paddingTop="10dp"
+                            android:paddingBottom="10dp"
+                            android:scrollbars="vertical"
+                            android:text=""
+                            android:textColor="@color/white90"
+                            android:textSize="14dp"
+                            android:theme="@style/AppThemeDark"
+                            android:visibility="gone" />
+
+                    </LinearLayout>
+
+                </ScrollView>
+
+                <LinearLayout
+                    android:id="@+id/box_button"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:gravity="right|center_vertical"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:id="@+id/btn_selectNegative"
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_kongzue_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:text="Cancel"
+                        android:textColor="@color/white80"
+                        android:textSize="14dp" />
+
+                    <TextView
+                        android:id="@+id/btn_selectOther"
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:layout_marginLeft="1px"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_kongzue_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:text="Other"
+                        android:textColor="@color/white80"
+                        android:textSize="14dp"
+                        android:visibility="gone" />
+
+                    <TextView
+                        android:id="@+id/btn_selectPositive"
+                        android:layout_width="match_parent"
+                        android:layout_height="50dp"
+                        android:layout_marginLeft="1px"
+                        android:layout_weight="1"
+                        android:background="@drawable/button_dialogx_kongzue_night"
+                        android:clickable="true"
+                        android:gravity="center"
+                        android:text="OK"
+                        android:textColor="@color/white80"
+                        android:textSize="14dp" />
+
+                </LinearLayout>
+
+            </LinearLayout>
+
+        </com.kongzue.dialogx.util.views.MaxRelativeLayout>
+
+    </RelativeLayout>
+
+</com.kongzue.dialogx.util.views.DialogXBaseRelativeLayout>

+ 42 - 0
DialogXKongzueStyle/src/main/res/values/colors.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorAccent">#2196F3</color>
+
+    <color name="dark">#353535</color>
+    <color name="black">#000</color>
+    <color name="black90">#E6000000</color>
+    <color name="black80">#CC000000</color>
+    <color name="black75">#BF000000</color>
+    <color name="black70">#B3000000</color>
+    <color name="black60">#99000000</color>
+    <color name="black50">#80000000</color>
+    <color name="black40">#66000000</color>
+    <color name="black30">#4D000000</color>
+    <color name="black25">#40000000</color>
+    <color name="black20">#33000000</color>
+    <color name="black10">#1A000000</color>
+    <color name="empty">#00000000</color>
+
+    <color name="white">#fff</color>
+    <color name="white90">#E6ffffff</color>
+    <color name="white80">#CCffffff</color>
+    <color name="white75">#BFffffff</color>
+    <color name="white70">#B3ffffff</color>
+    <color name="white60">#99ffffff</color>
+    <color name="white50">#80ffffff</color>
+    <color name="white40">#66ffffff</color>
+    <color name="white30">#4Dffffff</color>
+    <color name="white25">#40ffffff</color>
+    <color name="white20">#33ffffff</color>
+    <color name="white10">#1Affffff</color>
+
+    <color name="dialogxColorBlue">#2196F3</color>
+    <color name="dialogxKongzueLightOkButtonBkgColor">#E1E9F1</color>
+    <color name="dialogxKongzueLightOkButtonBkgColorPress">#CEDAE6</color>
+    <color name="dialogxKongzueLightOtherButtonBkgColor">#F4F5F6</color>
+    <color name="dialogxKongzueLightOtherButtonBkgColorPress">#E6E8EA</color>
+    <color name="dialogxKongzueDarkBkgColor">#181818</color>
+    <color name="dialogxKongzueDarkButtonBkgColor">#272727</color>
+    <color name="dialogxKongzueDarkButtonBkgColorPress">#33363B</color>
+
+</resources>

+ 1 - 0
app/.gitignore

@@ -0,0 +1 @@
+/build

+ 37 - 0
app/build.gradle

@@ -0,0 +1,37 @@
+apply plugin: 'com.android.application'
+
+android {
+    compileSdkVersion 30
+
+    defaultConfig {
+        applicationId "com.kongzue.dialogxdemo"
+        minSdkVersion 21
+        targetSdkVersion 30
+        versionCode 1
+        versionName "1.0"
+
+        renderscriptTargetApi 21
+        renderscriptSupportModeEnabled true    // Enable RS support
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+repositories{
+    flatDir {
+        dirs 'libs'
+    }
+}
+dependencies {
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
+    implementation 'com.kongzue.baseframeworkx:baseframework:6.7.6'
+    implementation project(':DialogX')
+    implementation project(path: ':DialogXIOSStyle')
+    implementation project(path: ':DialogXKongzueStyle')
+}

+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

BIN
app/release/KongzueDialogXPreview20200925.apk


+ 20 - 0
app/release/output-metadata.json

@@ -0,0 +1,20 @@
+{
+  "version": 1,
+  "artifactType": {
+    "type": "APK",
+    "kind": "Directory"
+  },
+  "applicationId": "com.kongzue.dialogxdemo",
+  "variantName": "release",
+  "elements": [
+    {
+      "type": "SINGLE",
+      "filters": [],
+      "properties": [],
+      "versionCode": 1,
+      "versionName": "1.0",
+      "enabled": true,
+      "outputFile": "app-release.apk"
+    }
+  ]
+}

+ 23 - 0
app/src/main/AndroidManifest.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.kongzue.dialogxdemo">
+
+    <application
+        android:name=".App"
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/ic_launcher_round"
+        android:supportsRtl="true"
+        android:theme="@style/AppTheme">
+        <activity android:name=".MainActivity"
+            android:configChanges="orientation|keyboardHidden|screenSize">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>

+ 18 - 0
app/src/main/java/com/kongzue/dialogxdemo/App.java

@@ -0,0 +1,18 @@
+package com.kongzue.dialogxdemo;
+
+import com.kongzue.baseframework.BaseApp;
+import com.kongzue.dialogx.DialogX;
+
+/**
+ * @author: Kongzue
+ * @github: https://github.com/kongzue/
+ * @homepage: http://kongzue.com/
+ * @mail: myzcxhh@live.cn
+ * @createTime: 2020/9/21 18:01
+ */
+public class App extends BaseApp<App> {
+    @Override
+    public void init() {
+        DialogX.init(this);
+    }
+}

+ 166 - 0
app/src/main/java/com/kongzue/dialogxdemo/MainActivity.java

@@ -0,0 +1,166 @@
+package com.kongzue.dialogxdemo;
+
+import android.graphics.Color;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.kongzue.baseframework.BaseActivity;
+import com.kongzue.baseframework.interfaces.DarkNavigationBarTheme;
+import com.kongzue.baseframework.interfaces.DarkStatusBarTheme;
+import com.kongzue.baseframework.interfaces.Layout;
+import com.kongzue.baseframework.interfaces.NavigationBarBackgroundColorRes;
+import com.kongzue.baseframework.util.JumpParameter;
+import com.kongzue.dialogx.DialogX;
+import com.kongzue.dialogx.dialogs.InputDialog;
+import com.kongzue.dialogx.dialogs.MessageDialog;
+import com.kongzue.dialogx.style.IOSStyle;
+import com.kongzue.dialogx.style.KongzueStyle;
+import com.kongzue.dialogx.style.MaterialStyle;
+import com.kongzue.dialogx.util.TextInfo;
+
+@Layout(R.layout.activity_main)
+@DarkStatusBarTheme(true)
+@DarkNavigationBarTheme(true)
+@NavigationBarBackgroundColorRes(R.color.empty)
+public class MainActivity extends BaseActivity {
+    
+    private RelativeLayout boxTable;
+    private LinearLayout boxTableChild;
+    private LinearLayout btnBack;
+    private ImageView btnShare;
+    private LinearLayout boxBody;
+    private RadioGroup grpStyle;
+    private RadioButton rdoIos;
+    private RadioButton rdoMaterial;
+    private RadioButton rdoKongzue;
+    private RadioButton rdoMiui;
+    private RadioGroup grpTheme;
+    private RadioButton rdoLight;
+    private RadioButton rdoDark;
+    private TextView btnMessageDialog;
+    private TextView btnSelectDialog;
+    private TextView btnInputDialog;
+    private TextView btnWaitDialog;
+    private TextView btnTipDialog;
+    private TextView btnModalDialog;
+    private TextView btnShowBreak;
+    private TextView btnNotify;
+    private TextView btnBottomMenu;
+    private TextView btnBottomMenuWithTitle;
+    private TextView btnShareDialog;
+    private TextView btnCustomMessageDialog;
+    private TextView btnCustomInputDialog;
+    private TextView btnCustomBottomMenu;
+    private TextView btnCustomNotification;
+    private TextView btnCustomDialog;
+    private TextView btnFullScreenDialogWebPage;
+    private TextView btnFullScreenDialogLogin;
+    
+    @Override
+    public void initViews() {
+        boxTable = findViewById(R.id.box_table);
+        boxTableChild = findViewById(R.id.box_table_child);
+        btnBack = findViewById(R.id.btn_back);
+        btnShare = findViewById(R.id.btn_share);
+        boxBody = findViewById(R.id.box_body);
+        grpStyle = findViewById(R.id.grp_style);
+        rdoIos = findViewById(R.id.rdo_ios);
+        rdoMaterial = findViewById(R.id.rdo_material);
+        rdoKongzue = findViewById(R.id.rdo_kongzue);
+        rdoMiui = findViewById(R.id.rdo_miui);
+        grpTheme = findViewById(R.id.grp_theme);
+        rdoLight = findViewById(R.id.rdo_light);
+        rdoDark = findViewById(R.id.rdo_dark);
+        btnMessageDialog = findViewById(R.id.btn_messageDialog);
+        btnSelectDialog = findViewById(R.id.btn_selectDialog);
+        btnInputDialog = findViewById(R.id.btn_inputDialog);
+        btnWaitDialog = findViewById(R.id.btn_waitDialog);
+        btnTipDialog = findViewById(R.id.btn_tipDialog);
+        btnModalDialog = findViewById(R.id.btn_modalDialog);
+        btnShowBreak = findViewById(R.id.btn_showBreak);
+        btnNotify = findViewById(R.id.btn_notify);
+        btnBottomMenu = findViewById(R.id.btn_bottom_menu);
+        btnBottomMenuWithTitle = findViewById(R.id.btn_bottom_menu_withTitle);
+        btnShareDialog = findViewById(R.id.btn_shareDialog);
+        btnCustomMessageDialog = findViewById(R.id.btn_customMessageDialog);
+        btnCustomInputDialog = findViewById(R.id.btn_customInputDialog);
+        btnCustomBottomMenu = findViewById(R.id.btn_customBottomMenu);
+        btnCustomNotification = findViewById(R.id.btn_customNotification);
+        btnCustomDialog = findViewById(R.id.btn_customDialog);
+        btnFullScreenDialogWebPage = findViewById(R.id.btn_fullScreenDialog_webPage);
+        btnFullScreenDialogLogin = findViewById(R.id.btn_fullScreenDialog_login);
+    }
+    
+    @Override
+    public void initDatas(JumpParameter parameter) {
+        DialogX.globalStyle = IOSStyle.style();
+    }
+    
+    @Override
+    public void setEvents() {
+        grpTheme.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                switch (checkedId) {
+                    case R.id.rdo_light:
+                        DialogX.globalTheme = DialogX.THEME.LIGHT;
+                        break;
+                    case R.id.rdo_dark:
+                        DialogX.globalTheme = DialogX.THEME.DARK;
+                        break;
+                }
+            }
+        });
+        
+        grpStyle.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                switch (checkedId) {
+                    case R.id.rdo_material:
+                        DialogX.globalStyle = MaterialStyle.style();
+                        break;
+                    case R.id.rdo_kongzue:
+                        DialogX.globalStyle = KongzueStyle.style();
+                        break;
+                    case R.id.rdo_ios:
+                        DialogX.globalStyle = IOSStyle.style();
+                        break;
+                }
+            }
+        });
+        
+        btnMessageDialog.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                new MessageDialog("标题", "正文内容", "确定").show();
+            }
+        });
+        
+        btnSelectDialog.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                new MessageDialog("将“爱奇艺”移至App资源库还是删除该App?", "移动App会将它从主屏幕移除并保留其所有数据。", "删除App", "取消", "移至App资源库")
+                        .setButtonOrientation(LinearLayout.VERTICAL)
+                        .setOkTextInfo(new TextInfo().setFontColor(Color.parseColor("#EB5545"))).show();
+            }
+        });
+        
+        btnInputDialog.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                new InputDialog("标题", "正文内容", "确定", "取消", "正在输入的文字").setCancelable(false).show();
+            }
+        });
+    }
+    
+    @Override
+    public void onBackPressed() {
+        log("#MainActivity.onBackPressed");
+        super.onBackPressed();
+    }
+}

+ 30 - 0
app/src/main/res/drawable-v24/ic_launcher_foreground.xml

@@ -0,0 +1,30 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:aapt="http://schemas.android.com/aapt"
+    android:width="108dp"
+    android:height="108dp"
+    android:viewportWidth="108"
+    android:viewportHeight="108">
+    <path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
+        <aapt:attr name="android:fillColor">
+            <gradient
+                android:endX="85.84757"
+                android:endY="92.4963"
+                android:startX="42.9492"
+                android:startY="49.59793"
+                android:type="linear">
+                <item
+                    android:color="#44000000"
+                    android:offset="0.0" />
+                <item
+                    android:color="#00000000"
+                    android:offset="1.0" />
+            </gradient>
+        </aapt:attr>
+    </path>
+    <path
+        android:fillColor="#FFFFFF"
+        android:fillType="nonZero"
+        android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
+        android:strokeWidth="1"
+        android:strokeColor="#00000000" />
+</vector>

Some files were not shown because too many files changed in this diff