Sometimes a tab is just empty after switching to it, but content appears
as soon as you interact with it.
I found that setting a `offscreenPageLimit` on the `ViewPager2` makes
that issue go away.
This also has the side effect that the content of more tabs is
preloaded, which makes tab switching *feel* different, one does not see
so many loading spinners, content is just there instantly. I'm not sure
if that is desireable but I would like to try it out for a while. If it
happens to be a problem we can still move tab initialization to when it
is actually visible.
When opening the conversations tab with empty cache (i.e. after a frash
login), it would sometimes start with 6 year old messages for me, which
I find very annoying. The issue is that the loading footer is shown
first and the RecyclerView tries to keep it visible when new items are
added. This works around the issue. Note that it does not happen when
there are already some conversations in the cache.
This fixes#5001
- I added some symmetry in views where I thought it is appropriate.
- Then I added some 0 paddings in views where the warning was a false
positive.
- I also moved paddings to another view in the hierarchy in some places.
I think it makes the view more correct for the following textview to
have a start and endpadding instead of the view before that to have only
an end padding.
In the end I recreated the baseline file.
It seems that two issues that I did not work on where fixed previously
that is why not only RtlSymmetry warnings are removed from the file.
---------
Co-authored-by: Janusz Leidgens <>
I just made the dialog non-cancellable. Actually I don't know why it was
cancellable when there also is
```kotlin
dialog?.setCanceledOnTouchOutside(false)
```
Fixes#4939
regression from https://github.com/tuskyapp/Tusky/pull/4978
I'm sure this `BottomSheetCallback` business had a reason, but it works
fine without on all the devices I tried it with 🤷
[A user made me aware of the fact that we have varying spacing between
post content and the
buttons](https://mstdn.games/@Sven/114104502703573482), so I
investigated 🧐
Indeed, there were some problems:
- The trailing hashtags bar was sometimes visible, despite not showing
any content.
- The media container was visible despite showing no media
- The buttons where layed out differently when showing a conversation
This change fixes those problems and adds an additional 2dp space
between buttons and contents because without these issues the buttons
and the content are quite close otherwise.
- Fixes the background of the ComposeActivity in table mode which looked
weird since https://github.com/tuskyapp/Tusky/pull/4897
- The ComposeActivity in tablet mode will now resize when the keyboard
expands, the previously used fixed height would cause the bottom bar to
hide entered text on some devices, closes
https://github.com/tuskyapp/Tusky/issues/4973
- The bottom sheets in the compose view will now be in fully hidden
state by default, as some weirdness on some devices caused them to peek
over the bottom bar in half collapsed state. Please test @fin-w
- The bottom sheet in the image viewer will now expand a bit more in
edge-to-edge mode so it doesn't look it is deliberately obscured by the
system bar. The image also moves up a bit so it won't be covered by the
bottom sheet as much.
- The "Performing lookup…" bottom sheet won't be covered by the nav bar
anymore
Glide compares the previous load with the current load, and if they are
identical, does basically nothing. Thats what we want, because otherwise
it flickers when the requested image is not in the memory cache.
The problem is, we decode the blurhash we use as placeholder everytime.
And the BitmapDrawables we get don't have a proper equals
implementation.
So Glide is like: Aha, different placeholder, better load again ->
Flicker
I added a BlurhashDrawable with custom equals/hashCode and now the
flickering is gone.
This changes the notification channel names back to what they were pre
https://github.com/tuskyapp/Tusky/pull/4929 so users don't lose their
settings and the channels won't be duplicated. Tusky nightly users that
installed a in-between version will still have duplicate channels, they
will need to reinstall.
On my device the status info was just slighty misaligned, so I
investigated. Turns out the dp values were correct, but the
`Utils.dpToPx` method calculates with the exact density of the device,
whereas everything else uses the density buckets Android defines. And on
some devices that makes a visible difference. Did a little refactor and
now everything should always be aligned correctly.
And in `item_follow` the padding was just different from other
notification items.
```
Exception java.lang.IllegalStateException:
at androidx.fragment.app.Fragment.requireActivity (Fragment.java:1005)
at com.keylesspalace.tusky.fragment.ViewImageFragment.getPhotoActionsListener (ViewImageFragment.java:58)
at com.keylesspalace.tusky.fragment.ViewImageFragment.access$getPhotoActionsListener (ViewImageFragment.java:48)
at com.keylesspalace.tusky.fragment.ViewImageFragment$ImageRequestListener.onResourceReady$lambda$0 (ViewImageFragment.java:335)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:226)
at android.os.Looper.loop (Looper.java:313)
at android.app.ActivityThread.main (ActivityThread.java:8751)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)
```