diff --git a/app/src/main/java/com/gappein/sample/MainActivity.kt b/app/src/main/java/com/gappein/sample/MainActivity.kt index 2047cec..d615297 100644 --- a/app/src/main/java/com/gappein/sample/MainActivity.kt +++ b/app/src/main/java/com/gappein/sample/MainActivity.kt @@ -4,15 +4,14 @@ import android.os.Bundle import android.text.Editable import android.text.TextWatcher import androidx.appcompat.app.AppCompatActivity -import com.gappein.Sticker import com.gappein.ui.StickerView +import com.gappein.util.generateSticker import kotlinx.android.synthetic.main.activity_main.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) - val stickerView = StickerView(this) editTextInput.addTextChangedListener(object : TextWatcher { @@ -27,14 +26,13 @@ class MainActivity : AppCompatActivity() { override fun afterTextChanged(s: Editable?) { if (s.toString().length < 20) { +// stickerView.updateText(s.toString()) background.setImageBitmap( - Sticker.with(this@MainActivity, s.toString()) + stickerView.generateSticker(s.toString()) ) } } - - }) + } + ) } - - } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 0b30d03..4fab6a7 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -7,16 +7,25 @@ tools:context=".MainActivity"> + +