Skip to content

Commit

Permalink
Merge pull request #1 from avito-tech/master
Browse files Browse the repository at this point in the history
Avito krop pull changes
  • Loading branch information
Kutashov authored Jan 20, 2021
2 parents 97ca4d3 + 256e894 commit 8831785
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies {

implementation "com.google.android.material:material:$androidXVersion"

implementation 'me.priyesh:chroma:1.0.2'
implementation 'me.jfenn.ColorPickerDialog:base:0.2.1'
implementation 'com.squareup.picasso:picasso:2.5.2'

implementation project(path: ':krop')
Expand Down
16 changes: 4 additions & 12 deletions app/src/main/java/com/avito/android/krop/demo/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import android.view.ViewTreeObserver
import android.widget.*
import com.avito.android.krop.KropView
import com.squareup.picasso.Picasso
import me.priyesh.chroma.ChromaDialog
import me.priyesh.chroma.ColorMode
import me.priyesh.chroma.ColorSelectListener
import me.jfenn.colorpickerdialog.dialogs.ColorPickerDialog
import java.io.InputStream


Expand Down Expand Up @@ -68,15 +66,9 @@ class MainActivity : AppCompatActivity() {
kropView = findViewById(R.id.krop_view)

pickColorButton.setOnClickListener {
ChromaDialog.Builder()
.initialColor(Color.parseColor(inputOverlayColor.text.toString()))
.colorMode(ColorMode.ARGB)
.onColorSelected(listener = object : ColorSelectListener {
override fun onColorSelected(color: Int) {
setInputOverlayColor(color)
}
})
.create()
ColorPickerDialog()
.withColor(Color.parseColor(inputOverlayColor.text.toString()))
.withListener { _, color -> setInputOverlayColor(color) }
.show(supportFragmentManager, getString(R.string.select_color))
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ allprojects {
repositories {
google()
jcenter()
google()
maven { url 'https://jitpack.io' }
}
}

Expand Down

0 comments on commit 8831785

Please sign in to comment.