1
0
Fork 0
mirror of https://github.com/KokaKiwi/BarInsta synced 2026-03-05 12:01:35 +00:00

Add activity/notification view fragment

This commit is contained in:
Ammar Githam 2020-09-11 22:27:09 +09:00
parent 73a9e627d9
commit 37912854d0
23 changed files with 729 additions and 558 deletions

View file

@ -1,30 +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.NotificationsViewer">
<include
android:id="@+id/toolbar"
layout="@layout/layout_include_toolbar" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
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_notification" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.NotificationsViewerFragment">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvComments"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
tools:listitem="@layout/item_notification" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

199
app/src/main/res/layout/item_notification.xml Executable file → Normal file
View file

@ -1,19 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:viewBindingIgnore="true">
android:background="?android:selectableItemBackground"
android:baselineAligned="false"
android:padding="8dp">
<include
android:id="@+id/container"
layout="@layout/layout_include_notif_item" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/ivProfilePic"
android:layout_width="@dimen/notification_image_size"
android:layout_height="@dimen/notification_image_size"
android:visibility="visible"
app:actualImageScaleType="centerCrop"
app:layout_constraintEnd_toStartOf="@id/barrier"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:roundAsCircle="true"
tools:placeholderImage="@mipmap/ic_launcher" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_gravity="bottom"
android:layout_marginBottom="4dp"
android:background="#80888888" />
</LinearLayout>
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!-- android:id="@+id/multi_pic1"-->
<!-- android:layout_width="@dimen/simple_item_picture_size_exact_half"-->
<!-- android:layout_height="@dimen/simple_item_picture_size_exact_half"-->
<!-- app:actualImageScaleType="centerCrop"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintStart_toStartOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:placeholderImage="@mipmap/ic_launcher" />-->
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!-- android:id="@+id/multi_pic2"-->
<!-- android:layout_width="@dimen/simple_item_picture_size_exact_half"-->
<!-- android:layout_height="@dimen/simple_item_picture_size_exact_half"-->
<!-- app:layout_constraintBottom_toTopOf="@+id/multi_pic3"-->
<!-- app:layout_constraintEnd_toStartOf="@id/barrier"-->
<!-- app:layout_constraintStart_toEndOf="@id/multi_pic1"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:placeholderImage="@mipmap/ic_launcher" />-->
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!-- android:id="@+id/multi_pic3"-->
<!-- android:layout_width="@dimen/simple_item_picture_size_exact_half"-->
<!-- android:layout_height="@dimen/simple_item_picture_size_exact_half"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toStartOf="@id/barrier"-->
<!-- app:layout_constraintStart_toEndOf="@id/multi_pic1"-->
<!-- app:layout_constraintTop_toBottomOf="@+id/multi_pic2"-->
<!-- app:placeholderImage="@mipmap/ic_launcher" />-->
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="end"
app:constraint_referenced_ids="ivProfilePic" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvUsername"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingEnd="16dp"
android:paddingRight="16dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@id/tvComment"
app:layout_constraintEnd_toStartOf="@id/ivPreviewPic"
app:layout_constraintStart_toStartOf="@id/barrier"
app:layout_constraintTop_toTopOf="parent"
tools:text="username" />
<awais.instagrabber.customviews.RamboTextView
android:id="@+id/tvComment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:linksClickable="true"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingEnd="16dp"
android:paddingRight="16dp"
android:textAppearance="@style/TextAppearance.AppCompat"
android:textStyle="italic"
app:layout_constraintBottom_toTopOf="@id/tvSubComment"
app:layout_constraintEnd_toStartOf="@id/ivPreviewPic"
app:layout_constraintStart_toStartOf="@id/tvUsername"
app:layout_constraintTop_toBottomOf="@id/tvUsername"
tools:text="comment comment comment comment comment comment comment comment comment comment comment comment comment " />
<awais.instagrabber.customviews.RamboTextView
android:id="@+id/tvSubComment"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autoLink="web|email"
android:ellipsize="end"
android:linksClickable="true"
android:paddingStart="16dp"
android:paddingLeft="16dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
android:textAppearance="@style/TextAppearance.AppCompat"
app:layout_constraintEnd_toStartOf="@id/tvDate"
app:layout_constraintStart_toStartOf="@id/tvUsername"
app:layout_constraintTop_toBottomOf="@id/tvComment"
tools:text="sub-comment" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:gravity="end"
android:paddingStart="8dp"
android:paddingLeft="8dp"
android:paddingEnd="16dp"
android:paddingRight="16dp"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textStyle="italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/ivPreviewPic"
app:layout_constraintStart_toEndOf="@id/tvSubComment"
app:layout_constraintTop_toBottomOf="@id/tvComment"
tools:text="date" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/preview_barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="start"
app:constraint_referenced_ids="ivPreviewPic" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/ivPreviewPic"
android:layout_width="@dimen/notification_image_size"
android:layout_height="@dimen/notification_image_size"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/preview_barrier"
app:layout_constraintTop_toTopOf="parent"
tools:placeholderImage="@mipmap/ic_launcher"
tools:visibility="visible" />
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!-- android:id="@+id/preview_pic1"-->
<!-- android:layout_width="@dimen/simple_item_picture_size_exact_half"-->
<!-- android:layout_height="@dimen/simple_item_picture_size_exact_half"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toStartOf="@id/preview_pic2"-->
<!-- app:layout_constraintStart_toEndOf="@id/preview_barrier"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:placeholderImage="@mipmap/ic_launcher" />-->
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!-- android:id="@+id/preview_pic2"-->
<!-- android:layout_width="@dimen/simple_item_picture_size_exact_half"-->
<!-- android:layout_height="@dimen/simple_item_picture_size_exact_half"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toEndOf="@id/preview_pic1"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:placeholderImage="@mipmap/ic_launcher" />-->
<!--<com.facebook.drawee.view.SimpleDraweeView-->
<!-- android:id="@+id/preview_pic3"-->
<!-- android:layout_width="@dimen/simple_item_picture_size_exact_half"-->
<!-- android:layout_height="@dimen/simple_item_picture_size_exact_half"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintStart_toEndOf="@id/preview_pic1"-->
<!-- app:layout_constraintTop_toBottomOf="@id/preview_pic2"-->
<!-- app:placeholderImage="@mipmap/ic_launcher" />-->
<!--<androidx.constraintlayout.widget.Group-->
<!-- android:id="@+id/multi_pic_group"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:visibility="visible"-->
<!-- app:constraint_referenced_ids="multi_pic1, multi_pic2, multi_pic3" />-->
<!--<androidx.constraintlayout.widget.Group-->
<!-- android:id="@+id/preview_pic_group"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:visibility="gone"-->
<!-- app:constraint_referenced_ids="preview_pic1, preview_pic2, preview_pic3" />-->
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -1,152 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:selectableItemBackground"
android:orientation="horizontal"
android:paddingStart="0dp"
android:paddingLeft="0dp"
android:paddingEnd="4dp"
android:paddingRight="4dp">
<FrameLayout
android:layout_width="@dimen/simple_item_picture_size"
android:layout_height="@dimen/simple_item_picture_size"
android:gravity="center">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivProfilePic"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="@dimen/simple_item_picture_size_half" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="@dimen/simple_item_picture_size_half" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
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.Medium"
android:textColor="?android:textColorPrimary"
android:textStyle="bold" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="8dp"
android:paddingTop="4dp"
android:paddingRight="8dp">
<awais.instagrabber.customviews.RamboTextView
android:id="@+id/tvComment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:ellipsize="end"
android:linksClickable="true"
android:textStyle="italic"
android:textAppearance="@style/TextAppearance.AppCompat" />
<awais.instagrabber.customviews.RamboTextView
android:id="@+id/tvSubComment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:autoLink="web|email"
android:ellipsize="end"
android:linksClickable="true"
android:textAppearance="@style/TextAppearance.AppCompat" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tvDate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:ellipsize="marquee"
android:gravity="right"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:paddingTop="4dp"
android:paddingEnd="8dp"
android:paddingRight="8dp"
android:singleLine="true"
android:textStyle="italic" />
</LinearLayout>
<FrameLayout
android:layout_width="@dimen/simple_item_picture_size"
android:layout_height="@dimen/simple_item_picture_size"
android:gravity="center">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/ivPreviewPic"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/rightContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="match_parent" />
<LinearLayout
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="@dimen/simple_item_picture_size_half" />
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="@dimen/simple_item_picture_size_half"
android:layout_height="@dimen/simple_item_picture_size_half" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>

View file

@ -1,9 +1,39 @@
<?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/more_nav_graph"
app:startDestination="@id/morePreferencesFragment">
<include app:graph="@navigation/post_view_nav_graph" />
<include app:graph="@navigation/profile_nav_graph" />
<include app:graph="@navigation/hashtag_nav_graph" />
<include app:graph="@navigation/location_nav_graph" />
<include app:graph="@navigation/comments_nav_graph" />
<action
android:id="@+id/action_global_postViewFragment"
app:destination="@id/post_view_nav_graph">
<argument
android:name="index"
app:argType="integer" />
<argument
android:name="idOrCodeArray"
app:argType="string[]" />
<argument
android:name="isId"
app:argType="boolean" />
</action>
<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/morePreferencesFragment"
android:name="awais.instagrabber.fragments.settings.MorePreferencesFragment"
@ -14,6 +44,9 @@
<action
android:id="@+id/action_morePreferencesFragment_to_aboutFragment"
app:destination="@id/aboutFragment" />
<action
android:id="@+id/action_morePreferencesFragment_to_notificationsViewer"
app:destination="@id/notificationsViewer" />
</fragment>
<fragment
android:id="@+id/settingsPreferencesFragment"
@ -23,4 +56,9 @@
android:id="@+id/aboutFragment"
android:name="awais.instagrabber.fragments.settings.AboutFragment"
android:label="@string/action_about" />
<fragment
android:id="@+id/notificationsViewer"
android:name="awais.instagrabber.fragments.NotificationsViewerFragment"
android:label="@string/title_notifications"
tools:layout="@layout/fragment_notifications_viewer" />
</navigation>

2
app/src/main/res/values/dimens.xml Executable file → Normal file
View file

@ -15,7 +15,9 @@
<dimen name="simple_item_picture_size">80dp</dimen>
<dimen name="simple_item_picture_size_half">35dp</dimen>
<dimen name="simple_item_picture_size_exact_half">40dp</dimen>
<dimen name="notification_image_size">56dp</dimen>
<dimen name="message_item_size">@dimen/simple_item_picture_size</dimen>
<dimen name="message_item_profile_size">@dimen/feed_profile_size</dimen>
<dimen name="dm_media_img_max_height">500dp</dimen>