Keyboard icon indicating copy to clipboard operation
Keyboard copied to clipboard

added ability to filter/select languages

Open ronniedroid opened this issue 1 year ago • 8 comments

Added ability for the user to select only the languages they use.

Reopening a PR as it was a nightmare to rebase, so I closed the original PR and made a new branch.

Best.

ronniedroid avatar Jan 19 '24 13:01 ronniedroid

@naveensingh The commit history was becoming too cluttered and there was too much conflict. I hope this is fine.

ronniedroid avatar Jan 19 '24 13:01 ronniedroid

@ronniedroid Great! No problem.

naveensingh avatar Jan 19 '24 13:01 naveensingh

@naveensingh Sorry for the ping, just want to let you know that I will hold pushing the Arabic layout PR until this one is merged, so I don't have to do it twice :-).

ronniedroid avatar Jan 19 '24 13:01 ronniedroid

One issue that I still have that I could not solve is.

When you deselect the current set keyboard language from the Selected keyboard languages, the keyboard language switches to the first language in the set of SelectedLanguage, but the subtitle of the keyboard language section in the settings does not update to reflect this change immediately, one has to leave the settings and return to them to see the change.

ronniedroid avatar Mar 18 '24 10:03 ronniedroid

@ronniedroid I haven't checked the whole code yet but you should be able to solve it using a callback parameter in SelectLanguagesToToggle like this:

class SettingsLanguagesToToggle(..., val callback: (selectedLanguageCode) -> Unit) {
        ...
        fun onConfirm() {
             callback(getCurrentLanguage())
        }
        ...
}
class SettingsActivity {
      fun selectedKeyboardLanguaged() {
           ...
           selectedKeyboardLanguagesHolder.setOnClickListener {
                SettingsLanguagesToToggle(...) { selectedLanguageCode ->
                        // update text view using selectedLanguageCode
                }
           }
           ...
      }
}

naveensingh avatar Mar 18 '24 11:03 naveensingh

@ronniedroid I haven't checked the whole code yet but you should be able to solve it using a callback parameter in SelectLanguagesToToggle like this:

FIXED.

ronniedroid avatar Apr 16 '24 10:04 ronniedroid

@naveensingh all done

I switched to a recyclerview for the languages selection and tested, everything is working just fine.

ronniedroid avatar Apr 18 '24 06:04 ronniedroid

I'll check it out soon, thanks!

naveensingh avatar Apr 18 '24 13:04 naveensingh

Just renamed the setting to Manage keyboard languages and made some code style changes. I translated the manage_keyboard_languages string to Arabic, please update it if the translation is wrong.

Thank you!

naveensingh avatar May 22 '24 18:05 naveensingh