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

Commit c0382492 authored by Frank Preel's avatar Frank Preel
Browse files

Clickable button

parent 23a27ace
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    SPDX-FileCopyrightText: Material Design Authors / Google LLC
    SPDX-License-Identifier: Apache-2.0
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:height="24dp"
    android:width="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">

    <path
        android:fillColor="?android:attr/colorControlNormal"
        android:pathData="M17,13H13V17H11V13H7V11H11V7H13V11H17M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" />
</vector>
+40 −20
Original line number Diff line number Diff line
@@ -18,8 +18,13 @@
*/
-->

<LinearLayout
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
@@ -43,3 +48,18 @@
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <ImageButton
        android:id="@+id/floating_button"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:layout_gravity="top|end"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="8dp"
        android:background="?attr/selectableItemBackgroundBorderless"
        android:src="@drawable/ic_ime_switch"
        android:contentDescription="@string/ime_switch_button"
        android:focusable="true"
        android:clickable="true" />

</FrameLayout>
+3 −0
Original line number Diff line number Diff line
@@ -579,4 +579,7 @@ Tip: You can download and remove dictionaries by going to &lt;b>Languages&#160;&
         This resource is copied from packages/apps/Settings/res/values/strings.xml -->
    <!-- This resource is corresponding to msgid="5433275485499039199" -->
    <string name="user_dict_fast_scroll_alphabet">\u0020ABCDEFGHIJKLMNOPQRSTUVWXYZ</string>

     <!-- Speach to text -->
    <string name="ime_switch_button">STT</string>
</resources>
+12 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ import android.view.WindowManager;
import android.view.inputmethod.CompletionInfo;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodSubtype;
import android.widget.ImageButton;

import androidx.annotation.NonNull;

@@ -868,6 +869,17 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
        if (hasSuggestionStripView()) {
            mSuggestionStripView.setListener(this, view);
        }

        ImageButton floatingButton = view.findViewById(R.id.floating_button);
        if (floatingButton != null) {
            floatingButton.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Log.d(TAG, "Clicked");
                    //launchSettings(SettingsActivity.EXTRA_ENTRY_VALUE_LONG_PRESS_COMMA);
                }
            });
        }
    }

    @Override