Loading app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountsSearchAdapter.java +11 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.drawer; * see <http://www.gnu.org/licenses>. */ import android.content.Context; import android.content.SharedPreferences; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -23,11 +24,13 @@ import android.widget.Filter; import android.widget.Filterable; import androidx.annotation.NonNull; import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.List; import app.fedilab.android.R; import app.fedilab.android.databinding.DrawerAccountSearchBinding; import app.fedilab.android.mastodon.client.entities.api.Account; import app.fedilab.android.mastodon.client.entities.api.Field; Loading Loading @@ -120,12 +123,16 @@ public class AccountsSearchAdapter extends ArrayAdapter<Account> implements Filt holder.binding.accountDn.setText(account.display_name); holder.binding.accountDn.setVisibility(View.VISIBLE); account.pronouns = null; SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean pronounsSupport = sharedpreferences.getBoolean(getContext().getString(R.string.SET_PRONOUNS_SUPPORT), true); if(pronounsSupport) { for (Field field : account.fields) { if (PronounsHelper.pronouns.contains(field.name.toLowerCase().trim())) { account.pronouns = Helper.parseHtml(field.value); break; } } } if (account.pronouns != null) { holder.binding.pronouns.setText(account.pronouns); holder.binding.pronouns.setVisibility(View.VISIBLE); Loading app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java +8 −5 Original line number Diff line number Diff line Loading @@ -1427,6 +1427,8 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder Status statusFromUser = statusList.get(position - 1); Account accountFromUser = statusFromUser.account; statusFromUser.pronouns = null; boolean pronounsSupport = sharedpreferences.getBoolean(context.getString(R.string.SET_PRONOUNS_SUPPORT), true); if(pronounsSupport) { if (accountFromUser.fields != null && accountFromUser.fields.size() > 0) { for (Field field : accountFromUser.fields) { if (PronounsHelper.pronouns.contains(field.name.toLowerCase().trim())) { Loading @@ -1436,6 +1438,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder } } } } ComposeViewHolder holder = (ComposeViewHolder) viewHolder; boolean extraFeatures = sharedpreferences.getBoolean(context.getString(R.string.SET_EXTAND_EXTRA_FEATURES) + MainActivity.currentUserID + MainActivity.currentInstance, false); boolean mathsComposer = sharedpreferences.getBoolean(context.getString(R.string.SET_MATHS_COMPOSER), true); Loading app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java +12 −8 Original line number Diff line number Diff line Loading @@ -482,6 +482,8 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> } String loadMediaType = sharedpreferences.getString(context.getString(R.string.SET_LOAD_MEDIA_TYPE), "ALWAYS"); boolean pronounsSupport = sharedpreferences.getBoolean(context.getString(R.string.SET_PRONOUNS_SUPPORT), true); if(pronounsSupport) { if (statusToDeal.pronouns == null && statusToDeal.account.fields != null && statusToDeal.account.fields.size() > 0) { for (Field field : statusToDeal.account.fields) { if (PronounsHelper.pronouns.contains(field.name.toLowerCase().trim())) { Loading @@ -493,6 +495,8 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> statusToDeal.pronouns = "none"; } } } if (statusToDeal.pronouns != null && !statusToDeal.pronouns.equalsIgnoreCase("none")) { holder.binding.pronouns.setVisibility(View.VISIBLE); holder.binding.pronouns.setText(statusToDeal.pronouns); Loading app/src/main/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -639,6 +639,7 @@ <string name="other">Other</string> <string name="eg_sensitive_content">Eg.: Sensitive Content</string> <string name="Pronouns">Pronouns</string> <string name="pronouns_support">Pronouns support</string> <string name="add_status">Add status</string> <string name="remove_status">Remove status</string> Loading Loading @@ -1197,6 +1198,7 @@ <string name="SET_MARKDOWN_SUPPORT" translatable="false">SET_MARKDOWN_SUPPORT</string> <string name="SET_TRUNCATE_LINKS" translatable="false">SET_TRUNCATE_LINKS</string> <string name="SET_UNDERLINE_CLICKABLE" translatable="false">SET_UNDERLINE_CLICKABLE</string> <string name="SET_PRONOUNS_SUPPORT" translatable="false">SET_PRONOUNS_SUPPORT</string> <string name="SET_TRUNCATE_LINKS_MAX" translatable="false">SET_TRUNCATE_LINKS_MAX</string> <string name="SET_HIDE_SINGLE_MEDIA_WITH_CARD" translatable="false">SET_HIDE_SINGLE_MEDIA_WITH_CARD</string> Loading app/src/main/res/xml/pref_timelines.xml +7 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,13 @@ app:singleLineTitle="false" app:title="@string/underline_links" /> <SwitchPreferenceCompat android:defaultValue="true" app:iconSpaceReserved="false" app:key="@string/SET_PRONOUNS_SUPPORT" app:singleLineTitle="false" app:title="@string/pronouns_support" /> <androidx.preference.SeekBarPreference android:defaultValue="30" android:max="150" Loading Loading
app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountsSearchAdapter.java +11 −4 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package app.fedilab.android.mastodon.ui.drawer; * see <http://www.gnu.org/licenses>. */ import android.content.Context; import android.content.SharedPreferences; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; Loading @@ -23,11 +24,13 @@ import android.widget.Filter; import android.widget.Filterable; import androidx.annotation.NonNull; import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.List; import app.fedilab.android.R; import app.fedilab.android.databinding.DrawerAccountSearchBinding; import app.fedilab.android.mastodon.client.entities.api.Account; import app.fedilab.android.mastodon.client.entities.api.Field; Loading Loading @@ -120,12 +123,16 @@ public class AccountsSearchAdapter extends ArrayAdapter<Account> implements Filt holder.binding.accountDn.setText(account.display_name); holder.binding.accountDn.setVisibility(View.VISIBLE); account.pronouns = null; SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean pronounsSupport = sharedpreferences.getBoolean(getContext().getString(R.string.SET_PRONOUNS_SUPPORT), true); if(pronounsSupport) { for (Field field : account.fields) { if (PronounsHelper.pronouns.contains(field.name.toLowerCase().trim())) { account.pronouns = Helper.parseHtml(field.value); break; } } } if (account.pronouns != null) { holder.binding.pronouns.setText(account.pronouns); holder.binding.pronouns.setVisibility(View.VISIBLE); Loading
app/src/main/java/app/fedilab/android/mastodon/ui/drawer/ComposeAdapter.java +8 −5 Original line number Diff line number Diff line Loading @@ -1427,6 +1427,8 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder Status statusFromUser = statusList.get(position - 1); Account accountFromUser = statusFromUser.account; statusFromUser.pronouns = null; boolean pronounsSupport = sharedpreferences.getBoolean(context.getString(R.string.SET_PRONOUNS_SUPPORT), true); if(pronounsSupport) { if (accountFromUser.fields != null && accountFromUser.fields.size() > 0) { for (Field field : accountFromUser.fields) { if (PronounsHelper.pronouns.contains(field.name.toLowerCase().trim())) { Loading @@ -1436,6 +1438,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder } } } } ComposeViewHolder holder = (ComposeViewHolder) viewHolder; boolean extraFeatures = sharedpreferences.getBoolean(context.getString(R.string.SET_EXTAND_EXTRA_FEATURES) + MainActivity.currentUserID + MainActivity.currentInstance, false); boolean mathsComposer = sharedpreferences.getBoolean(context.getString(R.string.SET_MATHS_COMPOSER), true); Loading
app/src/main/java/app/fedilab/android/mastodon/ui/drawer/StatusAdapter.java +12 −8 Original line number Diff line number Diff line Loading @@ -482,6 +482,8 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> } String loadMediaType = sharedpreferences.getString(context.getString(R.string.SET_LOAD_MEDIA_TYPE), "ALWAYS"); boolean pronounsSupport = sharedpreferences.getBoolean(context.getString(R.string.SET_PRONOUNS_SUPPORT), true); if(pronounsSupport) { if (statusToDeal.pronouns == null && statusToDeal.account.fields != null && statusToDeal.account.fields.size() > 0) { for (Field field : statusToDeal.account.fields) { if (PronounsHelper.pronouns.contains(field.name.toLowerCase().trim())) { Loading @@ -493,6 +495,8 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> statusToDeal.pronouns = "none"; } } } if (statusToDeal.pronouns != null && !statusToDeal.pronouns.equalsIgnoreCase("none")) { holder.binding.pronouns.setVisibility(View.VISIBLE); holder.binding.pronouns.setText(statusToDeal.pronouns); Loading
app/src/main/res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -639,6 +639,7 @@ <string name="other">Other</string> <string name="eg_sensitive_content">Eg.: Sensitive Content</string> <string name="Pronouns">Pronouns</string> <string name="pronouns_support">Pronouns support</string> <string name="add_status">Add status</string> <string name="remove_status">Remove status</string> Loading Loading @@ -1197,6 +1198,7 @@ <string name="SET_MARKDOWN_SUPPORT" translatable="false">SET_MARKDOWN_SUPPORT</string> <string name="SET_TRUNCATE_LINKS" translatable="false">SET_TRUNCATE_LINKS</string> <string name="SET_UNDERLINE_CLICKABLE" translatable="false">SET_UNDERLINE_CLICKABLE</string> <string name="SET_PRONOUNS_SUPPORT" translatable="false">SET_PRONOUNS_SUPPORT</string> <string name="SET_TRUNCATE_LINKS_MAX" translatable="false">SET_TRUNCATE_LINKS_MAX</string> <string name="SET_HIDE_SINGLE_MEDIA_WITH_CARD" translatable="false">SET_HIDE_SINGLE_MEDIA_WITH_CARD</string> Loading
app/src/main/res/xml/pref_timelines.xml +7 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,13 @@ app:singleLineTitle="false" app:title="@string/underline_links" /> <SwitchPreferenceCompat android:defaultValue="true" app:iconSpaceReserved="false" app:key="@string/SET_PRONOUNS_SUPPORT" app:singleLineTitle="false" app:title="@string/pronouns_support" /> <androidx.preference.SeekBarPreference android:defaultValue="30" android:max="150" Loading