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

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

Display suggested word info in debug mode

Bug: 4686782
Change-Id: I0e5bef33aa39c3d6f75edda7818524965aa40b79
parent 703e7252
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
**
** Copyright 2011, 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.
*/
-->

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="6sp"
    android:textColor="@android:color/white"
    android:visibility="gone"
    style="?attr/suggestionBackgroundStyle" />
+39 −9
Original line number Diff line number Diff line
@@ -21,15 +21,35 @@
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
>
    <RelativeLayout
        android:layout_weight="1.0"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:gravity="center"
    >
        <include
        android:id="@+id/candidate_left"
        layout="@layout/candidate" />
            android:id="@+id/word_left"
            layout="@layout/candidate_word" />
        <include
            android:id="@+id/info_left"
            layout="@layout/candidate_info" />
    </RelativeLayout>
    <include
        layout="@layout/candidate_divider" />
    <RelativeLayout
        android:layout_weight="1.0"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:gravity="center"
    >
        <include
            android:id="@+id/word_center"
            layout="@layout/candidate_word" />
        <include
        android:id="@+id/candidate_center"
        layout="@layout/candidate" />
            android:id="@+id/info_center"
            layout="@layout/candidate_info" />
    </RelativeLayout>
    <include
        layout="@layout/candidate_divider" />
    <LinearLayout
@@ -39,9 +59,19 @@
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
    >
        <RelativeLayout
            android:layout_weight="1.0"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:gravity="center"
        >
            <include
                android:id="@+id/word_right"
                layout="@layout/candidate_word" />
            <include
            android:id="@+id/candidate_right"
            layout="@layout/candidate" />
                android:id="@+id/info_right"
                layout="@layout/candidate_info" />
        </RelativeLayout>
        <!-- Image drawables are set in CandidateView constructor -->
        <ImageButton
            android:id="@+id/expand_candidates_pane"
+11 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.inputmethod.compat;

import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.MarginLayoutParams;
import android.widget.FrameLayout;
@@ -49,4 +50,14 @@ public class FrameLayoutCompatUtils {
                    + placer.getClass().getName());
        }
    }

    public static void placeViewAt(View view, int x, int y, int w, int h) {
        final ViewGroup.LayoutParams lp = view.getLayoutParams();
        if (lp instanceof MarginLayoutParams) {
            final MarginLayoutParams marginLayoutParams = (MarginLayoutParams)lp;
            marginLayoutParams.width = w;
            marginLayoutParams.height = h;
            marginLayoutParams.setMargins(x, y, 0, 0);
        }
    }
}
+2 −5
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewGroup.MarginLayoutParams;
import android.view.accessibility.AccessibilityEvent;
import android.widget.PopupWindow;
import android.widget.TextView;
@@ -998,10 +997,8 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {

        // Place the key preview.
        // TODO: Adjust position of key previews which touch screen edges
        final MarginLayoutParams lp = (MarginLayoutParams)previewText.getLayoutParams();
        lp.width = previewWidth;
        lp.height = previewHeight;
        lp.setMargins(previewX, previewY, 0, 0);
        FrameLayoutCompatUtils.placeViewAt(
                previewText, previewX, previewY, previewWidth, previewHeight);
        previewText.setVisibility(VISIBLE);
    }

Loading