Skip to content

Commit

Permalink
update version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shaoshuai904 committed Jun 19, 2024
1 parent 22f1c4e commit 540f5c8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 55 deletions.
58 changes: 13 additions & 45 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,64 +1,32 @@
# Built application files
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
# Log/OS Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
output.json

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches
.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json

# Freeline
freeline.py
freeline/
freeline_project_description.json

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
# Android Profiling
*.hprof
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies {
// for Support
implementation 'com.github.shaoshuai904:XStyleDialog:1.5.1'
// for androidx
implementation 'com.github.shaoshuai904:XStyleDialog:2.0.5'
implementation 'com.github.shaoshuai904:XStyleDialog:2.1.0'
}
```

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ android.enableJetifier=true
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
VERSION_CODE=49
VERSION_NAME=2.0.5
VERSION_CODE=50
VERSION_NAME=2.1.0
8 changes: 6 additions & 2 deletions msdialog/src/main/java/com/maple/msdialog/AlertBaseDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ open class AlertBaseDialog(
return this
}

/**
* 设置自定义内容View
* 底部是默认的 取消、确认 按钮
*/
fun setDialogContext(view: View, index: Int = -1): AlertBaseDialog {
getContentView().addView(view, index)
return this
Expand Down Expand Up @@ -140,11 +144,11 @@ open class AlertBaseDialog(
setScaleWidth(getRootView(), config.scaleWidth)
getRootView().background = config.dialogBg
// 底部按钮
setBottomViewHeight(config.bottomViewHeight)
with(getLineView()) {
background = config.dividerColor
layoutParams = layoutParams.apply { height = config.dividerWidth }
}
setBottomViewHeight(config.bottomViewHeight)
// zero button
if (!showRightBtn && !showLeftBtn) {
getLineView().visibility = View.GONE
Expand Down Expand Up @@ -193,10 +197,10 @@ open class AlertBaseDialog(
) : Serializable {
var scaleWidth: Double = 0.75 // 宽度占屏幕宽百分比
var defNullText: CharSequence = "null" // 默认空文本
var dialogBg: Drawable? = ContextCompat.getDrawable(context, R.drawable.ms_shape_alert_dialog_bg) // 整个Dialog的背景

// button
var bottomViewHeight: Int = 48f.dp2px(context) // 底部按钮高度
var dialogBg: Drawable? = ContextCompat.getDrawable(context, R.drawable.ms_shape_alert_dialog_bg) // 整个Dialog的背景
var singleBtnBg: Drawable? = ContextCompat.getDrawable(context, R.drawable.ms_sel_alert_dialog_single) // 单按钮背景

// left button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ class AlertEditDialog(

override fun setLayout() {
super.setLayout()
setDialogContext(binding.root)
// title & msg
setDialogContext(binding.root)
getTitleView().visibility = if (showTitle) View.VISIBLE else View.GONE
getMessageView().visibility = if (showMsg) View.VISIBLE else View.GONE
if (!showTitle && !showMsg) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AlertNumberPickerDialog(
isBold: Boolean = false
): AlertNumberPickerDialog {
showTitle = true
binding.tvTitle.apply {
getTitleView().apply {
text = title ?: config.defNullText
setTextColor(color)
textSize = spSize
Expand Down Expand Up @@ -94,14 +94,13 @@ class AlertNumberPickerDialog(

override fun setLayout() {
super.setLayout()
// title & msg
setDialogContext(binding.root)
getTitleView().visibility = if (showTitle) View.VISIBLE else View.GONE
if (!showTitle && !showMsg) {
getTitleView().text = config.defNullText
getTitleView().visibility = View.VISIBLE
}
if (showTitle) {
getTitleView().visibility = View.VISIBLE
}
}

/**
Expand Down

0 comments on commit 540f5c8

Please sign in to comment.