Skip to content

dora4/dview-mark-view

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dview-mark-view

Release

Gradle依赖配置

// 添加以下代码到项目根目录下的build.gradle
allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}
// 添加以下代码到app模块的build.gradle
dependencies {
    implementation 'com.github.dora4:dview-mark-view:1.2'
}

使用方式

// 添加文字 mark
binding.doraMarkView.addTextMark("热门", bgColor = 0xFFE53935.toInt(), gravity = Gravity.TOP or Gravity.CENTER_HORIZONTAL)
binding.doraMarkView.addTextMark("限时", bgColor = 0xFFF57C00.toInt(), gravity = Gravity.BOTTOM or Gravity.END)

// 添加 Drawable mark
binding.doraMarkView.addDrawableMark(ContextCompat.getDrawable(this, R.drawable.ic_fire))

// 添加 View mark
val hotLabel = LayoutInflater.from(this).inflate(R.layout.view_hot_label, null)
binding.doraMarkView.setMarkView(hotLabel)

About

给布局添加侧边标签的控件

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages