diff --git a/.gitignore b/.gitignore index aa724b77071afcbd9bb398053e05adaf7ac9405a..5bd175f459a1d5c0ca5b824c2f9bab96ad43d9b0 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 26d33521af10bcc7fd8cea344038eaaeb78d0ef5..0000000000000000000000000000000000000000 --- 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 b589d56e9f285d8cfdc6c270853a5d439021a278..0000000000000000000000000000000000000000 --- 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 0c0c3383890637b4721df1f49d0b229e55c0f361..0000000000000000000000000000000000000000 --- 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 e920fd58e001dd8de0bbcdeb06d3f56d71dea3b3..0000000000000000000000000000000000000000 --- 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 932d7db821e5f98fe82e766ace58871c0ca68c72..0000000000000000000000000000000000000000 --- 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 1d58712079f015992d4e962bc5e5a3522b3e5c00..0000000000000000000000000000000000000000 --- 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 0fc3113136756acc4597486432227a66d5ebe736..0000000000000000000000000000000000000000 --- 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 f8051a6f973e69a86e6f07f1a1c87f17a31c7235..0000000000000000000000000000000000000000 --- 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 ebbea0f5e57c5219447d9294de0e3fe94dce8d8d..0000000000000000000000000000000000000000 --- 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 94a25f7f4cb416c083d265558da75d457237d671..0000000000000000000000000000000000000000 --- 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 181acca2c1973dcec7a68eb09b316805c00b8cdf..b9059cfcf8498e20f7ede957dd55666acd89d9d1 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 e33dc0dc56a86961998230b4be6658fd86aac539..77f7235e030587e15b37f2c2f88cb9702dcaf87d 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 4a8cd283f4e2171322645f3d15a4d0a285f18ad9..e26bd618b72db1fc0ca50e85071b4d5b7d70a8c9 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 0b339e13d286519a3f91e423350b830569b5b4d0..64eec877248218757bf7849ef61fdba9ba677b5f 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 4f6979d67ca72c1e2efdcf596d138f0ae8f04855..2a8f6923f66b5f0689888a9dfc715d56761d2d94 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