Skip to content

Commit

Permalink
feat(StatusDisplayItem/WarningFiltered): apply inset
Browse files Browse the repository at this point in the history
  • Loading branch information
FineFindus committed Jul 25, 2024
1 parent af33c59 commit ec49575
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ public static ArrayList<StatusDisplayItem> buildItems(BaseStatusListFragment<?>
List<StatusDisplayItem> nonGapItems=gap!=null ? items.subList(0, items.size()-1) : items;
WarningFilteredStatusDisplayItem warning=applyingFilter==null ? null :
new WarningFilteredStatusDisplayItem(parentID, fragment, statusForContent, nonGapItems, applyingFilter);
if(warning!=null)
warning.inset=inset;
return applyingFilter==null ? items : new ArrayList<>(gap!=null
? List.of(warning, gap)
: Collections.singletonList(warning)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.joinmastodon.android.fragments.BaseStatusListFragment;
import org.joinmastodon.android.model.LegacyFilter;
import org.joinmastodon.android.model.Status;
import org.joinmastodon.android.ui.OutlineProviders;

import java.util.List;

Expand Down Expand Up @@ -50,6 +51,9 @@ public void onBind(WarningFilteredStatusDisplayItem item){
filteredItems=item.filteredItems;
String title=item.applyingFilter.title;
text.setText(item.parentFragment.getString(R.string.sk_filtered, title));

itemView.setClipToOutline(item.inset);
itemView.setOutlineProvider(item.inset ? OutlineProviders.roundedRect(12) : null);
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions mastodon/src/main/res/layout/display_item_warning.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
android:layout_weight="1"
android:singleLine="true"
android:ellipsize="end"
android:visibility="visible"
/>
android:visibility="visible"/>


</LinearLayout>

0 comments on commit ec49575

Please sign in to comment.