FossifyOrg / Keyboard

Easy keyboard for inserting all kinds of texts, special characters and numbers.
https://www.fossify.org
GNU General Public License v3.0
285 stars 25 forks source link

added ability to filter/select languages #19

Closed ronniedroid closed 6 months ago

ronniedroid commented 10 months ago

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 commented 10 months ago

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

naveensingh commented 10 months ago

@ronniedroid Great! No problem.

ronniedroid commented 10 months ago

@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 commented 8 months ago

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.

naveensingh commented 8 months ago

@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
                }
           }
           ...
      }
}
ronniedroid commented 7 months ago

@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 commented 7 months ago

@naveensingh all done

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

naveensingh commented 7 months ago

I'll check it out soon, thanks!

naveensingh commented 6 months ago

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!