mirror of
https://github.com/florisboard/florisboard.git
synced 2024-09-19 19:42:20 +02:00
Fix minor issues & bugs
This commit is contained in:
parent
f0950fb879
commit
55e7d35a8e
@ -84,6 +84,13 @@ class FlorisBoard : InputMethodService() {
|
|||||||
super.onStartInputView(info, restarting)
|
super.onStartInputView(info, restarting)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onComputeInsets(outInsets: Insets?) {
|
||||||
|
super.onComputeInsets(outInsets)
|
||||||
|
if (!isFullscreenMode && outInsets != null) {
|
||||||
|
outInsets.contentTopInsets = outInsets.visibleTopInsets
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun sendKeyPress(keyData: KeyData) {
|
fun sendKeyPress(keyData: KeyData) {
|
||||||
val ic = currentInputConnection
|
val ic = currentInputConnection
|
||||||
if (keyData.type == KeyType.CHARACTER) {
|
if (keyData.type == KeyType.CHARACTER) {
|
||||||
|
@ -135,6 +135,7 @@ class KeyView(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
@Suppress("NAME_SHADOWING")
|
@Suppress("NAME_SHADOWING")
|
||||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||||
val event = event ?: return false
|
val event = event ?: return false
|
||||||
@ -194,6 +195,9 @@ class KeyView(
|
|||||||
} else {
|
} else {
|
||||||
shouldBlockNextKeyCode = false
|
shouldBlockNextKeyCode = false
|
||||||
}
|
}
|
||||||
|
if (event.action == MotionEvent.ACTION_UP) {
|
||||||
|
performClick()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else -> return false
|
else -> return false
|
||||||
}
|
}
|
||||||
|
@ -56,6 +56,7 @@ class KeyboardView(
|
|||||||
return shouldStealMotionEvents
|
return shouldStealMotionEvents
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("ClickableViewAccessibility")
|
||||||
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
||||||
shouldStealMotionEvents = false
|
shouldStealMotionEvents = false
|
||||||
if (event != null && event.action == MotionEvent.ACTION_MOVE) {
|
if (event != null && event.action == MotionEvent.ACTION_MOVE) {
|
||||||
|
@ -2,7 +2,6 @@ package dev.patrickgold.florisboard.ime.layout
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import com.squareup.moshi.FromJson
|
import com.squareup.moshi.FromJson
|
||||||
import java.lang.Error
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines the type of the layout.
|
* Defines the type of the layout.
|
||||||
|
@ -5,7 +5,6 @@ import android.util.TypedValue
|
|||||||
import android.view.Gravity
|
import android.view.Gravity
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.PopupWindow
|
import android.widget.PopupWindow
|
||||||
@ -76,6 +75,7 @@ class KeyPopupManager(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun show() {
|
fun show() {
|
||||||
|
// TODO: improve performance of popup creation
|
||||||
val code = keyView.data.code
|
val code = keyView.data.code
|
||||||
if (code <= 32 || isShowingPopup) {
|
if (code <= 32 || isShowingPopup) {
|
||||||
return
|
return
|
||||||
|
@ -21,10 +21,10 @@ class SmartbarManager(
|
|||||||
var isQuickActionsViewVisible: Boolean = false
|
var isQuickActionsViewVisible: Boolean = false
|
||||||
set(value) { field = value; updateQuickActionVisibility() }
|
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
|
true
|
||||||
}
|
}
|
||||||
private val quickActionOnClickListener = View.OnClickListener { v ->
|
private val quickActionOnClickListener = View.OnClickListener { v ->
|
||||||
@ -37,7 +37,7 @@ class SmartbarManager(
|
|||||||
else -> return@OnClickListener
|
else -> return@OnClickListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private val quickActionToggleOnClickListener = View.OnClickListener { _ ->
|
private val quickActionToggleOnClickListener = View.OnClickListener {
|
||||||
isQuickActionsViewVisible = !isQuickActionsViewVisible
|
isQuickActionsViewVisible = !isQuickActionsViewVisible
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,14 +32,14 @@ class AboutActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set onClickListeners for buttons
|
// Set onClickListeners for buttons
|
||||||
privacyPolicyButton.setOnClickListener { _ ->
|
privacyPolicyButton.setOnClickListener {
|
||||||
val browserIntent = Intent(
|
val browserIntent = Intent(
|
||||||
Intent.ACTION_VIEW,
|
Intent.ACTION_VIEW,
|
||||||
Uri.parse(resources.getString(R.string.florisboard__privacy_policy_url))
|
Uri.parse(resources.getString(R.string.florisboard__privacy_policy_url))
|
||||||
)
|
)
|
||||||
startActivity(browserIntent)
|
startActivity(browserIntent)
|
||||||
}
|
}
|
||||||
licenseButton.setOnClickListener { _ ->
|
licenseButton.setOnClickListener {
|
||||||
val webView = WebView(this)
|
val webView = WebView(this)
|
||||||
webView.loadUrl("file:///android_asset/license/open_source_licenses.html")
|
webView.loadUrl("file:///android_asset/license/open_source_licenses.html")
|
||||||
licensesAlertDialog = AlertDialog.Builder(this, R.style.SettingsTheme_Light)
|
licensesAlertDialog = AlertDialog.Builder(this, R.style.SettingsTheme_Light)
|
||||||
@ -48,7 +48,7 @@ class AboutActivity : AppCompatActivity() {
|
|||||||
.setPositiveButton(android.R.string.ok, null)
|
.setPositiveButton(android.R.string.ok, null)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
sourceCodeButton.setOnClickListener { _ ->
|
sourceCodeButton.setOnClickListener {
|
||||||
val browserIntent = Intent(
|
val browserIntent = Intent(
|
||||||
Intent.ACTION_VIEW,
|
Intent.ACTION_VIEW,
|
||||||
Uri.parse(resources.getString(R.string.florisboard__repo_url))
|
Uri.parse(resources.getString(R.string.florisboard__repo_url))
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
android:id="@+id/keyboard_preview"
|
android:id="@+id/keyboard_preview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:background="#f00">
|
|
||||||
|
|
||||||
<!-- TODO: make a good looking keyboard preview -->
|
<!-- TODO: make a good looking keyboard preview -->
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
<dimen name="keyboard_preview_height">200dp</dimen>
|
<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_marginH">2dp</dimen>
|
||||||
<dimen name="keyboard_row_marginV">5dp</dimen>
|
<dimen name="keyboard_row_marginV">5dp</dimen>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user