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

Commit 0f576c77 authored by Menghan Li's avatar Menghan Li Committed by Automerger Merge Worker
Browse files

Merge "Support autoclick secondary action (8/n)" into rvc-dev am: 47b01403

Change-Id: If142e6cf0b0e979a8cca590523071217cffe4532
parents 7008d7a1 47b01403
Loading
Loading
Loading
Loading
+8 −18
Original line number Diff line number Diff line
@@ -5144,30 +5144,20 @@
    <!-- Summary shown for tritanomaly (blue-yellow color blindness) [CHAR LIMIT=45] -->
    <string name="daltonizer_mode_tritanomaly_summary">Blue-yellow</string>
    <!-- Subtitle for the accessibility preference to configure feature that performs click action soon after mouse/trackpad pointer stops moving, in case delay before click is extremely short. Placeholder will be set to the number of milliseconds to which the delay amounts. [CHAR LIMIT=NONE] -->
    <plurals name="accessibilty_autoclick_preference_subtitle_extremely_short_delay">
        <item quantity="one">Extremely short delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Extremely short delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
    </plurals>
    <!-- Subtitle for the accessibility preference to configure feature that performs click action soon after mouse/trackpad pointer stops moving, in case delay before click is extremely short. Placeholder will be set to the number of milliseconds to which the delay amounts. [CHAR LIMIT=NONE] -->
    <plurals name="accessibilty_autoclick_preference_subtitle_very_short_delay">
        <item quantity="one">Very short delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Very short delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
    </plurals>
    <!-- Subtitle for the accessibility preference to configure feature that performs click action soon after mouse/trackpad pointer stops moving, in case delay before click is extremely short. Placeholder will be set to the number of milliseconds to which the delay amounts. [CHAR LIMIT=NONE] -->
    <plurals name="accessibilty_autoclick_preference_subtitle_short_delay">
        <item quantity="one">Short delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Short delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
        <item quantity="one">Short (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Short (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
    </plurals>
    <!-- Subtitle for the accessibility preference to configure feature that performs click action soon after mouse/trackpad pointer stops moving, in case delay before click is extremely short. Placeholder will be set to the number of milliseconds to which the delay amounts. [CHAR LIMIT=NONE] -->
    <plurals name="accessibilty_autoclick_preference_subtitle_long_delay">
        <item quantity="one">Long delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Long delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
    <plurals name="accessibilty_autoclick_preference_subtitle_medium_delay">
        <item quantity="one">Medium (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Medium (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
    </plurals>
    <!-- Subtitle for the accessibility preference to configure feature that performs click action soon after mouse/trackpad pointer stops moving, in case delay before click is extremely short. Placeholder will be set to the number of milliseconds to which the delay amounts. [CHAR LIMIT=NONE] -->
    <plurals name="accessibilty_autoclick_preference_subtitle_very_long_delay">
        <item quantity="one">Very long delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Very long delay (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
    <plurals name="accessibilty_autoclick_preference_subtitle_long_delay">
        <item quantity="one">Long (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> second)</item>
        <item quantity="other">Long (<xliff:g id="click_delay_label" example="200">%1$s</xliff:g> seconds)</item>
    </plurals>
    <!-- Summary for autoclick seekbar settings preference when user selected custom item. [CHAR LIMIT=35] -->
+6 −8
Original line number Diff line number Diff line
@@ -64,12 +64,10 @@ public class ToggleAutoclickPreferenceFragment extends DashboardFragment
     * Resource ids from which autoclick preference summaries should be derived. The strings have
     * placeholder for integer delay value.
     */
    private static final int[] mAutoclickPreferenceSummaries = {
            R.plurals.accessibilty_autoclick_preference_subtitle_extremely_short_delay,
            R.plurals.accessibilty_autoclick_preference_subtitle_very_short_delay,
    private static final int[] AUTOCLICK_PREFERENCE_SUMMARIES = {
            R.plurals.accessibilty_autoclick_preference_subtitle_short_delay,
            R.plurals.accessibilty_autoclick_preference_subtitle_long_delay,
            R.plurals.accessibilty_autoclick_preference_subtitle_very_long_delay
            R.plurals.accessibilty_autoclick_preference_subtitle_medium_delay,
            R.plurals.accessibilty_autoclick_preference_subtitle_long_delay
    };

    /**
@@ -86,7 +84,7 @@ public class ToggleAutoclickPreferenceFragment extends DashboardFragment
        // Only show integer when delay time is 1.
        final String decimalFormat = (delaySecond == 1) ? "%.0f" : "%.1f";

        return resources.getQuantityString(mAutoclickPreferenceSummaries[summaryIndex],
        return resources.getQuantityString(AUTOCLICK_PREFERENCE_SUMMARIES[summaryIndex],
                quantity, String.format(decimalFormat, delaySecond));
    }

@@ -98,10 +96,10 @@ public class ToggleAutoclickPreferenceFragment extends DashboardFragment
            return 0;
        }
        if (delay >= MAX_AUTOCLICK_DELAY_MS) {
            return mAutoclickPreferenceSummaries.length - 1;
            return AUTOCLICK_PREFERENCE_SUMMARIES.length - 1;
        }
        int delayRange = MAX_AUTOCLICK_DELAY_MS - MIN_AUTOCLICK_DELAY_MS;
        int rangeSize = (delayRange) / (mAutoclickPreferenceSummaries.length - 1);
        int rangeSize = (delayRange) / (AUTOCLICK_PREFERENCE_SUMMARIES.length - 1);
        return (delay - MIN_AUTOCLICK_DELAY_MS) / rangeSize;
    }