Release 3.14.6

This commit is contained in:
Thomas 2023-01-16 18:13:09 +01:00
parent a1f97d7cfa
commit f8641a953a
4 changed files with 32 additions and 25 deletions

View file

@ -13,8 +13,8 @@ android {
defaultConfig {
minSdk 21
targetSdk 33
versionCode 467
versionName "3.14.5"
versionCode 468
versionName "3.14.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
flavorDimensions "default"

View file

@ -1,4 +1,9 @@
[
{
"version": "3.14.6",
"code": "468",
"note": "Added:\n- Maths support (view and compose)\n\nChanged:\n- Hide single media with preview is now a setting (default: disabled)"
},
{
"version": "3.14.5",
"code": "467",

View file

@ -48,6 +48,7 @@ import android.os.Looper;
import android.text.Html;
import android.text.SpannableString;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@ -659,31 +660,35 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
if (status.mathsShown) {
holder.binding.statusContentMaths.setVisibility(View.VISIBLE);
holder.binding.statusContent.setVisibility(View.GONE);
holder.binding.statusContentMaths.removeAllViews();
MathJaxConfig mathJaxConfig = new MathJaxConfig();
switch (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) {
case Configuration.UI_MODE_NIGHT_YES:
mathJaxConfig.setTextColor("white");
break;
case Configuration.UI_MODE_NIGHT_NO:
mathJaxConfig.setTextColor("black");
break;
}
mathJaxConfig.setAutomaticLinebreaks(true);
MathJaxView mathview = new MathJaxView(context, mathJaxConfig);
holder.binding.statusContentMaths.addView(mathview);
if (status.contentSpan != null) {
mathview.setInputText(status.contentSpan.toString());
} else {
status.mathsShown = false;
holder.binding.statusContentMaths.setVisibility(View.GONE);
holder.binding.statusContent.setVisibility(View.VISIBLE);
}
} else {
holder.binding.statusContentMaths.setVisibility(View.GONE);
holder.binding.statusContent.setVisibility(View.VISIBLE);
}
holder.binding.actionButtonMaths.setOnClickListener(v -> {
if (status.mathsShown) {
status.mathsShown = false;
} else {
holder.binding.statusContentMaths.removeAllViews();
MathJaxConfig mathJaxConfig = new MathJaxConfig();
switch (context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) {
case Configuration.UI_MODE_NIGHT_YES:
mathJaxConfig.setTextColor("white");
break;
case Configuration.UI_MODE_NIGHT_NO:
mathJaxConfig.setTextColor("black");
break;
}
mathJaxConfig.setAutomaticLinebreaks(true);
status.mathsShown = true;
MathJaxView mathview = new MathJaxView(context, mathJaxConfig);
holder.binding.statusContentMaths.addView(mathview);
mathview.setInputText(status.contentSpan.toString());
}
status.mathsShown = !status.mathsShown;
Log.v(Helper.TAG, "notifyItemChanged: " + holder.getBindingAdapterPosition());
adapter.notifyItemChanged(holder.getBindingAdapterPosition());
});
holder.binding.actionButtonFavorite.setActiveImage(R.drawable.ic_round_star_24);

View file

@ -2,7 +2,4 @@ Added:
- Maths support (view and compose)
Changed:
- Hide single media with preview is now a setting (default: disabled)
Fixed:
-
- Hide single media with preview is now a setting (default: disabled)