Skip to content

Commit

Permalink
Refactor strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmud0808 committed Sep 11, 2023
1 parent 4d300e4 commit e4e46b2
Show file tree
Hide file tree
Showing 40 changed files with 867 additions and 796 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ protected void onPostExecute(String jsonStr) {
Intent intent = new Intent(requireActivity(), AppUpdates.class);
startActivity(intent);
});
update_desc.setText(getResources().getString(R.string.update_dialog_desc).replace("{latestVersionName}", latestVersion.getString("versionName")));
update_desc.setText(getResources().getString(R.string.update_dialog_desc, latestVersion.getString("versionName")));
check_update.setVisibility(View.VISIBLE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
private MenuAdapter initActivityItems() {
ArrayList<MenuModel> qspanel_activity_list = new ArrayList<>();

qspanel_activity_list.add(new MenuModel(QsRowColumn.class, getResources().getString(R.string.row_and_column_title), getResources().getString(R.string.row_and_column_desc), R.drawable.ic_qs_row_column));
qspanel_activity_list.add(new MenuModel(QsIconLabel.class, getResources().getString(R.string.icon_and_label_title), getResources().getString(R.string.icon_and_label_desc), R.drawable.ic_qs_icon_and_label));
qspanel_activity_list.add(new MenuModel(QsRowColumn.class, getResources().getString(R.string.activity_title_qs_row_column), getResources().getString(R.string.activity_desc_qs_row_column), R.drawable.ic_qs_row_column));
qspanel_activity_list.add(new MenuModel(QsIconLabel.class, getResources().getString(R.string.activity_title_qs_icon_label), getResources().getString(R.string.activity_desc_qs_icon_label), R.drawable.ic_qs_icon_and_label));
qspanel_activity_list.add(new MenuModel(QsTileSize.class, getResources().getString(R.string.activity_title_qs_tile_size), getResources().getString(R.string.activity_desc_qs_tile_size), R.drawable.ic_qs_tile_size));
qspanel_activity_list.add(new MenuModel(QsPanelMargin.class, getResources().getString(R.string.activity_title_qs_panel_margin), getResources().getString(R.string.activity_desc_qs_panel_margin), R.drawable.ic_qs_top_margin));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,19 +166,19 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
int current_language = Arrays.asList(getResources().getStringArray(R.array.locale_code)).indexOf(Prefs.getString(APP_LANGUAGE, getResources().getConfiguration().getLocales().get(0).getLanguage()));
rd_app_language = new RadioDialog(requireActivity(), 0, current_language == -1 ? 0 : current_language);
rd_app_language.setRadioDialogListener(this);
binding.settingsGeneral.appLanguage.setOnClickListener(v -> rd_app_language.show(R.string.app_language, R.array.locale_name, binding.settingsGeneral.selectedAppLanguage));
binding.settingsGeneral.appLanguage.setOnClickListener(v -> rd_app_language.show(R.string.settings_app_language, R.array.locale_name, binding.settingsGeneral.selectedAppLanguage));
binding.settingsGeneral.selectedAppLanguage.setText(Arrays.asList(getResources().getStringArray(R.array.locale_name)).get(rd_app_language.getSelectedIndex()));

// App Icon
rd_app_icon = new RadioDialog(requireActivity(), 2, Prefs.getInt(APP_ICON, 0));
rd_app_icon.setRadioDialogListener(this);
binding.settingsGeneral.appIcon.setOnClickListener(v -> rd_app_icon.show(R.string.app_icon, R.array.app_icon, binding.settingsGeneral.selectedAppIcon));
binding.settingsGeneral.appIcon.setOnClickListener(v -> rd_app_icon.show(R.string.settings_app_icon, R.array.app_icon, binding.settingsGeneral.selectedAppIcon));
binding.settingsGeneral.selectedAppIcon.setText(Arrays.asList(getResources().getStringArray(R.array.app_icon)).get(rd_app_icon.getSelectedIndex()));

// App Theme
rd_app_theme = new RadioDialog(requireActivity(), 1, Prefs.getInt(APP_THEME, 2));
rd_app_theme.setRadioDialogListener(this);
binding.settingsGeneral.appTheme.setOnClickListener(v -> rd_app_theme.show(R.string.app_theme, R.array.app_theme, binding.settingsGeneral.selectedAppTheme));
binding.settingsGeneral.appTheme.setOnClickListener(v -> rd_app_theme.show(R.string.settings_app_theme, R.array.app_theme, binding.settingsGeneral.selectedAppTheme));
binding.settingsGeneral.selectedAppTheme.setText(Arrays.asList(getResources().getStringArray(R.array.app_theme)).get(rd_app_theme.getSelectedIndex()));

// Check for update
Expand All @@ -200,16 +200,16 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
binding.settingsXposed.restartSystemuiBehavior.setOnCheckedChangeListener((buttonView, isChecked) -> {
Prefs.putBoolean(RESTART_SYSUI_BEHAVIOR, isChecked);
if (isChecked) {
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.auto_restart_systemui));
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.settings_auto_restart_systemui));
} else {
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.manual_restart_systemui));
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.settings_manual_restart_systemui));
}
});
binding.settingsXposed.restartSystemuiBehaviorContainer.setOnClickListener(v -> binding.settingsXposed.restartSystemuiBehavior.toggle());
if (binding.settingsXposed.restartSystemuiBehavior.isChecked()) {
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.auto_restart_systemui));
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.settings_auto_restart_systemui));
} else {
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.manual_restart_systemui));
binding.settingsXposed.restartSystemuiBehaviorDesc.setText(getResources().getString(R.string.settings_manual_restart_systemui));
}

// Restart sysui after boot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
}
}, getResources().getString(R.string.activity_title_color_engine), getResources().getString(R.string.activity_desc_color_engine), R.drawable.ic_tweaks_color});
tweaks_list.add(new Object[]{UiRoundness.class, getResources().getString(R.string.activity_title_ui_roundness), getResources().getString(R.string.activity_desc_ui_roundness), R.drawable.ic_tweaks_roundness});
tweaks_list.add(new Object[]{QsRowColumn.class, getResources().getString(R.string.row_and_column_title), getResources().getString(R.string.row_and_column_desc), R.drawable.ic_qs_row_column});
tweaks_list.add(new Object[]{QsIconLabel.class, getResources().getString(R.string.icon_and_label_title), getResources().getString(R.string.icon_and_label_desc), R.drawable.ic_qs_icon_and_label});
tweaks_list.add(new Object[]{QsRowColumn.class, getResources().getString(R.string.activity_title_qs_row_column), getResources().getString(R.string.activity_desc_qs_row_column), R.drawable.ic_qs_row_column});
tweaks_list.add(new Object[]{QsIconLabel.class, getResources().getString(R.string.activity_title_qs_icon_label), getResources().getString(R.string.activity_desc_qs_icon_label), R.drawable.ic_qs_icon_and_label});
tweaks_list.add(new Object[]{QsTileSize.class, getResources().getString(R.string.activity_title_qs_tile_size), getResources().getString(R.string.activity_desc_qs_tile_size), R.drawable.ic_qs_tile_size});
tweaks_list.add(new Object[]{QsPanelMargin.class, getResources().getString(R.string.activity_title_qs_panel_margin), getResources().getString(R.string.activity_desc_qs_panel_margin), R.drawable.ic_qs_top_margin});
tweaks_list.add(new Object[]{Statusbar.class, getResources().getString(R.string.activity_title_statusbar), getResources().getString(R.string.activity_desc_statusbar), R.drawable.ic_tweaks_statusbar});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void handleSystemUIRestart() {
if (Prefs.getBoolean(RESTART_SYSUI_BEHAVIOR, true)) {
restartSystemUI();
} else {
Toast.makeText(Iconify.getAppContext(), Objects.requireNonNull(Iconify.getAppContext()).getResources().getString(R.string.systemui_restart_required), Toast.LENGTH_SHORT).show();
Toast.makeText(Iconify.getAppContext(), Objects.requireNonNull(Iconify.getAppContext()).getResources().getString(R.string.settings_systemui_restart_required), Toast.LENGTH_SHORT).show();
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_app_updates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/schedule"
android:text="@string/section_title_schedule"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_media_player.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/media_player_background_color"
android:text="@string/section_title_background_color"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_miscellaneous.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/tablet_mode"
android:text="@string/section_title_tablet_mode"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -167,7 +167,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/privacy_chip"
android:text="@string/section_title_privacy_chip"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_navigation_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/display_mode"
android:text="@string/section_title_display_mode"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -210,7 +210,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/buttons"
android:text="@string/section_title_buttons"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -263,7 +263,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/gesture"
android:text="@string/section_title_gesture"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -402,7 +402,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/pill_navigation"
android:text="@string/section_title_pill_navigation"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_qs_icon_label.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/size_and_position"
android:text="@string/section_title_size_and_position"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_qs_panel_margin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/portrait_mode"
android:text="@string/section_title_portrait"
android:textColor="?attr/colorPrimary" />

<LinearLayout
Expand Down Expand Up @@ -111,7 +111,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/landscape_mode"
android:text="@string/section_title_landscape"
android:textColor="?attr/colorPrimary" />

<LinearLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_qs_tile_size.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/portrait_mode"
android:text="@string/section_title_portrait"
android:textColor="?attr/colorPrimary" />

<LinearLayout
Expand Down Expand Up @@ -151,7 +151,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/landscape_mode"
android:text="@string/section_title_landscape"
android:textColor="?attr/colorPrimary" />

<LinearLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_statusbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/spacing"
android:text="@string/section_title_spacing"
android:textColor="?attr/colorPrimary" />

<LinearLayout
Expand Down Expand Up @@ -208,7 +208,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/color"
android:text="@string/section_title_color"
android:textColor="?attr/colorPrimary" />

<LinearLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_volume_panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/volume_slider_track"
android:text="@string/section_title_volume_slider_track"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_xposed_background_chip.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/status_bar"
android:text="@string/section_title_status_bar"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -194,7 +194,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/status_icons"
android:text="@string/section_title_status_icons"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_xposed_header_image.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
style="@style/TextAppearance.Material3.TitleMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/image_alpha"
android:text="@string/header_image_alpha"
android:textColor="@color/text_color_primary" />

<TextView
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_xposed_others.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/status_icons"
android:text="@string/section_title_status_icons"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/res/layout/activity_xposed_quick_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/qs_tile"
android:text="@string/section_title_qs_tile"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -124,7 +124,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/for_pixel_roms"
android:text="@string/section_title_for_pixel_roms"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -220,7 +220,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/for_custom_roms"
android:text="@string/section_title_for_custom_roms"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -273,7 +273,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/translucent_theme"
android:text="@string/section_title_translucent_theme"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -411,7 +411,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/qs_margin"
android:text="@string/section_title_qs_margin"
android:textColor="?attr/colorPrimary" />

<LinearLayout
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_xposed_transparency_blur.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/transparency"
android:text="@string/section_title_transparency"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down Expand Up @@ -161,7 +161,7 @@
android:layout_marginHorizontal="24dp"
android:layout_marginTop="20dp"
android:layout_marginBottom="8dp"
android:text="@string/blur"
android:text="@string/section_title_blur"
android:textColor="?attr/colorPrimary" />

<RelativeLayout
Expand Down
Loading

0 comments on commit e4e46b2

Please sign in to comment.