Release 3.14.3

This commit is contained in:
Thomas 2023-01-13 18:07:35 +01:00
parent d3f721f7cc
commit 447ad45fc6
9 changed files with 57 additions and 15 deletions

View File

@ -13,8 +13,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 33
versionCode 464
versionName "3.14.2"
versionCode 465
versionName "3.14.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "default"

View File

@ -1,4 +1,9 @@
[
{
"version": "3.14.3",
"code": "465",
"note": "Added:\n- Display date of the message instead of the boost (default: disabled)\n- Allow to disable release notes popup in Settings\n\nFixed:\n- Fix timelines slow down and stuttering after some scrolls\n- Fix color issues with follow buttons\n- Fix import from settings (import from login was OK)"
},
{
"version": "3.14.2",
"code": "464",

View File

@ -1781,6 +1781,10 @@ public class Helper {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity);
int lastReleaseNoteRead = sharedpreferences.getInt(activity.getString(R.string.SET_POPUP_RELEASE_NOTES), 0);
int versionCode = BuildConfig.VERSION_CODE;
boolean disabled = sharedpreferences.getBoolean(activity.getString(R.string.SET_DISABLE_RELEASE_NOTES_ALERT), false);
if (disabled && !forced) {
return;
}
if (lastReleaseNoteRead != versionCode || forced) {
try {
InputStream is = activity.getAssets().open("release_notes/notes.json");

View File

@ -404,6 +404,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
boolean displayQuote = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_QUOTES) + MainActivity.currentUserID + MainActivity.currentInstance, true);
boolean displayReactions = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_REACTIONS) + MainActivity.currentUserID + MainActivity.currentInstance, true);
boolean compactButtons = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_COMPACT_ACTION_BUTTON), false);
boolean originalDateForBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_BOOST_ORIGINAL_DATE), true);
if (compactButtons) {
ConstraintSet set = new ConstraintSet();
@ -1081,7 +1082,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else {
holder.binding.editTime.setVisibility(View.GONE);
}
holder.binding.time.setText(Helper.longDateToString(status.created_at));
if (originalDateForBoost || status.reblog == null) {
holder.binding.time.setText(Helper.longDateToString(statusToDeal.created_at));
} else {
holder.binding.time.setText(Helper.longDateToString(status.created_at));
}
holder.binding.time.setVisibility(View.VISIBLE);
holder.binding.dateShort.setVisibility(View.GONE);
holder.binding.visibility.setImageResource(ressource);
@ -1108,7 +1113,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
holder.binding.visibilitySmall.setVisibility(View.GONE);
holder.binding.reblogsCount.setText(String.valueOf(statusToDeal.reblogs_count));
holder.binding.favoritesCount.setText(String.valueOf(statusToDeal.favourites_count));
holder.binding.time.setText(Helper.dateDiff(context, statusToDeal.created_at));
if (originalDateForBoost || status.reblog == null) {
holder.binding.time.setText(Helper.dateDiff(context, statusToDeal.created_at));
} else {
holder.binding.time.setText(Helper.dateDiff(context, status.created_at));
}
if (statusToDeal.edited_at != null) {
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_baseline_mode_edit_message_24);
img.setBounds(0, 0, (int) (Helper.convertDpToPixel(16, context) * scale + 0.5f), (int) (Helper.convertDpToPixel(16, context) * scale + 0.5f));
@ -1130,7 +1139,11 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else {
holder.binding.dateShort.setCompoundDrawables(null, null, null, null);
}
holder.binding.dateShort.setText(Helper.dateDiff(context, statusToDeal.created_at));
if (originalDateForBoost || status.reblog == null) {
holder.binding.dateShort.setText(Helper.dateDiff(context, statusToDeal.created_at));
} else {
holder.binding.dateShort.setText(Helper.dateDiff(context, status.created_at));
}
holder.binding.time.setVisibility(View.GONE);
Helper.absoluteDateTimeReveal(context, holder.binding.dateShort, statusToDeal.created_at, statusToDeal.edited_at);
}

View File

@ -20,7 +20,6 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.webkit.URLUtil;
import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher;
@ -164,9 +163,10 @@ public class FragmentSettingsCategories extends PreferenceFragmentCompat {
pref_import_settings.setOnPreferenceClickListener(preference -> {
Intent openFileIntent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
openFileIntent.addCategory(Intent.CATEGORY_OPENABLE);
openFileIntent.setType("text/plain");
String[] mimeTypes = new String[]{"text/plain"};
openFileIntent.setType("application/zip");
String[] mimeTypes = new String[]{"application/zip"};
openFileIntent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
//noinspection deprecation
startActivityForResult(
Intent.createChooser(
openFileIntent,
@ -184,13 +184,6 @@ public class FragmentSettingsCategories extends PreferenceFragmentCompat {
Toasty.error(requireActivity(), getString(R.string.toot_select_file_error), Toast.LENGTH_LONG).show();
return;
}
String uriFullPath = data.getData().getPath();
String[] uriFullPathStr = uriFullPath.split(":");
String fullPath = uriFullPath;
if (uriFullPathStr.length > 1) {
fullPath = uriFullPathStr[1];
}
final String fileName = URLUtil.guessFileName(fullPath, null, null);
Helper.createFileFromUri(requireActivity(), data.getData(), file -> ZipHelper.importData(requireActivity(), file));
}
}

View File

@ -821,6 +821,7 @@
<string name="SET_PROXY_PORT" translatable="false">SET_PROXY_PORT</string>
<string name="SET_DEFAULT_LOCALE_NEW" translatable="false">SET_DEFAULT_LOCALE_NEW</string>
<string name="SET_SEND_CRASH_REPORTS" translatable="false">SET_SEND_CRASH_REPORTS</string>
<string name="SET_DISABLE_RELEASE_NOTES_ALERT" translatable="false">SET_DISABLE_RELEASE_NOTES_ALERT</string>
<string name="SET_DISABLE_GIF" translatable="false">SET_DISABLE_GIF</string>
<string name="SET_JAVASCRIPT" translatable="false">SET_JAVASCRIPT</string>
<string name="SET_CUSTOM_USER_AGENT" translatable="false">SET_CUSTOM_USER_AGENT</string>
@ -1472,6 +1473,7 @@
<string name="SET_EXCLUDED_NOTIFICATIONS_TYPE" translatable="false">SET_EXCLUDED_NOTIFICATIONS_TYPE</string>
<string name="SET_EXPAND_MEDIA" translatable="false">SET_EXPAND_MEDIA</string>
<string name="SET_GROUP_REBLOGS" translatable="false">SET_GROUP_REBLOGS</string>
<string name="SET_BOOST_ORIGINAL_DATE" translatable="false">SET_BOOST_ORIGINAL_DATE</string>
<string name="SET_LIVE_TRANSLATE" translatable="false">SET_LIVE_TRANSLATE</string>
<string name="SET_TRUNCATE_TOOTS_SIZE" translatable="false">SET_TRUNCATE_TOOTS_SIZE</string>
@ -2208,4 +2210,7 @@
<string name="set_display_compact_buttons_description">Buttons at the bottom of messages will not take the whole width</string>
<string name="also_followed_by">Followed by:</string>
<string name="Directory">Directory</string>
<string name="boost_original_date">Display original date for boosts</string>
<string name="set_disable_release_notes">Disable release notes</string>
<string name="set_disable_release_notes_indication">When a new version is published, you will not be alerted inside the app.</string>
</resources>

View File

@ -86,6 +86,14 @@
app:summary="@string/set_enable_crash_report_indication"
app:title="@string/set_enable_crash_report" />
<SwitchPreferenceCompat
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="@string/SET_DISABLE_RELEASE_NOTES_ALERT"
app:singleLineTitle="false"
app:summary="@string/set_disable_release_notes_indication"
app:title="@string/set_disable_release_notes" />
<androidx.preference.SeekBarPreference
android:defaultValue="110"
android:max="180"

View File

@ -25,6 +25,12 @@
app:key="@string/SET_GROUP_REBLOGS"
app:singleLineTitle="false"
app:title="@string/group_reblogs" />
<SwitchPreferenceCompat
android:defaultValue="true"
app:iconSpaceReserved="false"
app:key="@string/SET_BOOST_ORIGINAL_DATE"
app:singleLineTitle="false"
app:title="@string/boost_original_date" />
<ListPreference
android:defaultValue="default"
app:entries="@array/SET_LIVE_TRANSLATE_VALUES"

View File

@ -0,0 +1,8 @@
Added:
- Display date of the message instead of the boost (default: disabled)
- Allow to disable release notes popup in Settings
Fixed:
- Fix timelines slow down and stuttering after some scrolls
- Fix color issues with follow buttons
- Fix import from settings (import from login was OK)