Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ enum class KeyboardFeatureType(val id: String, val title: String) {
TEMPLATE_TEXT_LOVE("menu_template_text_love","Love Emoji"),
TEMPLATE_TEXT_GREETING("menu_template_text_greeting", "Greeting"),
CHANGE_KEYBOARD("menu_change_keyboard","Change Keyboard"),
SETTING("menu_setting","Setting")
SETTING("menu_setting","Setting"),
DUMMY("menu_dummy", "Dummy")
}
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ class KeyboardIME : BaseKeyboardIME<KeyboardImeBinding>() {
})
}

KeyboardFeatureType.DUMMY -> {
hideMainKeyboard()
keyboardDummy.visible()
}

}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class KeyboardUtil {
KeyboardFeatureType.SETTING,
R.drawable.ic_menu_setting,
pref.loadPrefBoolean(KeyboardFeatureType.SETTING.id, true)
),
KeyboardFeature(
KeyboardFeatureType.DUMMY.id,
KeyboardFeatureType.DUMMY,
com.frogobox.sdk.R.drawable.ic_frogo_cracked,
pref.loadPrefBoolean(KeyboardFeatureType.DUMMY.id, true)
)
).sortedBy { it.state }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.frogobox.appkeyboard.ui.keyboard.dummy

import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import com.frogobox.appkeyboard.databinding.KeyboardDummyBinding
import com.frogobox.libkeyboard.common.core.BaseKeyboard

class DummyKeyboard(
context: Context,
attrs: AttributeSet?,
) : BaseKeyboard<KeyboardDummyBinding>(context, attrs) {

override fun setupViewBinding(): KeyboardDummyBinding {
return KeyboardDummyBinding.inflate(LayoutInflater.from(context), this, true)
}

override fun onCreate() {
initView()
}

private fun initView() {
binding?.apply {

}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import android.util.Log
import android.view.LayoutInflater
import android.view.inputmethod.EditorInfo
import com.frogobox.appkeyboard.databinding.KeyboardFormBinding
import com.frogobox.appkeyboard.ui.keyboard.movie.MovieKeyboard
import com.frogobox.appkeyboard.util.KeyboardNavigationHelper
import com.frogobox.libkeyboard.common.core.BaseKeyboard

/**
Expand All @@ -23,6 +25,8 @@ class FormKeyboard(
attrs: AttributeSet?,
) : BaseKeyboard<KeyboardFormBinding>(context, attrs) {

private val destinationKeyboard = MovieKeyboard(context, attrs)

override fun setupViewBinding(): KeyboardFormBinding {
return KeyboardFormBinding.inflate(LayoutInflater.from(context), this, true)
}
Expand All @@ -34,6 +38,10 @@ class FormKeyboard(
private fun initView() {
binding?.apply {
Log.d("FormKeyboard", "initView: ${etText.onCreateInputConnection(EditorInfo())}")

btnSubmit.setOnClickListener {
KeyboardNavigationHelper.navigateTo(this@FormKeyboard, destinationKeyboard)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,25 @@ class TemplateTextKeyboard(
private fun setupTitleContent(templateTextType: KeyboardFeatureType) {
binding?.apply {
tvToolbarTitle.text = when (templateTextType) {
NEWS -> ""
MOVIE -> ""
WEB -> ""
FORM -> ""
SETTING -> ""
KeyboardFeatureType.CHANGE_KEYBOARD -> ""
AUTO_TEXT -> ""
TEMPLATE_TEXT_GAME -> getTitleText(TEMPLATE_TEXT_GAME.name)
TEMPLATE_TEXT_APP -> getTitleText(TEMPLATE_TEXT_APP.name)
TEMPLATE_TEXT_SALE -> getTitleText(TEMPLATE_TEXT_SALE.name)
TEMPLATE_TEXT_GREETING -> getTitleText(TEMPLATE_TEXT_GREETING.name)
TEMPLATE_TEXT_LOVE -> getTitleText(TEMPLATE_TEXT_LOVE.name)
else -> ""
}
}
}

private fun setupRvContent(templateTextType: KeyboardFeatureType) {
setupRv(
when (templateTextType) {
NEWS -> listOf()
MOVIE -> listOf()
WEB -> listOf()
FORM -> listOf()
AUTO_TEXT -> listOf()
SETTING -> listOf()
KeyboardFeatureType.CHANGE_KEYBOARD -> listOf()
TEMPLATE_TEXT_GAME -> TemplateTextUtils.getTextGame(context)
TEMPLATE_TEXT_APP -> TemplateTextUtils.getTextApp(context)
TEMPLATE_TEXT_SALE -> TemplateTextUtils.getTextSale(context)
TEMPLATE_TEXT_GREETING -> TemplateTextUtils.getTextGreeting(context)
TEMPLATE_TEXT_LOVE -> TemplateTextUtils.getTextLove(context)
else -> listOf()
}
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.frogobox.appkeyboard.util

import android.view.ViewGroup
import com.frogobox.libkeyboard.common.core.BaseKeyboard

class KeyboardNavigationHelper {
companion object {
fun navigateTo(baseKeyboard: BaseKeyboard<*>, destinationKeyboard: BaseKeyboard<*>) {
baseKeyboard.parent?.let {
if (it is ViewGroup) {
it.removeView(baseKeyboard)
}
}

destinationKeyboard.parent?.let {
if (it is ViewGroup) {
it.addView(destinationKeyboard)
}
}
}
}
}
17 changes: 17 additions & 0 deletions app/src/main/res/layout/keyboard_dummy.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/iv_icon"
android:layout_width="0dp"
android:layout_height="0dp"
android:src="@drawable/ic_frogo_cracked"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
12 changes: 12 additions & 0 deletions app/src/main/res/layout/keyboard_ime.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" />

<com.frogobox.appkeyboard.ui.keyboard.dummy.DummyKeyboard
android:id="@+id/keyboard_dummy"
android:layout_width="match_parent"
android:layout_height="0dp"
android:clickable="true"
android:focusable="true"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/mock_measure_height_keyboard"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/mock_measure_height_keyboard" />

<com.frogobox.appkeyboard.ui.keyboard.form.FormKeyboard
android:id="@+id/keyboard_form"
android:layout_width="match_parent"
Expand Down