Made all fragments that display posts extends AbstractPostsListFragment

This commit is contained in:
Pierre HUBERT
2018-08-31 14:08:03 +02:00
parent cf763ccb18
commit ff8f791f1e
10 changed files with 404 additions and 609 deletions

View File

@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Loading progress bar -->
<ProgressBar
android:id="@+id/loading_progress"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
<!-- No posts notice -->
<TextView
android:id="@+id/no_post_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/notice_no_latest_posts"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp" />
<!-- Posts list -->
<FrameLayout
android:id="@+id/posts_list_target"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>

View File

@ -1,5 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<org.communiquons.android.comunic.client.ui.views.ScrollRecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/posts_list"
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/create_post_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/action_create_post" />
<!-- Posts form target -->
<FrameLayout
android:id="@+id/create_post_form"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout="@layout/post_create_form" />
<!-- No post notice -->
<TextView
android:id="@+id/no_post_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:text="@string/notice_no_post_yet" />
<!-- Posts target -->
<org.communiquons.android.comunic.client.ui.views.ScrollRecyclerView
android:id="@+id/posts_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/linearLayout2"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/create_post_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/action_create_post" />
<!-- Posts form target -->
<FrameLayout
android:id="@+id/create_posts_form_target"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout="@layout/post_create_form" />
<!-- No post notice -->
<TextView
android:id="@+id/no_post_notice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:text="@string/notice_no_post_user_page" />
<!-- Posts target -->
<FrameLayout
android:id="@+id/posts_list_target"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
tools:layout="@layout/fragment_postslist" />
</LinearLayout>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/linearLayout2"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/posts_list_target"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@ -265,4 +265,6 @@
<string name="err_update_conversation_message_content">Could not update conversation message content!</string>
<string name="success_update_conversation_message_content">The content of the conversation message has been successfully updated!</string>
<string name="err_get_older_posts">Could not get older posts!</string>
<string name="err_get_posts_list">Could not get the list of posts!</string>
<string name="notice_no_post_yet">There is no post to display here yet.</string>
</resources>