diff options
author | Marvin Borner | 2018-09-08 12:11:39 +0200 |
---|---|---|
committer | Marvin Borner | 2018-09-08 12:11:39 +0200 |
commit | 1f100b2221ab66087e3f5932cef4b73ec912f0dd (patch) | |
tree | eb9678f16cf4fc3a907ca51f93f09a31a73031cc /app/src/main/java/me/texx/Texx/EmojiSelectorFragment.kt | |
parent | c6647c0a6b136de1d369f9e629d47c36e20c4ea7 (diff) |
Began emoji selector fragment :sparkles: :construction:
Diffstat (limited to 'app/src/main/java/me/texx/Texx/EmojiSelectorFragment.kt')
-rw-r--r-- | app/src/main/java/me/texx/Texx/EmojiSelectorFragment.kt | 43 |
1 files changed, 43 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 {} + } +} |