aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/src/main/java/me
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/me')
-rw-r--r--app/src/main/java/me/texx/Texx/EmojiSelectorFragment.kt43
-rw-r--r--app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt11
2 files changed, 54 insertions, 0 deletions
diff --git a/app/src/main/java/me/texx/Texx/EmojiSelectorFragment.kt b/app/src/main/java/me/texx/Texx/EmojiSelectorFragment.kt
new file mode 100644
index 0000000..1cb13d9
--- /dev/null
+++ b/app/src/main/java/me/texx/Texx/EmojiSelectorFragment.kt
@@ -0,0 +1,43 @@
+package me.texx.Texx
+
+import android.content.Context
+import android.os.Bundle
+import android.support.v4.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+
+class EmojiSelectorFragment : Fragment() {
+ private var listener: OnFragmentInteractionListener? = null
+
+ override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
+ return inflater.inflate(R.layout.fragment_emoji_selector, container, false)
+ }
+
+ fun onButtonPressed(test: String) {
+ listener?.onEmojiSelection(test)
+ }
+
+ override fun onAttach(context: Context) {
+ super.onAttach(context)
+ if (context is OnFragmentInteractionListener) {
+ listener = context
+ } else {
+ throw RuntimeException(context.toString() + " must implement OnFragmentInteractionListener")
+ }
+ }
+
+ override fun onDetach() {
+ super.onDetach()
+ listener = null
+ }
+
+ interface OnFragmentInteractionListener {
+ fun onEmojiSelection(test: String)
+ }
+
+ companion object {
+ fun newInstance() =
+ EmojiSelectorFragment().apply {}
+ }
+}
diff --git a/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt b/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt
index 1dd39c9..7aa9b07 100644
--- a/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt
+++ b/app/src/main/java/me/texx/Texx/PhotoEditorActivity.kt
@@ -70,6 +70,9 @@ class PhotoEditorActivity : AppCompatActivity() {
// draw button
button_draw.setOnClickListener { toggleDrawing() }
+ // emoji button
+ button_emoji.setOnClickListener { toggleEmojiMenu() }
+
// type button
button_type.setOnClickListener { toggleTextEditing("") }
@@ -93,6 +96,14 @@ class PhotoEditorActivity : AppCompatActivity() {
})
}
+ private fun toggleEmojiMenu() {
+
+ }
+
+ fun onEmojiSelection() {
+
+ }
+
private fun toggleDrawing() {
currentlyDrawing = !currentlyDrawing
photoEditor.setBrushDrawingMode(currentlyDrawing)