From e6e52a2d49794dbd95fa056171793762dba61ac9 Mon Sep 17 00:00:00 2001 From: zmx Date: Sun, 25 May 2025 12:24:01 +0800 Subject: [PATCH] 1.7.1 --- .gitignore | 1 + .idea/.gitignore | 3 - .idea/compiler.xml | 6 -- .idea/deploymentTargetDropDown.xml | 10 ---- .idea/deploymentTargetSelector.xml | 18 ------ .idea/gradle.xml | 20 ------- .idea/jarRepositories.xml | 35 ------------ .idea/kotlinc.xml | 6 -- .idea/migrations.xml | 10 ---- .idea/misc.xml | 57 ------------------- .idea/vcs.xml | 6 -- .../com/mx/dialog/base/MXBaseCardDialog.kt | 6 ++ .../com/mx/dialog/list/MXBaseListDialog.kt | 6 +- README.md | 2 +- build.gradle | 8 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- 16 files changed, 18 insertions(+), 178 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/deploymentTargetDropDown.xml delete mode 100644 .idea/deploymentTargetSelector.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/jarRepositories.xml delete mode 100644 .idea/kotlinc.xml delete mode 100644 .idea/migrations.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/vcs.xml diff --git a/.gitignore b/.gitignore index aa724b7..5bd175f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ .externalNativeBuild .cxx local.properties +.idea diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index b589d56..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 0c0c338..0000000 --- a/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml deleted file mode 100644 index e920fd5..0000000 --- a/.idea/deploymentTargetSelector.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 932d7db..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index 1d58712..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml deleted file mode 100644 index 0fc3113..0000000 --- a/.idea/kotlinc.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/.idea/migrations.xml b/.idea/migrations.xml deleted file mode 100644 index f8051a6..0000000 --- a/.idea/migrations.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index ebbea0f..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/LibDialog/src/main/java/com/mx/dialog/base/MXBaseCardDialog.kt b/LibDialog/src/main/java/com/mx/dialog/base/MXBaseCardDialog.kt index 181acca..b9059cf 100644 --- a/LibDialog/src/main/java/com/mx/dialog/base/MXBaseCardDialog.kt +++ b/LibDialog/src/main/java/com/mx/dialog/base/MXBaseCardDialog.kt @@ -100,6 +100,12 @@ abstract class MXBaseCardDialog(context: Context) : MXBaseDialog(context) { val lp = (cardLay.layoutParams as FrameLayout.LayoutParams?) lp?.gravity = position.gravity lp?.width = MXUtils.getScreenWidth(context) - marginLeft - marginRight + + // 平板 + if (MXUtils.getScreenWidthDP(context) > 600) { + lp?.width = MXUtils.getScreenWidth(context) / 2 + } + cardLay.layoutParams = lp cardLay.translationX = MXUtils.dp2px(context, position.translationX ?: 0).toFloat() diff --git a/LibDialog/src/main/java/com/mx/dialog/list/MXBaseListDialog.kt b/LibDialog/src/main/java/com/mx/dialog/list/MXBaseListDialog.kt index e33dc0d..77f7235 100644 --- a/LibDialog/src/main/java/com/mx/dialog/list/MXBaseListDialog.kt +++ b/LibDialog/src/main/java/com/mx/dialog/list/MXBaseListDialog.kt @@ -122,7 +122,11 @@ open class MXBaseListDialog(context: Context) : MXBaseDialog(context) { mxRootLay?.setPadding(marginLeft, marginTop, marginRight, marginBottom) - val screenWidth = MXUtils.getScreenWidth(context) - marginLeft - marginRight + var screenWidth = MXUtils.getScreenWidth(context) - marginLeft - marginRight + // 平板 + if (MXUtils.getScreenWidthDP(context) > 600) { + screenWidth = MXUtils.getScreenWidth(context) / 2 + } mxCardLay?.layoutParams?.width = screenWidth btnLay?.layoutParams?.width = screenWidth } diff --git a/README.md b/README.md index 4a8cd28..e26bd61 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ```groovy dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2' - implementation 'com.github.zmx1990:MXDialog:1.7.0' + implementation 'com.github.zmx1990:MXDialog:1.7.1' } ``` diff --git a/build.gradle b/build.gradle index 0b339e1..64eec87 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ plugins { - id 'com.android.application' version '8.5.1' apply false - id 'com.android.library' version '8.5.1' apply false - id 'org.jetbrains.kotlin.android' version '1.8.10' apply false + id 'com.android.application' version '8.10.0' apply false + id 'com.android.library' version '8.10.0' apply false + id 'org.jetbrains.kotlin.android' version '2.1.0' apply false } tasks.register('clean', Delete) { @@ -15,5 +15,5 @@ ext { minSdkVersion = 19 versionCode = 1 - versionName = "1.7.0" + versionName = "1.7.1" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4f6979d..2a8f692 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip -- Gitee