Merge pull request #124 from FossifyOrg/switch_to_switches

feat(ui): replace checkboxes with material switches
This commit is contained in:
Naveen Singh
2025-05-07 03:01:51 +05:30
committed by GitHub
4 changed files with 64 additions and 51 deletions

View File

@@ -7,27 +7,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- Replaced checkboxes with switches (https://github.com/orgs/FossifyOrg/discussions/78)
### Fixed
- Security label color in settings
## [1.1.1] - 2025-03-18
### Changed
- Minor bug fixes and improvements
- Added more translations
### Fixed
- Fixed security vulnerability in app lock
## [1.1.0] - 2024-07-22
### Added
- Added collapsible checked items section at the bottom
### Changed
- Minor bug fixes and improvements
- Added new translations
## [1.0.0] - 2024-04-14
### Added
- Initial release
[Unreleased]: https://github.com/FossifyOrg/Notes/compare/1.1.1...HEAD

View File

@@ -133,6 +133,7 @@ class SettingsActivity : SimpleActivity() {
binding.settingsTextLabel,
binding.settingsStartupLabel,
binding.settingsSavingLabel,
binding.settingsSecurityLabel,
binding.settingsMigratingLabel,
binding.settingsBackupsLabel,
).forEach {

View File

@@ -82,13 +82,13 @@
<RelativeLayout
android:id="@+id/settings_use_english_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_use_english"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/use_english_language" />
@@ -154,13 +154,13 @@
<RelativeLayout
android:id="@+id/settings_show_word_count_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_show_word_count"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_word_count" />
@@ -169,13 +169,13 @@
<RelativeLayout
android:id="@+id/settings_clickable_links_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_clickable_links"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/links_and_emails_clickable" />
@@ -184,13 +184,13 @@
<RelativeLayout
android:id="@+id/settings_monospaced_font_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_monospaced_font"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/monospaced_font" />
@@ -199,13 +199,13 @@
<RelativeLayout
android:id="@+id/settings_use_incognito_mode_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_use_incognito_mode"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/use_incognito_mode" />
@@ -214,13 +214,13 @@
<RelativeLayout
android:id="@+id/settings_enable_line_wrap_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_enable_line_wrap"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/enable_line_wrap" />
@@ -229,13 +229,13 @@
<RelativeLayout
android:id="@+id/settings_move_undone_checklist_items_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_move_undone_checklist_items"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/move_done_checklist_items" />
@@ -278,13 +278,13 @@
<RelativeLayout
android:id="@+id/settings_cursor_placement_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_cursor_placement"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/place_cursor_end" />
@@ -293,13 +293,13 @@
<RelativeLayout
android:id="@+id/settings_show_keyboard_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_show_keyboard"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_keyboard" />
@@ -308,13 +308,13 @@
<RelativeLayout
android:id="@+id/settings_show_note_picker_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_show_note_picker"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_note_picker" />
@@ -334,13 +334,13 @@
<RelativeLayout
android:id="@+id/settings_autosave_notes_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_autosave_notes"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/autosave_notes" />
@@ -349,13 +349,13 @@
<RelativeLayout
android:id="@+id/settings_display_success_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_display_success"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/display_success_message" />
@@ -379,13 +379,13 @@
<RelativeLayout
android:id="@+id/settings_app_password_protection_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_app_password_protection"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/password_protect_whole_app" />
@@ -394,13 +394,13 @@
<RelativeLayout
android:id="@+id/settings_note_deletion_password_protection_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_note_deletion_password_protection"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/password_protect_note_deletion" />
@@ -420,13 +420,13 @@
<RelativeLayout
android:id="@+id/settings_enable_automatic_backups_holder"
style="@style/SettingsHolderCheckboxStyle"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/settings_enable_automatic_backups"
style="@style/SettingsCheckboxStyle"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/enable_automatic_backups" />

View File

@@ -20,18 +20,16 @@
<RelativeLayout
android:id="@+id/show_note_title_holder"
style="@style/SettingsHolderSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:padding="@dimen/activity_margin">
android:background="?attr/selectableItemBackground">
<org.fossify.commons.views.MyAppCompatCheckbox
<org.fossify.commons.views.MyMaterialSwitch
android:id="@+id/show_note_title"
style="@style/SettingsSwitchStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:layoutDirection="rtl"
android:text="@string/show_note_title"
app:switchPadding="@dimen/medium_margin" />
@@ -45,6 +43,7 @@
android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/normal_margin"
android:paddingStart="@dimen/activity_margin"
android:paddingEnd="@dimen/activity_margin"
android:text="@string/note_shown_widget" />
<org.fossify.commons.views.MyTextView