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

Commit f0c66068 authored by Kurt Partridge's avatar Kurt Partridge Committed by Android (Google) Code Review
Browse files

Merge "ResearchLogger feedback form"

parents ccaa799e 3c233bf1
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 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.
-->

<com.android.inputmethod.research.FeedbackLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:orientation="vertical"
     android:id="@+id/research_feedback_layout"
>

    <fragment
          android:id="@+id/research_feedback_fragment"
          android:name="com.android.inputmethod.research.FeedbackFragment"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
    />
</com.android.inputmethod.research.FeedbackLayout>
+112 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 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.
-->

<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:orientation="vertical"
>

    <!-- Mimic a dialog title.  Necessary since the dialog is actually an activity, so the normal
        dialog title construction code is not available. -->
    <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical"
    >
        <com.android.internal.widget.DialogTitle
            style="?android:attr/windowTitleStyle"
            android:singleLine="true"
            android:ellipsize="end"
            android:layout_width="match_parent"
            android:layout_height="64dip"
            android:layout_marginLeft="16dip"
            android:layout_marginRight="16dip"
            android:gravity="center_vertical|left"
            android:text="@string/research_feedback_dialog_title" />
        <View
            android:layout_width="match_parent"
            android:layout_height="2dip"
            android:background="@android:color/holo_blue_light" />
    </LinearLayout>

    <EditText
        android:id="@+id/research_feedback_contents"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_gravity="fill_horizontal|center_vertical"
        android:layout_marginLeft="8dip"
        android:layout_marginRight="8dip"
        android:layout_marginBottom="8dip"
        android:layout_marginTop="8dip"
        android:lines="2"
        android:hint="@string/research_feedback_hint"
        android:inputType="textMultiLine"
        android:imeOptions="flagNoFullscreen"
    >
        <requestFocus />
    </EditText>

    <CheckBox
        android:id="@+id/research_feedback_include_history"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_marginBottom="8dip"
        android:checked="true"
        android:text="@string/research_feedback_include_history_label"
    />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:divider="?android:attr/dividerHorizontal"
        android:showDividers="beginning"
        android:dividerPadding="0dip"
    >
        <LinearLayout
            style="?android:attr/buttonBarStyle"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:measureWithLargestChild="true"
        >
            <Button
                android:id="@+id/research_feedback_cancel_button"
                android:layout_width="0dip"
                android:layout_gravity="left"
                android:layout_weight="1"
                android:maxLines="2"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:text="@string/research_feedback_cancel"
                android:layout_height="wrap_content"
            />
            <Button
                android:id="@+id/research_feedback_send_button"
                android:layout_width="0dip"
                android:layout_gravity="right"
                android:layout_weight="1"
                android:maxLines="2"
                style="?android:attr/buttonBarButtonStyle"
                android:textSize="14sp"
                android:text="@string/research_feedback_send"
                android:layout_height="wrap_content"
            />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
+50 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 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.
-->

<LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:orientation="vertical"
>

    <EditText
        android:id="@+id/research_feedback_contents"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_gravity="fill_horizontal|center_vertical"
        android:layout_marginLeft="8dip"
        android:layout_marginRight="8dip"
        android:layout_marginBottom="8dip"
        android:layout_marginTop="8dip"
        android:lines="2"
        android:hint="@string/research_feedback_hint"
        android:inputType="textMultiLine"
        android:imeOptions="flagNoFullscreen"
        android:focusable="true"
    >
        <requestFocus />
    </EditText>

    <CheckBox
        android:id="@+id/research_feedback_include_history"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        android:layout_marginBottom="8dip"
        android:checked="true"
        android:text="@string/research_feedback_include_history_label"
    />
</LinearLayout>
+35 −17
Original line number Diff line number Diff line
@@ -222,29 +222,47 @@
    <!-- Title for input language selection screen -->
    <string name="language_selection_title">Input languages</string>

    <!-- Title for dialog option that lets user mark a particular time in the log for later review by experts [CHAR LIMIT=38] -->
    <string name="note_timestamp_for_researchlog">Note timestamp in log</string>
    <!-- Toast notification message that the time has been marked for later review. [CHAR LIMIT=25] -->
    <string name="notify_recorded_timestamp">Recorded timestamp</string>

    <!-- Title for dialog option to let users cancel logging and delete log for this session [CHAR LIMIT=35] -->
    <string name="do_not_log_this_session">Suspend logging</string>
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_do_not_log_this_session" translatable="false">Suspend logging</string>
    <!-- Title for dialog option to let users reenable logging [CHAR LIMIT=35] -->
    <string name="enable_session_logging">Enable logging</string>
    <!--  Title for dialog option to let users log all events in this session [CHAR LIMIT=35] -->
    <string name="log_whole_session_history">Log whole session history</string>
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_enable_session_logging" translatable="false">Enable logging</string>
    <!-- Toast notification that the system is processing the request to delete the log for this session [CHAR LIMIT=35] -->
    <string name="notify_session_log_deleting">Deleting session log</string>
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_notify_session_log_deleting" translatable="false">Deleting session log</string>
    <!-- Toast notification that the system has successfully deleted the log for this session [CHAR LIMIT=35] -->
    <string name="notify_logging_suspended">Logging temporarily suspended.  To disable permanently, go to Android Keyboard Settings</string>
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_notify_logging_suspended" translatable="false">Logging temporarily suspended.  To disable permanently, go to Android Keyboard Settings</string>
    <!-- Toast notification that the system has failed to delete the log for this session [CHAR LIMIT=35] -->
    <string name="notify_session_log_not_deleted">Session log NOT deleted</string>
    <!-- Toast notification that the system has recorded the whole session history [CHAR LIMIT=35] -->
    <string name="notify_session_history_logged">Session history logged</string>
    <!-- Toast notification that the system has failed to record the whole session history [CHAR LIMIT=35] -->
    <string name="notify_session_history_not_logged">Error: Session history NOT logged</string>
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_notify_session_log_not_deleted" translatable="false">Session log NOT deleted</string>
    <!-- Toast notification that the system is enabling logging [CHAR LIMIT=35] -->
    <string name="notify_session_logging_enabled">Session logging enabled</string>
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_notify_session_logging_enabled" translatable="false">Session logging enabled</string>

    <!-- Menu option that lets user send feedback for research purposes about the IME [CHAR LIMIT=38] -->
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_feedback_menu_option" translatable="false">Send feedback</string>
    <!-- Dialog box title that lets user send feedback for research purposes about the IME [CHAR LIMIT=38] -->
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_feedback_dialog_title" translatable="false">Send feedback</string>
    <!-- Text for checkbox option to include user data in feedback for research purposes [CHAR LIMIT=50] -->
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_feedback_include_history_label" translatable="false">Include last 5 words entered</string>
    <!-- Hint to user about the text entry field where they should enter research feedback [CHAR LIMIT=40] -->
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_feedback_hint" translatable="false">Enter your feedback here.</string>
    <!-- Dialog button choice to send research feedback [CHAR LIMIT=35] -->
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_feedback_send" translatable="false">Send</string>
    <!-- Dialog button choice to cancel sending research feedback [CHAR LIMIT=35] -->
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_feedback_cancel" translatable="false">Cancel</string>
    <!-- Toast notification to ask user to quit the research feedback dialog to perform this operation [CHAR LIMIT=100] -->
    <!-- TODO: remove translatable=false attribute once text is stable -->
    <string name="research_please_exit_feedback_form" translatable="false">Please exit the feedback dialog to access the research log menu</string>

    <!-- Preference for input language selection -->
    <string name="select_language">Input languages</string>

+14 −6
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static com.android.inputmethod.latin.Constants.ImeOption.FORCE_ASCII;
import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE;
import static com.android.inputmethod.latin.Constants.ImeOption.NO_MICROPHONE_COMPAT;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
@@ -38,7 +39,6 @@ import android.os.Debug;
import android.os.IBinder;
import android.os.Message;
import android.os.SystemClock;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.text.InputType;
import android.text.TextUtils;
@@ -2111,18 +2111,26 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
    };

    private void launchSettings() {
        launchSettingsClass(SettingsActivity.class);
        handleClose();
        launchSubActivity(SettingsActivity.class);
    }

    // Called from debug code only
    public void launchDebugSettings() {
        launchSettingsClass(DebugSettingsActivity.class);
        handleClose();
        launchSubActivity(DebugSettingsActivity.class);
    }

    private void launchSettingsClass(Class<? extends PreferenceActivity> settingsClass) {
        handleClose();
    public void launchKeyboardedDialogActivity(Class<? extends Activity> activityClass) {
        // Put the text in the attached EditText into a safe, saved state before switching to a
        // new activity that will also use the soft keyboard.
        commitTyped(LastComposedWord.NOT_A_SEPARATOR);
        launchSubActivity(activityClass);
    }

    private void launchSubActivity(Class<? extends Activity> activityClass) {
        Intent intent = new Intent();
        intent.setClass(LatinIME.this, settingsClass);
        intent.setClass(LatinIME.this, activityClass);
        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    }
Loading