1
0
Fork 0
mirror of https://github.com/KokaKiwi/BarInsta synced 2026-03-14 08:21:35 +00:00

Improve comments viewer ui and ux. Update ui for likes viewer and follows viewer.

This commit is contained in:
Ammar Githam 2021-05-02 18:16:25 +09:00
parent 18292ead4e
commit 074ee18c9d
45 changed files with 2147 additions and 1554 deletions

View file

@ -1,49 +1,74 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:background="?colorSurface">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/replies_container_view"
android:layout_width="0dp"
android:layout_height="0dp"
android:elevation="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toTopOf="@id/swipe_refresh_layout"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:id="@+id/swipe_refresh_layout"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1">
app:layout_constraintBottom_toTopOf="@id/comment_field"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/toolbar">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvComments"
android:id="@+id/comments"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
tools:listitem="@layout/item_comment" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<!--app:startIconDrawable="@drawable/ic_close_24"-->
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/commentField"
android:layout_width="match_parent"
android:id="@+id/comment_field"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:hint="@string/comment_hint"
android:visibility="gone"
app:counterEnabled="true"
app:counterEnabled="false"
app:counterMaxLength="2200"
app:endIconDrawable="@drawable/ic_round_send_24"
app:endIconMode="custom"
app:startIconDrawable="@drawable/ic_close_24"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swipe_refresh_layout"
tools:visibility="visible">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/commentText"
android:id="@+id/comment_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autofillHints="no"
android:inputType="textMultiLine"
android:maxLength="2200"
android:maxLines="10"
android:scrollHorizontally="false"
tools:text="test" />
</com.google.android.material.textfield.TextInputLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -16,6 +15,7 @@
android:id="@+id/rvLikes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false" />
android:clipToPadding="false"
tools:listitem="@layout/item_follow" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.appcompat.widget.LinearLayoutCompat>

View file

@ -5,125 +5,135 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:selectableItemBackground"
android:clickable="true"
android:descendantFocusability="afterDescendants"
android:focusable="true"
android:orientation="horizontal"
android:padding="8dp">
android:foreground="?selectableItemBackground"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="4dp">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/ivProfilePic"
android:layout_width="@dimen/simple_item_picture_size"
android:layout_height="@dimen/simple_item_picture_size"
android:padding="4dp"
app:actualImageScaleType="centerCrop"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:roundAsCircle="true"
tools:background="@mipmap/ic_launcher" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvUsername"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?android:textColorPrimary"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/tvComment"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toTopOf="parent"
tools:text="username" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/isVerified"
<androidx.constraintlayout.widget.Guideline
android:id="@+id/profile_pic_guideline"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="fitStart"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tvUsername"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvUsername"
app:layout_constraintTop_toTopOf="@id/tvUsername"
app:srcCompat="@drawable/verified"
tools:visibility="visible" />
android:orientation="vertical"
app:layout_constraintGuide_begin="56dp" />
<awais.instagrabber.customviews.RamboTextViewV2
android:id="@+id/tvComment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autoLink="web|email"
android:ellipsize="end"
android:linksClickable="true"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:textAppearance="@style/TextAppearance.AppCompat"
app:layout_constraintBottom_toTopOf="@id/tvLikes"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toBottomOf="@id/tvUsername"
tools:text="comment comment comment comment comment comment comment comment comment comment comment comment
comment comment comment comment comment comment comment comment comment comment comment comment comment comment comment comment" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvLikes"
<awais.instagrabber.customviews.ProfilePicView
android:id="@+id/profile_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:scrollbars="none"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tvDate"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toBottomOf="@id/tvComment"
tools:text="likes" />
android:layout_marginEnd="16dp"
app:actualImageScaleType="centerCrop"
app:layout_constraintEnd_toStartOf="@id/profile_pic_guideline"
app:layout_constraintHorizontal_bias="1"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintTop_toTopOf="parent"
app:size="small" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvDate"
<awais.instagrabber.customviews.UsernameTextView
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:gravity="end"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textStyle="italic"
app:layout_constraintBaseline_toBaselineOf="@id/tvLikes"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
android:textColor="?android:textColorPrimary"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/date"
app:layout_constraintEnd_toStartOf="@id/options"
app:layout_constraintStart_toEndOf="@id/profile_pic_guideline"
app:layout_constraintTop_toTopOf="parent"
tools:text="username username username" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/options"
android:layout_width="32dp"
android:layout_height="32dp"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:focusable="true"
android:padding="4dp"
android:scaleType="fitCenter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_more_vert_24" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/date"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:alpha="0.8"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
app:layout_constraintBottom_toTopOf="@id/comment"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/username"
app:layout_constraintTop_toBottomOf="@id/username"
tools:text="long date..................." />
<awais.instagrabber.customviews.RamboTextViewV2
android:id="@+id/comment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2"
app:layout_constraintBottom_toTopOf="@id/comment_barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/username"
app:layout_constraintTop_toBottomOf="@id/date"
tools:text="comment comment comment comment comment comment comment comment comment comment comment comment" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/comment_barrier"
android:layout_width="0dp"
android:layout_height="0dp"
app:barrierDirection="bottom" />
<awais.instagrabber.customviews.TextViewDrawableSize
android:id="@+id/likes"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:layout_marginEnd="16dp"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:drawablePadding="4dp"
android:focusable="true"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2"
app:compoundDrawableHeight="16dp"
app:compoundDrawableWidth="16dp"
app:drawableTint="@color/red_800"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/replies"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="@id/comment"
app:layout_constraintTop_toBottomOf="@id/comment_barrier"
tools:text="99999" />
<awais.instagrabber.customviews.TextViewDrawableSize
android:id="@+id/replies"
android:layout_width="wrap_content"
android:layout_height="32dp"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:drawablePadding="4dp"
android:focusable="true"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2"
app:compoundDrawableHeight="16dp"
app:compoundDrawableWidth="16dp"
app:drawableStartCompat="@drawable/ic_round_mode_comment_24"
app:drawableTint="@color/grey_500"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvLikes"
app:layout_constraintTop_toBottomOf="@id/tvComment"
tools:text="long date................................" />
</androidx.constraintlayout.widget.ConstraintLayout>
<!--<androidx.recyclerview.widget.RecyclerView-->
<!-- android:id="@+id/rvChildComments"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginStart="40dp"-->
<!-- android:layout_marginLeft="40dp"-->
<!-- app:layoutManager="LinearLayoutManager"-->
<!-- tools:itemCount="5"-->
<!-- tools:listitem="@layout/item_comment_small" />-->
<!--<View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="1dp"-->
<!-- android:layout_gravity="bottom"-->
<!-- android:layout_marginStart="4dp"-->
<!-- android:layout_marginEnd="4dp"-->
<!-- android:layout_marginBottom="4dp"-->
<!-- android:background="#32888888" />-->
app:layout_constraintStart_toEndOf="@id/likes"
app:layout_constraintTop_toBottomOf="@id/comment_barrier"
tools:text="9999" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,109 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="40dp"
android:paddingTop="8dp"
android:paddingEnd="8dp"
android:paddingBottom="2dp">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/ivProfilePic"
android:layout_width="50dp"
android:layout_height="50dp"
app:actualImageScaleType="centerCrop"
app:layout_constraintEnd_toStartOf="@id/tvUsername"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:roundAsCircle="true"
tools:background="@mipmap/ic_launcher" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvUsername"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textColor="?android:textColorPrimary"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/tvComment"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toTopOf="parent"
tools:text="username" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/isVerified"
android:layout_width="0dp"
android:layout_height="0dp"
android:scaleType="fitStart"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tvUsername"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvUsername"
app:layout_constraintTop_toTopOf="@id/tvUsername"
app:srcCompat="@drawable/verified"
tools:visibility="visible" />
<awais.instagrabber.customviews.RamboTextViewV2
android:id="@+id/tvComment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:autoLink="web|email"
android:clickable="true"
android:ellipsize="end"
android:focusable="true"
android:linksClickable="true"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:textAppearance="@style/TextAppearance.AppCompat"
app:layout_constraintBottom_toTopOf="@id/tvLikes"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toBottomOf="@id/tvUsername"
tools:text="comment comment comment comment comment comment comment comment
comment comment comment comment comment comment comment comment comment comment comment comment comment comment
comment comment comment comment comment comment " />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvLikes"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:scrollbars="none"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tvDate"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toBottomOf="@id/tvComment"
tools:text="likes" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvDate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="end"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textStyle="italic"
app:layout_constraintBaseline_toBaselineOf="@id/tvLikes"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvLikes"
app:layout_constraintTop_toBottomOf="@id/tvComment"
tools:text="date....." />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,51 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?android:selectableItemBackground"
android:padding="8dp">
android:background="?android:selectableItemBackground"
android:padding="16dp">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/ivProfilePic"
android:layout_width="60dp"
android:layout_height="60dp"
android:adjustViewBounds="true"
android:scaleType="fitCenter" />
<awais.instagrabber.customviews.ProfilePicView
android:id="@+id/profile_pic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/username"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:size="small" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginStart="66dp"
android:layout_marginEnd="26dp"
android:orientation="vertical">
<awais.instagrabber.customviews.UsernameTextView
android:id="@+id/username"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle1"
app:layout_constraintBottom_toTopOf="@id/full_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/profile_pic"
app:layout_constraintTop_toTopOf="parent"
tools:text="username" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvFullName"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
app:autoSizeMaxTextSize="28sp"
app:autoSizeMinTextSize="16sp"
app:autoSizeTextType="uniform" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvUsername"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/isAdmin"
android:layout_width="20dp"
android:layout_height="60dp"
android:layout_gravity="end"
android:scaleType="fitCenter"
android:visibility="gone"
app:srcCompat="@drawable/ic_star_24" />
</FrameLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/full_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/username"
app:layout_constraintTop_toBottomOf="@id/username"
tools:text="Full Name" />
</androidx.constraintlayout.widget.ConstraintLayout>