Skip to content

Commit

Permalink
fix line color bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangHaiYang01 committed Jun 11, 2020
1 parent 4ecb698 commit ba70e3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/com/allens/dialog/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.allens.dialog

import android.graphics.Color
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
Expand Down Expand Up @@ -61,6 +62,7 @@ class MainActivity : AppCompatActivity() {
// .setCancelTvColor(Color.RED)//设置cancel 颜色
// .setCancelTvMsg("取消") //设置cancel 文案
// .setCancelTvSize(16f)//设置cancel 字体大小
.setLineColor(Color.BLACK)
.addSheetItem("照片", object : OnSheetItemClickListener() {
override fun onSheetItemClick() {
Toast.makeText(this@MainActivity, "照片", Toast.LENGTH_SHORT).show()
Expand Down
2 changes: 1 addition & 1 deletion lib_dialog/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ext {
//包名
PUBLISH_ARTIFACT_ID = 'dialog'
//版本
PUBLISH_VERSION = '1.0.0'
PUBLISH_VERSION = '0.0.3'


}
Expand Down
3 changes: 2 additions & 1 deletion lib_dialog/src/main/kotlin/dialog/SheetDialog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dialog
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Build
import android.view.Gravity
import android.view.View
Expand Down Expand Up @@ -330,7 +331,7 @@ class SheetDialog(private val context: Context) : BottomDialog(context = context
return
}
val line = View(context)
line.setBackgroundColor(context.resources.getColor(lineColor))
line.background = ColorDrawable(lineColor)
line.layoutParams =
LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
Expand Down

0 comments on commit ba70e3a

Please sign in to comment.