Skip to content

Commit

Permalink
Minor material 3 improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelschattgen committed Mar 13, 2024
1 parent e13dca2 commit 14f7187
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,11 @@ public CompactDividerDecoration() {

@Override
public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
if (_adapter.isPositionErrorCard(parent.getChildAdapterPosition(view))) {
outRect.top = MetricsHelper.convertDpToPixels(requireContext(), 4);
return;
}

if (_adapter.isPositionFooter(parent.getChildAdapterPosition(view))) {
int pixels = MetricsHelper.convertDpToPixels(requireContext(), 20);
outRect.top = pixels;
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/res/layout/card_assign_icon_entry.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:foreground="?android:attr/selectableItemBackground"
android:layout_height="wrap_content"
android:elevation="0dp"
android:clickable="true"
android:focusable="true"
android:layout_height="wrap_content"
android:background="@drawable/rounded_background"
android:elevation="4dp"
android:orientation="vertical">
app:checkedIcon="@null"
app:cardElevation="0dp"
style="@style/Widget.Aegis.EntryCardView">

<LinearLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -89,4 +91,4 @@


</LinearLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/content_about.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
app:cardUseCompatPadding="true"
style="?attr/materialCardViewFilledStyle">
style="?attr/materialCardViewOutlinedStyle">

<LinearLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -260,7 +260,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
app:cardUseCompatPadding="true"
style="?attr/materialCardViewFilledStyle">
style="?attr/materialCardViewOutlinedStyle">

<LinearLayout
android:layout_width="match_parent"
Expand Down Expand Up @@ -434,7 +434,7 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
app:cardUseCompatPadding="true"
style="?attr/materialCardViewFilledStyle">
style="?attr/materialCardViewOutlinedStyle">

<LinearLayout
android:layout_width="match_parent"
Expand Down

0 comments on commit 14f7187

Please sign in to comment.