summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2023-01-02 17:28:09 +0100
committerThomas <tschneider.ac@gmail.com>2023-01-02 17:28:09 +0100
commit537bb3f6220dce331cf164622c3ae578c82eb043 (patch)
treea1b8d2815f44be180e2c3e80a1a6ead089c5892b /app
parentda2ce8bce432fca053676a6b3326b44d7db1b58f (diff)
Release 3.13.5
Diffstat (limited to 'app')
-rw-r--r--app/build.gradle4
-rw-r--r--app/src/main/assets/release_notes/notes.json5
-rw-r--r--app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java9
-rw-r--r--app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java13
-rw-r--r--app/src/main/res/values/strings.xml9
-rw-r--r--app/src/main/res/xml/pref_extra_features.xml17
6 files changed, 50 insertions, 7 deletions
diff --git a/app/build.gradle b/app/build.gradle
index 464da616d..47616d831 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -13,8 +13,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 33
- versionCode 458
- versionName "3.13.4"
+ versionCode 459
+ versionName "3.13.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "default"
diff --git a/app/src/main/assets/release_notes/notes.json b/app/src/main/assets/release_notes/notes.json
index 6d5afedbc..f0b81c4b6 100644
--- a/app/src/main/assets/release_notes/notes.json
+++ b/app/src/main/assets/release_notes/notes.json
@@ -1,5 +1,10 @@
[
{
+ "version": "3.13.5",
+ "code": "459",
+ "note": "Added:\n- Glitch: Allow to post messages locally (Can be turned off in Settings)\n\nFixed:\n- Crashes"
+ },
+ {
"version": "3.13.4",
"code": "458",
"note": "Added:\n- Add Bubble timeline support in extra-features with filters\n- Allow to display public profiles by default to get all messages (Settings > Interface)\n\nChanged:\n- Full rework on links in messages (also mentions and tags)\n\nFixed:\n- Spoiler text when editing\n- Fix watermarks"
diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java
index 054e6e4de..2d02e143e 100644
--- a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java
+++ b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java
@@ -1278,8 +1278,11 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
holder.binding.buttonEmojiOne.setVisibility(View.VISIBLE);
if (extraFeatures) {
+ boolean displayLocalOnly = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_LOCAL_ONLY) + MainActivity.currentUserID + MainActivity.currentInstance, true);
holder.binding.buttonTextFormat.setVisibility(View.VISIBLE);
- holder.binding.buttonLocalOnly.setVisibility(View.VISIBLE);
+ if (displayLocalOnly) {
+ holder.binding.buttonLocalOnly.setVisibility(View.VISIBLE);
+ }
holder.binding.buttonTextFormat.setOnClickListener(v -> {
AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle());
builder.setTitle(context.getString(R.string.post_format));
@@ -1313,8 +1316,8 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
String[] labelArr = res.getStringArray(R.array.set_local_only);
int selection = 0;
- boolean localOnly = sharedpreferences.getBoolean(context.getString(R.string.SET_LOCAL_ONLY) + account.user_id + account.instance, false);
- if (statusDraft.local_only || localOnly) {
+ int localOnly = sharedpreferences.getInt(context.getString(R.string.SET_COMPOSE_LOCAL_ONLY) + account.user_id + account.instance, 0);
+ if (statusDraft.local_only || localOnly == 1) {
selection = 1;
}
builder.setSingleChoiceItems(labelArr, selection, null);
diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java
index 985faf95e..d30b5e033 100644
--- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java
+++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java
@@ -76,6 +76,13 @@ public class FragmentExtraFeaturesSettings extends PreferenceFragmentCompat impl
String format = sharedpreferences.getString(getString(R.string.SET_POST_FORMAT) + MainActivity.currentUserID + MainActivity.currentInstance, "text/plain");
SET_POST_FORMAT.setValue(format);
}
+
+ ListPreference SET_COMPOSE_LOCAL_ONLY = findPreference(getString(R.string.SET_COMPOSE_LOCAL_ONLY));
+ if (SET_COMPOSE_LOCAL_ONLY != null) {
+ SET_COMPOSE_LOCAL_ONLY.getContext().setTheme(Helper.dialogStyle());
+ int localOnly = sharedpreferences.getInt(getString(R.string.SET_COMPOSE_LOCAL_ONLY) + MainActivity.currentUserID + MainActivity.currentInstance, 0);
+ SET_COMPOSE_LOCAL_ONLY.setValue(String.valueOf(localOnly));
+ }
}
@Override
@@ -119,6 +126,12 @@ public class FragmentExtraFeaturesSettings extends PreferenceFragmentCompat impl
editor.putString(getString(R.string.SET_POST_FORMAT) + MainActivity.currentUserID + MainActivity.currentInstance, SET_POST_FORMAT.getValue());
}
}
+ if (key.compareToIgnoreCase(getString(R.string.SET_COMPOSE_LOCAL_ONLY)) == 0) {
+ ListPreference SET_COMPOSE_LOCAL_ONLY = findPreference(getString(R.string.SET_COMPOSE_LOCAL_ONLY));
+ if (SET_COMPOSE_LOCAL_ONLY != null) {
+ editor.putInt(getString(R.string.SET_COMPOSE_LOCAL_ONLY) + MainActivity.currentUserID + MainActivity.currentInstance, Integer.parseInt(SET_COMPOSE_LOCAL_ONLY.getValue()));
+ }
+ }
editor.apply();
}
}
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index fc9f6cb73..84aaab18f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -770,6 +770,10 @@
<item>text/x.misskeymarkdown</item>
</string-array>
+ <string-array name="SET_LOCAL_ONLY">
+ <item>0</item>
+ <item>1</item>
+ </string-array>
<string-array name="set_local_only">
<item>No</item>
@@ -1441,7 +1445,7 @@
<string name="SET_DISPLAY_TRANSLATE" translatable="false">SET_DISPLAY_TRANSLATE</string>
<string name="SET_POST_FORMAT" translatable="false">SET_POST_FORMAT</string>
- <string name="SET_LOCAL_ONLY" translatable="false">SET_LOCAL_ONLY</string>
+ <string name="SET_COMPOSE_LOCAL_ONLY" translatable="false">SET_COMPOSE_LOCAL_ONLY</string>
<string name="SET_TRANSLATOR" translatable="false">SET_TRANSLATOR</string>
<string name="SET_TRANSLATOR_VERSION" translatable="false">SET_TRANSLATOR_VERSION</string>
@@ -1455,7 +1459,7 @@
<string name="SET_PROFILE_REMOTELY" translatable="false">SET_PROFILE_REMOTELY</string>
<string name="SET_EXTAND_EXTRA_FEATURES" translatable="false">SET_EXTAND_EXTRA_FEATURES</string>
-
+ <string name="SET_DISPLAY_LOCAL_ONLY" translatable="false">SET_DISPLAY_LOCAL_ONLY</string>
<string name="SET_INNER_MARKER" translatable="false">SET_INNER_MARKER</string>
<string name="SET_NOTIF_SILENT" translatable="false">SET_NOTIF_SILENT</string>
<string name="SET_REMEMBER_POSITION" translatable="false">SET_REMEMBER_POSITION</string>
@@ -2194,4 +2198,5 @@
<string name="set_remote_profile_title">Remote profiles</string>
<string name="set_remote_profile">The app will display publicly profiles to get all messages. Interactions will need an extra step to federate messages.</string>
<string name="local_only">Local only</string>
+ <string name="set_display_local_only">Display \"Local only\" button</string>
</resources> \ No newline at end of file
diff --git a/app/src/main/res/xml/pref_extra_features.xml b/app/src/main/res/xml/pref_extra_features.xml
index 91d0a2637..26af2edf3 100644
--- a/app/src/main/res/xml/pref_extra_features.xml
+++ b/app/src/main/res/xml/pref_extra_features.xml
@@ -47,6 +47,12 @@
app:key="@string/SET_DISPLAY_REACTIONS"
app:singleLineTitle="false"
app:title="@string/set_display_reaction_indication" />
+ <SwitchPreferenceCompat
+ android:defaultValue="true"
+ app:iconSpaceReserved="false"
+ app:key="@string/SET_DISPLAY_LOCAL_ONLY"
+ app:singleLineTitle="false"
+ app:title="@string/set_display_local_only" />
</app.fedilab.android.helper.settings.LongSummaryPreferenceCategory>
<ListPreference
@@ -61,4 +67,15 @@
app:title="@string/set_post_format"
app:useSimpleSummaryProvider="true" />
+ <ListPreference
+ app:defaultValue="0"
+ app:dependency="@string/SET_EXTAND_EXTRA_FEATURES"
+ app:dialogTitle="@string/local_only"
+ app:entries="@array/set_local_only"
+ app:entryValues="@array/SET_LOCAL_ONLY"
+ app:iconSpaceReserved="false"
+ app:key="@string/SET_COMPOSE_LOCAL_ONLY"
+ app:title="@string/local_only"
+ app:useSimpleSummaryProvider="true" />
+
</androidx.preference.PreferenceScreen> \ No newline at end of file