Commit 54867819 authored by Christophe Henry's avatar Christophe Henry

Merge branch '49' into 'develop'

Solves #49: emotionnal design

See merge request !35
parents 866f7159 e0adccb0
......@@ -74,11 +74,16 @@ class SubscriptionArticlesFragment : Fragment(), Observer<List<SubscriptionArtic
} ?: Promise.ofSuccess(Unit)
private fun toggleProgressCircle(articles: List<*>) {
fragment_subscription_article_empty_list.text = when (readStatus) {
fragment_subscription_article_empty_list_text.text = when (readStatus) {
READ -> context?.getString(R.string.empty_subscription_list, model.subscription.title)
UNREAD -> context?.getString(R.string.empty_subscription_unread_list, model.subscription.title)
}
when (readStatus) {
READ -> R.drawable.ic_undraw_blogging
UNREAD -> R.drawable.ic_undraw_all_read
}.let { fragment_subscription_article_empty_list_image.setImageResource(it) }
if (Store.refreshingPromise.value == null) {
fragment_subscription_article_recycler.visibility = if (articles.isNotEmpty()) View.VISIBLE else View.GONE
fragment_subscription_article_empty_list.visibility = if (articles.isEmpty()) View.VISIBLE else View.GONE
......
......@@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
......@@ -62,16 +63,29 @@ class SubscriptionsFragment : Fragment(), Observer<Subscriptions> {
Store.refreshingPromise.observe(this, Observer { toggleProgressCircle(model.subscriptions.value ?: listOf()) })
model.subscriptions.observe(this, this)
val contentDescription = if (category != VoidCategory)
FreshRSSApplication.getStringR(R.string.empty_subscriptions_category, category.label) else
val contentDescription = if (category != VoidCategory) {
when (section) {
ALL -> FreshRSSApplication.getStringR(R.string.empty_subscriptions_section_all)
UNREAD -> FreshRSSApplication.getStringR(R.string.empty_subscriptions_section_unread)
FAVORITES -> FreshRSSApplication.getStringR(R.string.empty_subscriptions_section_favorites)
ALL -> R.string.empty_subscriptions_section_all_category
UNREAD -> R.string.empty_subscriptions_section_unread_category
FAVORITES -> R.string.empty_subscriptions_section_favorites_category
}
} else {
when (section) {
ALL -> R.string.empty_subscriptions_section_all
UNREAD -> R.string.empty_subscriptions_section_unread
FAVORITES -> R.string.empty_subscriptions_section_favorites
}
}.let { FreshRSSApplication.getStringR(it, category.label) }
view.findViewById<TextView>(R.id.fragment_subscriptions_empty_list_text).text = contentDescription
val imageResource = when (section) {
ALL -> R.drawable.ic_undraw_empty
UNREAD -> R.drawable.ic_undraw_joyride
FAVORITES -> R.drawable.ic_undraw_loving_it
}
view.findViewById<TextView>(R.id.fragment_subscriptions_empty_list).text =
FreshRSSApplication.getStringR(R.string.empty_subscription_section_template, contentDescription)
view.findViewById<ImageView>(R.id.fragment_subscriptions_empty_list_image).setImageResource(imageResource)
view.findViewById<SwipeRefreshLayout>(R.id.subcription_pull_to_refresh)?.let {
Store.refreshingPromise.observe(this, Observer<Promise<Unit, Exception>?> { v ->
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -115,6 +115,7 @@
android:gravity="center"
android:textSize="16sp"
android:textStyle="bold"
android:lines="2"
android:layout_marginBottom="@dimen/activity_vertical_margin" />
<ProgressBar
style="?android:attr/progressBarStyleLarge"
......
......@@ -8,33 +8,53 @@
android:orientation="horizontal"
android:padding="0dp"
android:layout_margin="0dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/fragment_subscription_article_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/fragment_subscription_article"
android:visibility="visible" />
<LinearLayout
<FrameLayout
android:id="@+id/fragment_subscription_article_waiting"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<fragment
android:id="@+id/fragment_subscription_article_waiting_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="fr.chenry.android.freshrss.components.waiting.WaitingFragment"
android:layout_margin="0dp" />
</LinearLayout>
<TextView
</FrameLayout>
<LinearLayout
android:id="@+id/fragment_subscription_article_empty_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/empty_subscription_list"
android:visibility="gone"
android:gravity="center|center_horizontal|center_vertical"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_gravity="center"
android:textColor="@color/light_grey"
android:textSize="24sp"
android:textStyle="bold" />
android:visibility="gone">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/fragment_subscription_article_empty_list_image"
android:layout_width="wrap_content"
android:layout_height="140dp"
android:src="@drawable/ic_undraw_blogging"
android:layout_marginBottom="@dimen/activity_horizontal_margin" />
<TextView
android:id="@+id/fragment_subscription_article_empty_list_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/empty_subscriptions_section_unread"
android:gravity="center|center_horizontal|center_vertical"
android:layout_gravity="center"
android:textColor="@color/light_grey"
android:textSize="24sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -3,20 +3,26 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:gravity="center"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".components.subscriptions.SubscriptionsFragment">
<FrameLayout
android:id="@+id/fragment_subscriptions_list_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:visibility="gone">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/subcription_pull_to_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/fragment_subscriptions_list"
android:layout_width="match_parent"
......@@ -25,32 +31,51 @@
tools:listitem="@layout/fragment_subscription" />
</FrameLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<include layout="@layout/fast_scroller" />
</FrameLayout>
<LinearLayout
<FrameLayout
android:id="@+id/fragment_subscriptions_waiting"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<fragment
android:id="@+id/fragment_subscriptions_waiting_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="fr.chenry.android.freshrss.components.waiting.WaitingFragment"
android:layout_margin="0dp" />
</LinearLayout>
<TextView
</FrameLayout>
<LinearLayout
android:id="@+id/fragment_subscriptions_empty_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/subscription_section_h_padding"
android:text="@string/empty_subscription_section_template"
android:visibility="gone"
android:gravity="center"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="@color/light_grey"
android:textSize="24sp"
android:textStyle="bold"
android:maxLines="3"
android:ellipsize="end" />
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/fragment_subscriptions_empty_list_image"
android:layout_width="wrap_content"
android:layout_height="140dp"
android:src="@drawable/ic_undraw_blogging"
android:layout_marginBottom="@dimen/activity_horizontal_margin" />
<TextView
android:id="@+id/fragment_subscriptions_empty_list_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/subscription_section_h_padding"
android:text="@string/empty_subscriptions_section_unread"
android:gravity="center"
android:layout_gravity="center"
android:textColor="@color/light_grey"
android:textSize="24sp"
android:textStyle="bold"
android:ellipsize="end" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -12,7 +12,7 @@
<string name="prompt_instance">Your FreshRSS instance</string>
<string name="error_instance">This url is not correct</string>
<string name="instance_exemple">your-instance.com</string>
<string name="login_progress_text">Login to instance %s</string>
<string name="login_progress_text">Login to instance\n%s</string>
<!-- Subscriptions activity menu -->
<string name="title_favorites">Favorites</string>
<string name="title_all">All</string>
......@@ -38,12 +38,13 @@
<string name="unread">unread</string>
<string name="request_already_ongoing">A request is already ongoing. Please retry later.</string>
<string name="unable_to">Sorry, the application failed to %s</string>
<string name="empty_subscription_section_template">You have no %s yet</string>
<string name="empty_subscriptions_section_favorites">favorites</string>
<string name="empty_subscriptions_section_all">subscriptions</string>
<string name="empty_subscriptions_section_unread">unread articles</string>
<string name="empty_subscriptions_category">subscription in %s category</string>
<string name="empty_subscription_list">There is no articles on %s feed yes</string>
<string name="empty_subscriptions_section_favorites">You have no favorite yet.\nWhy don\'t you add one?</string>
<string name="empty_subscriptions_section_favorites_category">You have no favorite in %s category.\nWhy don\'t you add one?</string>
<string name="empty_subscriptions_section_all">It\'s quite empty here.\nWhy don\'t find a subscription to get something to read?</string>
<string name="empty_subscriptions_section_all_category">You have no subscription in %s category.\nWhy don\'t you add one?</string>
<string name="empty_subscriptions_section_unread">Yaye! You have read everything here.\nWhy don\'t go in a library to read a book?</string>
<string name="empty_subscriptions_section_unread_category">Yaye! You have read everything in %s category.\nWhy don\'t go in a library to read a book?</string>
<string name="empty_subscription_list">There is no articles on %s feed yet.\nNew articles will probably be published soon.</string>
<string name="empty_subscription_unread_list">You have read every article on %s feed!</string>
<string name="human_time_grouping_today">Today</string>
<string name="human_time_grouping_yesterday">Yesterday</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment