Refactor gallery comment to adapt non-divider recyclerview

This commit is contained in:
tarsin committed 2022-07-17 15:55:58 +08:00
1 parent 452b373f62
commit 9d00e47f74
2 files changed
+44 -27

No files matched your search

@@ -13,36 +13,51 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:paddingLeft="@dimen/keyline_margin"
android:paddingTop="8dp"
android:paddingRight="@dimen/keyline_margin"
android:paddingBottom="8dp">
android:paddingTop="4dp"
android:paddingBottom="4dp">
<TextView
android:id="@+id/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackground" />
<com.google.android.material.card.MaterialCardView
style="@style/Widget.Material3.CardView.Filled"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:paddingLeft="@dimen/keyline_margin"
android:paddingTop="8dp"
android:paddingRight="@dimen/keyline_margin"
android:paddingBottom="8dp">
<com.hippo.widget.LinkifyTextView
android:id="@+id/comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/user"
android:layout_alignLeft="@id/user"
android:layout_marginTop="8.0dp"
android:ellipsize="end"
android:textColor="?android:attr/textColorPrimary" />
<TextView
android:id="@+id/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackground" />
</RelativeLayout>
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true" />
<com.hippo.widget.LinkifyTextView
android:id="@+id/comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/user"
android:layout_alignStart="@id/user"
android:layout_marginTop="8.0dp"
android:ellipsize="end"
android:textColor="?android:attr/textColorPrimary" />
</RelativeLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>
@@ -29,6 +29,8 @@
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/keyline_margin"
android:paddingRight="@dimen/keyline_margin"
android:clipToPadding="false"
app:fitsSystemWindowsInsets="bottom" />