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

Commit 9bdcff7b authored by Brandon Maxwell's avatar Brandon Maxwell Committed by Android (Google) Code Review
Browse files

Merge "Fixing display option for KO, JA, ZH" into nyc-mr1-dev

parents 7457ef70 151b3ae6
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -61,10 +61,12 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity {

    @Override
    public void onBuildHeaders(List<Header> target) {
        if (showDisplayOptions()) {
            Header displayOptionsHeader = new Header();
            displayOptionsHeader.titleRes = R.string.display_options_title;
            displayOptionsHeader.fragment = DisplayOptionsSettingsFragment.class.getName();
            target.add(displayOptionsHeader);
        }

        Header soundSettingsHeader = new Header();
        soundSettingsHeader.titleRes = R.string.sounds_and_vibration_title;
@@ -127,6 +129,18 @@ public class DialerSettingsActivity extends AppCompatPreferenceActivity {
        }
    }

    /**
    * Returns {@code true} or {@code false} based on whether the display options setting should be
    * shown. For languages such as Chinese, Japanese, or Korean, display options aren't useful
    * since contacts are sorted and displayed family name first by default.
    *
    * @return {@code true} if the display options should be shown, {@code false} otherwise.
    */
    private boolean showDisplayOptions() {
        return getResources().getBoolean(R.bool.config_display_order_user_changeable)
                && getResources().getBoolean(R.bool.config_sort_order_user_changeable);
    }

    @Override
    public void onHeaderClick(Header header, int position) {
        if (header.id == R.id.settings_header_sounds_and_vibration) {