mirror of
https://github.com/KokaKiwi/BarInsta
synced 2026-03-05 12:01:35 +00:00
Convert comment viewer activity to fragment and update layouts
This commit is contained in:
parent
7807fe7f59
commit
c64ae3a101
37 changed files with 952 additions and 689 deletions
10
app/src/main/res/drawable/ic_search_24.xml
Normal file
10
app/src/main/res/drawable/ic_search_24.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/>
|
||||
</vector>
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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"
|
||||
tools:context=".activities.CommentsViewer">
|
||||
|
||||
<include
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_weight="1"
|
||||
layout="@layout/layout_include_toolbar" />
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_weight="8"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvComments"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingRight="8dp"
|
||||
app:layoutManager="LinearLayoutManager"
|
||||
tools:listitem="@layout/item_comment" />
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/commentCancelParent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:paddingRight="8dp"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@android:drawable/ic_menu_revert" />
|
||||
<EditText
|
||||
android:id="@+id/commentText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2"
|
||||
android:paddingLeft="8dp"
|
||||
android:gravity="bottom"
|
||||
android:hint="@string/comment_hint"
|
||||
android:inputType="textMultiLine"
|
||||
android:maxLength="2200"
|
||||
android:maxLines="10"
|
||||
android:visibility="gone"
|
||||
android:scrollHorizontally="false" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/commentSend"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:paddingRight="8dp"
|
||||
android:visibility="gone"
|
||||
app:srcCompat="@android:drawable/ic_menu_send" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -17,6 +17,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsingToolbarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_scrollFlags="scroll|snap|enterAlways"
|
||||
|
|
|
|||
48
app/src/main/res/layout/fragment_comments.xml
Normal file
48
app/src/main/res/layout/fragment_comments.xml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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">
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/swipeRefreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvComments"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
app:layoutManager="LinearLayoutManager"
|
||||
tools:listitem="@layout/item_comment" />
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/commentField"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
android:hint="@string/comment_hint"
|
||||
app:counterEnabled="true"
|
||||
app:counterMaxLength="2200"
|
||||
app:endIconDrawable="@drawable/ic_send_24"
|
||||
app:endIconMode="custom"
|
||||
app:startIconDrawable="@drawable/ic_close_24">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/commentText"
|
||||
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" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
</LinearLayout>
|
||||
|
|
@ -15,8 +15,8 @@
|
|||
android:id="@+id/rvChildComments"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="80dp"
|
||||
android:layout_marginLeft="80dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginLeft="40dp"
|
||||
app:layoutManager="LinearLayoutManager"
|
||||
tools:itemCount="5"
|
||||
tools:listitem="@layout/item_comment_small" />
|
||||
|
|
@ -25,6 +25,8 @@
|
|||
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="#80888888" />
|
||||
android:background="#32888888" />
|
||||
</LinearLayout>
|
||||
|
|
@ -23,34 +23,35 @@
|
|||
android:paddingLeft="4dp"
|
||||
android:paddingRight="4dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id="@+id/ivProfilePic"
|
||||
android:layout_width="50dp"
|
||||
android:layout_height="50dp"
|
||||
android:gravity="center"
|
||||
app:srcCompat="@mipmap/ic_launcher" />
|
||||
app:actualImageScaleType="centerCrop"
|
||||
app:roundAsCircle="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvUsername"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1.0"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingRight="4dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textStyle="bold" />
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvUsername"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1.0"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingRight="4dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
<awais.instagrabber.customviews.RamboTextView
|
||||
|
|
@ -68,31 +69,17 @@
|
|||
android:paddingRight="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:weightSum="3.5">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvLikes"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvDate"
|
||||
android:id="@+id/tvLikes"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="2.5"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="marquee"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingLeft="4dp"
|
||||
|
|
@ -100,8 +87,24 @@
|
|||
android:paddingEnd="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:singleLine="true"
|
||||
android:textStyle="italic"
|
||||
android:gravity="right"/>
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textSize="12sp" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvDate"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_weight="2.5"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="end"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:singleLine="true"
|
||||
android:textStyle="italic" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
android:id="@+id/postImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:actualImageScaleType="fitCenter"
|
||||
app:actualImageScaleType="centerCrop"
|
||||
app:viewAspectRatio="1"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
android:id="@+id/ivProfilePic"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:actualImageScaleType="centerCrop"
|
||||
app:roundAsCircle="true" />
|
||||
|
||||
<LinearLayout
|
||||
|
|
@ -52,8 +53,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="8dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvUsername"
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:actionLayout="@layout/layout_searchview"
|
||||
android:icon="@android:drawable/ic_menu_search"
|
||||
android:icon="@drawable/ic_search_24"
|
||||
android:title="@string/action_search"
|
||||
android:titleCondensed="@string/action_search"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
<item
|
||||
android:id="@+id/action_compare"
|
||||
android:icon="@android:drawable/ic_menu_view"
|
||||
android:icon="@drawable/ic_outline_views_24"
|
||||
android:title="@string/action_compare"
|
||||
android:titleCondensed="@string/action_compare"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
<item
|
||||
android:id="@+id/action_search"
|
||||
android:actionLayout="@layout/layout_searchview"
|
||||
android:icon="@android:drawable/ic_menu_search"
|
||||
android:icon="@drawable/ic_search_24"
|
||||
android:title="@string/action_search"
|
||||
android:titleCondensed="@string/action_search"
|
||||
app:actionViewClass="androidx.appcompat.widget.SearchView"
|
||||
|
|
|
|||
65
app/src/main/res/navigation/comments_nav_graph.xml
Normal file
65
app/src/main/res/navigation/comments_nav_graph.xml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<navigation 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/comments_nav_graph"
|
||||
app:startDestination="@id/commentsViewerFragment">
|
||||
|
||||
<include app:graph="@navigation/hashtag_nav_graph" />
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_hashTagFragment"
|
||||
app:destination="@id/hashtag_nav_graph">
|
||||
<argument
|
||||
android:name="hashtag"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
</action>
|
||||
|
||||
<!--<include app:graph="@navigation/profile_nav_graph" />-->
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_profileFragment"
|
||||
app:destination="@id/profile_nav_graph">
|
||||
<argument
|
||||
android:name="username"
|
||||
app:argType="string"
|
||||
app:nullable="true" />
|
||||
</action>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/commentsViewerFragment"
|
||||
android:name="awais.instagrabber.activities.CommentsViewerFragment"
|
||||
android:label="Comments"
|
||||
tools:layout="@layout/fragment_comments">
|
||||
<argument
|
||||
android:name="shortCode"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postUserId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
</fragment>
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_commentsViewerFragment"
|
||||
app:destination="@id/commentsViewerFragment">
|
||||
<argument
|
||||
android:name="shortCode"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postUserId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
</action>
|
||||
</navigation>
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
<include app:graph="@navigation/post_view_nav_graph" />
|
||||
<include app:graph="@navigation/profile_nav_graph" />
|
||||
<include app:graph="@navigation/comments_nav_graph" />
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_postViewFragment"
|
||||
|
|
|
|||
|
|
@ -54,6 +54,25 @@
|
|||
app:argType="boolean" />
|
||||
</action>
|
||||
|
||||
<include app:graph="@navigation/comments_nav_graph" />
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_commentsViewerFragment"
|
||||
app:destination="@id/comments_nav_graph">
|
||||
<argument
|
||||
android:name="shortCode"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postUserId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
</action>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/feedFragment"
|
||||
android:name="awais.instagrabber.fragments.main.FeedFragment"
|
||||
|
|
|
|||
|
|
@ -36,6 +36,24 @@
|
|||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
</action>
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_commentsViewerFragment"
|
||||
app:destination="@id/comments_nav_graph">
|
||||
<argument
|
||||
android:name="shortCode"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
<argument
|
||||
android:name="postUserId"
|
||||
app:argType="string"
|
||||
app:nullable="false" />
|
||||
</action>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/postViewFragment"
|
||||
android:name="awais.instagrabber.fragments.PostViewFragment"
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@
|
|||
app:argType="boolean" />
|
||||
</action>
|
||||
|
||||
<include app:graph="@navigation/comments_nav_graph" />
|
||||
|
||||
<action
|
||||
android:id="@+id/action_global_profileFragment"
|
||||
app:destination="@id/profileFragment">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue