0
0
mirror of https://github.com/florisboard/florisboard.git synced 2024-09-19 11:32:18 +02:00

Fix minor issues & bugs

This commit is contained in:
Patrick Goldinger 2020-04-30 19:33:27 +02:00
parent f0950fb879
commit 55e7d35a8e
9 changed files with 20 additions and 11 deletions

View File

@ -84,6 +84,13 @@ class FlorisBoard : InputMethodService() {
super.onStartInputView(info, restarting)
}
override fun onComputeInsets(outInsets: Insets?) {
super.onComputeInsets(outInsets)
if (!isFullscreenMode && outInsets != null) {
outInsets.contentTopInsets = outInsets.visibleTopInsets
}
}
fun sendKeyPress(keyData: KeyData) {
val ic = currentInputConnection
if (keyData.type == KeyType.CHARACTER) {

View File

@ -135,6 +135,7 @@ class KeyView(
}
}
@SuppressLint("ClickableViewAccessibility")
@Suppress("NAME_SHADOWING")
override fun onTouchEvent(event: MotionEvent?): Boolean {
val event = event ?: return false
@ -194,6 +195,9 @@ class KeyView(
} else {
shouldBlockNextKeyCode = false
}
if (event.action == MotionEvent.ACTION_UP) {
performClick()
}
}
else -> return false
}

View File

@ -56,6 +56,7 @@ class KeyboardView(
return shouldStealMotionEvents
}
@SuppressLint("ClickableViewAccessibility")
override fun onTouchEvent(event: MotionEvent?): Boolean {
shouldStealMotionEvents = false
if (event != null && event.action == MotionEvent.ACTION_MOVE) {

View File

@ -2,7 +2,6 @@ package dev.patrickgold.florisboard.ime.layout
import android.annotation.SuppressLint
import com.squareup.moshi.FromJson
import java.lang.Error
/**
* Defines the type of the layout.

View File

@ -5,7 +5,6 @@ import android.util.TypedValue
import android.view.Gravity
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.PopupWindow
@ -76,6 +75,7 @@ class KeyPopupManager(
}
fun show() {
// TODO: improve performance of popup creation
val code = keyView.data.code
if (code <= 32 || isShowingPopup) {
return

View File

@ -21,10 +21,10 @@ class SmartbarManager(
var isQuickActionsViewVisible: Boolean = false
set(value) { field = value; updateQuickActionVisibility() }
private val candidateViewOnClickListener = View.OnClickListener { _ ->
private val candidateViewOnClickListener = View.OnClickListener { v ->
//
}
private val candidateViewOnLongClickListener = View.OnLongClickListener { _ ->
private val candidateViewOnLongClickListener = View.OnLongClickListener { v ->
true
}
private val quickActionOnClickListener = View.OnClickListener { v ->
@ -37,7 +37,7 @@ class SmartbarManager(
else -> return@OnClickListener
}
}
private val quickActionToggleOnClickListener = View.OnClickListener { _ ->
private val quickActionToggleOnClickListener = View.OnClickListener {
isQuickActionsViewVisible = !isQuickActionsViewVisible
}

View File

@ -32,14 +32,14 @@ class AboutActivity : AppCompatActivity() {
}
// Set onClickListeners for buttons
privacyPolicyButton.setOnClickListener { _ ->
privacyPolicyButton.setOnClickListener {
val browserIntent = Intent(
Intent.ACTION_VIEW,
Uri.parse(resources.getString(R.string.florisboard__privacy_policy_url))
)
startActivity(browserIntent)
}
licenseButton.setOnClickListener { _ ->
licenseButton.setOnClickListener {
val webView = WebView(this)
webView.loadUrl("file:///android_asset/license/open_source_licenses.html")
licensesAlertDialog = AlertDialog.Builder(this, R.style.SettingsTheme_Light)
@ -48,7 +48,7 @@ class AboutActivity : AppCompatActivity() {
.setPositiveButton(android.R.string.ok, null)
.show()
}
sourceCodeButton.setOnClickListener { _ ->
sourceCodeButton.setOnClickListener {
val browserIntent = Intent(
Intent.ACTION_VIEW,
Uri.parse(resources.getString(R.string.florisboard__repo_url))

View File

@ -3,8 +3,7 @@
android:id="@+id/keyboard_preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="#f00">
android:orientation="vertical">
<!-- TODO: make a good looking keyboard preview -->

View File

@ -15,7 +15,6 @@
<dimen name="keyboard_preview_height">200dp</dimen>
<dimen name="keyboard_row_height">48dp</dimen>
<dimen name="keyboard_row_marginH">2dp</dimen>
<dimen name="keyboard_row_marginV">5dp</dimen>