GithubHelp home page GithubHelp logo

Comments (10)

grishka avatar grishka commented on June 6, 2024 1

The problem was actually related to screen rotation and the changing size of the list caused by that.

from mastodon-android.

grishka avatar grishka commented on June 6, 2024

These inset images are such a pain tbh

I can't reproduce this tho.

from mastodon-android.

brawaru avatar brawaru commented on June 6, 2024

Have you tried with that exact image? Also, I wonder if it matters that it's a reply.

from mastodon-android.

grishka avatar grishka commented on June 6, 2024

¯\_(ツ)_/¯
Screenshot_20220419-183534
(pixel 4a, stock android 11)

from mastodon-android.

brawaru avatar brawaru commented on June 6, 2024

Also, I wonder if it matters that it's a reply.

?

from mastodon-android.

grishka avatar grishka commented on June 6, 2024

Nope, just tested that

from mastodon-android.

brawaru avatar brawaru commented on June 6, 2024

Makes me wonder. What happens if it is a reply and has new lines in the post (like I have two mentions separated by new line)?

from mastodon-android.

realpixelcode avatar realpixelcode commented on June 6, 2024

Though, I think images shouldn't be displayed in the notifications because they take up so much space that shouldn't be wasted just for the information that someone has favourited or boosted your toot. If you still want to see the entire toot, you can just open it separately by clicking on it.

Maybe, also the text of toots in the notifications could be collapsed 🤔

from mastodon-android.

grishka avatar grishka commented on June 6, 2024

Makes me wonder. What happens if it is a reply and has new lines in the post (like I have two mentions separated by new line)?

These things shouldn't influence each other. Posts (and notifications) are rendered as a series of "display items", as I call them. A block of text is a display item, each image is a display item, and the "in reply to", you'll never guess, is also a display item. This is how the scrolling is so smooth. The list uses a GridLayoutManager, but all items except images and videos occupy all spans. So no, separate items shouldn't be able to affect each other.

The insets for notifications are done with this code I'm really not proud of:

public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state){
RecyclerView.ViewHolder holder=parent.getChildViewHolder(view);
if(holder instanceof StatusDisplayItem.Holder<?> sdi){
boolean inset=sdi.getItem().inset;
int pos=holder.getAbsoluteAdapterPosition();
if(inset){
boolean topSiblingInset=pos>0 && displayItems.get(pos-1).inset;
boolean bottomSiblingInset=pos<displayItems.size()-1 && displayItems.get(pos+1).inset;
int pad;
if(holder instanceof ImageStatusDisplayItem.Holder || holder instanceof LinkCardStatusDisplayItem.Holder)
pad=V.dp(16);
else
pad=V.dp(12);
boolean insetLeft=true, insetRight=true;
if(holder instanceof ImageStatusDisplayItem.Holder<?> img){
PhotoLayoutHelper.TiledLayoutResult layout=img.getItem().tiledLayout;
PhotoLayoutHelper.TiledLayoutResult.Tile tile=img.getItem().thisTile;
// only inset those items that are on the edges of the layout
insetLeft=tile.startCol==0;
insetRight=tile.startCol+tile.colSpan==layout.columnSizes.length;
// inset all items in the bottom row
if(tile.startRow+tile.rowSpan==layout.rowSizes.length)
bottomSiblingInset=false;
}
if(insetLeft)
outRect.left=pad;
if(insetRight)
outRect.right=pad;
if(!topSiblingInset)
outRect.top=pad;
if(!bottomSiblingInset)
outRect.bottom=pad;
}
}
}

from mastodon-android.

sk22 avatar sk22 commented on June 6, 2024

Do you still have this issue as well, @brawaru? Because I unfortunately do…

from mastodon-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.