Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 17752016 authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

Calculate default touch position correction data for keys on 4th row

This change also disables touch position correction for Phone/Dvorak
keyboard.

Bug: 7243101
Change-Id: Idfcc7ad1feabbe6a81635dceba5be087401fa18b
parent 4d1f3d11
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2012, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Note that correctionX is obsolete (See com.android.inputmethod.keyboard.internal.TouchPositionCorrection)
        An entry of the touch_position_correction word should be:
        1. correctionX: (touch_center_x - hitbox_center_x) / hitbox_width
        2. correctionY: (touch_center_y - hitbox_center_y) / hitbox_height
        3. correctionR: sweet_spot_radius / sqrt(hitbox_width^2 + hitbox_height^2)
    -->

    <string-array
        name="touch_position_correction_data_default"
        translatable="false"
    >
        <!-- The default touch position data (See com.android.inputmethod.keyboard.ProximityInfo)
             correctionX = 0.0f
             correctionY = 0.0f
             correctionR = DEFAULT_TOUCH_POSITION_CORRECTION_RADIUS
        -->
    </string-array>

    <string-array
        name="touch_position_correction_data_gingerbread"
        translatable="false"
    >
        <!-- The default touch position data (See com.android.inputmethod.keyboard.ProximityInfo)
             correctionX = 0.0f
             correctionY = 0.0f
             correctionR = DEFAULT_TOUCH_POSITION_CORRECTION_RADIUS
        -->
    </string-array>

    <string-array
        name="touch_position_correction_data_ice_cream_sandwich"
        translatable="false"
    >
        <!-- The default touch position data (See com.android.inputmethod.keyboard.ProximityInfo)
             correctionX = 0.0f
             correctionY = 0.0f
             correctionR = DEFAULT_TOUCH_POSITION_CORRECTION_RADIUS
        -->
    </string-array>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@
    <style name="Keyboard">
        <!-- This should be aligned with KeyboardSwitcher.KEYBOARD_THEMES[] -->
        <item name="themeId">0</item>
        <item name="touchPositionCorrectionData">@array/touch_position_correction_data_empty</item>
        <item name="touchPositionCorrectionData">@array/touch_position_correction_data_default</item>
        <item name="rowHeight">25%p</item>
        <item name="keyboardHeight">@dimen/keyboardHeight</item>
        <item name="maxKeyboardHeight">@fraction/maxKeyboardHeight</item>
+11 −7
Original line number Diff line number Diff line
@@ -18,18 +18,22 @@
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!--
    <!-- Note that correctionX is obsolete (See com.android.inputmethod.keyboard.internal.TouchPositionCorrection)
        An entry of the touch_position_correction word should be:
        1. (float) (touch_center_x - key_center_x) / key_width
        2. (float) (touch_center_y - key_center_y) / key_height
        3. (float) sweet_spot_radius / (key_width^2 + key_height^2)
        1. correctionX: (touch_center_x - hitbox_center_x) / hitbox_width
        2. correctionY: (touch_center_y - hitbox_center_y) / hitbox_height
        3. correctionR: sweet_spot_radius / sqrt(hitbox_width^2 + hitbox_height^2)
    -->

    <string-array
        name="touch_position_correction_data_empty"
        name="touch_position_correction_data_default"
        translatable="false"
    >
        <!-- empty -->
        <!-- The default touch position data (See com.android.inputmethod.keyboard.ProximityInfo)
             correctionX = 0.0f
             correctionY = 0.0f
             correctionR = DEFAULT_TOUCH_POSITION_CORRECTION_RADIUS
        -->
    </string-array>

    <string-array
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
    latin:keyboardHorizontalEdgesPadding="10%p"
    latin:keyWidth="26.67%p"
    latin:touchPositionCorrectionData="@array/touch_position_correction_data_default"
>
    <include
        latin:keyboardLayout="@xml/rows_number" />
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
    latin:keyboardHorizontalEdgesPadding="10%p"
    latin:keyWidth="26.67%p"
    latin:touchPositionCorrectionData="@array/touch_position_correction_data_default"
>
    <include
        latin:keyboardLayout="@xml/rows_phone" />
Loading