Skip to content

Commit b01f20c

Browse files
committed
v1.0.1
- Minor adjustments to settings corner radius - Clean up
1 parent 66e78d4 commit b01f20c

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A color picker bottom sheet
44
[ ![Download](https://api.bintray.com/packages/sasikanthmiriyampalli/maven/color-sheet/images/download.svg?version=1.0.0) ](https://bintray.com/sasikanthmiriyampalli/maven/color-sheet/1.0.0/link)
55

66
```
7-
implementation "dev.sasikanth:colorsheet:1.0.0"
7+
implementation "dev.sasikanth:colorsheet:1.0.1"
88
```
99

1010
## Usage
@@ -59,7 +59,7 @@ ColorSheet().colorPicker(
5959
**Corner radius**
6060
Default corner radius is 4dp. You can set your own corner radius like this
6161
```
62-
ColorSheet().cornerRadius(8)
62+
ColorSheet().cornerRadius(radius)
6363
```
6464

6565
**Color to Hex string**

bintrayconfig.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = versions.libraryVersion
44

55
if (project.hasProperty("android")) { // Android libraries
66
task sourcesJar(type: Jar) {
7-
classifier = 'sources'
7+
archiveClassifier.set('sources')
88
from android.sourceSets.main.java.srcDirs
99
}
1010

@@ -14,13 +14,13 @@ if (project.hasProperty("android")) { // Android libraries
1414
}
1515
} else { // Java libraries
1616
task sourcesJar(type: Jar, dependsOn: classes) {
17-
classifier = 'sources'
17+
archiveClassifier.set('sources')
1818
from sourceSets.main.allSource
1919
}
2020
}
2121

2222
task javadocJar(type: Jar, dependsOn: javadoc) {
23-
classifier = 'javadoc'
23+
archiveClassifier.set('sources')
2424
from javadoc.destinationDir
2525
}
2626

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
buildscript {
2323
ext.kotlin_version = '1.3.21'
2424
ext.versions = [
25-
"libraryVersion": "1.0.0"
25+
"libraryVersion": "1.0.1"
2626
]
2727

2828
repositories {
@@ -31,7 +31,7 @@ buildscript {
3131

3232
}
3333
dependencies {
34-
classpath 'com.android.tools.build:gradle:3.4.0-rc03'
34+
classpath 'com.android.tools.build:gradle:3.4.0'
3535
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
3636
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
3737
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

colorsheet/src/main/java/dev/sasikanth/colorsheet/ColorSheet.kt

+11-6
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,21 @@
2020
package dev.sasikanth.colorsheet
2121

2222
import android.graphics.drawable.GradientDrawable
23-
import android.os.Build
2423
import android.os.Bundle
2524
import android.view.LayoutInflater
2625
import android.view.View
2726
import android.view.ViewGroup
2827
import android.view.ViewTreeObserver
2928
import android.widget.FrameLayout
3029
import androidx.annotation.ColorInt
31-
import androidx.annotation.StyleRes
3230
import androidx.fragment.app.FragmentManager
3331
import com.google.android.material.bottomsheet.BottomSheetBehavior
3432
import com.google.android.material.bottomsheet.BottomSheetDialog
3533
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
3634
import dev.sasikanth.colorsheet.utils.Theme
37-
import dev.sasikanth.colorsheet.utils.px
3835
import dev.sasikanth.colorsheet.utils.resolveColor
3936
import kotlinx.android.synthetic.main.color_sheet.colorSheetClose
4037
import kotlinx.android.synthetic.main.color_sheet.colorSheetList
41-
import kotlinx.android.synthetic.main.color_sheet.sheetTitle
4238
import com.google.android.material.R as materialR
4339

4440
/**
@@ -133,11 +129,20 @@ class ColorSheet : BottomSheetDialogFragment() {
133129
*
134130
* @param radius: Takes a float value
135131
*/
136-
fun cornerRadius(radius: Int): ColorSheet {
137-
this.sheetCorners = radius.toFloat().px
132+
fun cornerRadius(radius: Float): ColorSheet {
133+
this.sheetCorners = radius
138134
return this
139135
}
140136

137+
/**
138+
* Set corner radius of sheet top left and right corners.
139+
*
140+
* @param radius: Takes a float value
141+
*/
142+
fun cornerRadius(radius: Int): ColorSheet {
143+
return cornerRadius(radius.toFloat())
144+
}
145+
141146
/**
142147
* Config color picker
143148
*

colorsheet/src/main/java/dev/sasikanth/colorsheet/utils/DisplayExt.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ package dev.sasikanth.colorsheet.utils
2121

2222
import android.content.res.Resources
2323

24-
internal val Float.px: Float
24+
internal val Float.dp: Float
2525
get() = (this * Resources.getSystem().displayMetrics.density)

colorsheet/src/main/java/dev/sasikanth/colorsheet/widgets/BaselineGridTextView.kt

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package dev.sasikanth.colorsheet.widgets
1919

2020
import android.content.Context
21-
import android.graphics.Color
2221
import android.util.AttributeSet
2322
import android.util.TypedValue
2423
import androidx.annotation.RestrictTo
@@ -131,5 +130,4 @@ open class BaselineGridTextView @JvmOverloads constructor(
131130
this.lineHeightHint = lineHeightHint
132131
computeLineHeight()
133132
}
134-
135133
}

0 commit comments

Comments
 (0)