Skip to content

Commit

Permalink
Merge pull request #8055 from wordpress-mobile/issue/7996-actionable-…
Browse files Browse the repository at this point in the history
…empty-states

Issue/7996 actionable empty states (Part 1)
  • Loading branch information
0nko authored Jul 19, 2018
2 parents 14e3f8b + 6f7364c commit e01d22b
Show file tree
Hide file tree
Showing 10 changed files with 259 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
package org.wordpress.android.ui

import android.content.Context
import android.support.annotation.DrawableRes
import android.support.annotation.NonNull
import android.support.v7.widget.AppCompatButton
import android.util.AttributeSet
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import org.wordpress.android.R
import org.wordpress.android.widgets.WPTextView

/**
* View shown when screen is in an empty state. It contains the following:
* - Image showing related illustration (optional)
* - Title describing cause for empty state (required)
* - Subtitle detailing cause for empty state (optional)
* - Button providing action to take (optional)
*/
class ActionableEmptyView : LinearLayout {
lateinit var button: AppCompatButton
lateinit var image: ImageView
lateinit var subtitle: WPTextView
lateinit var title: WPTextView

constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
initView(context, attrs)
}

constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) {
initView(context, attrs)
}

private fun initView(context: Context, attrs: AttributeSet) {
val layout = View.inflate(context, R.layout.actionable_empty_view, this)

image = layout.findViewById(R.id.image)
title = layout.findViewById(R.id.title)
subtitle = layout.findViewById(R.id.subtitle)
button = layout.findViewById(R.id.button)

attrs.let {
val typedArray = context.obtainStyledAttributes(it, R.styleable.ActionableEmptyView, 0, 0)

val imageResource = typedArray.getResourceId(R.styleable.ActionableEmptyView_aevImage, 0)
val titleAttribute = typedArray.getString(R.styleable.ActionableEmptyView_aevTitle)
val subtitleAttribute = typedArray.getString(R.styleable.ActionableEmptyView_aevSubtitle)
val buttonAttribute = typedArray.getString(R.styleable.ActionableEmptyView_aevButton)

if (imageResource != 0) {
image.setImageResource(imageResource)
image.visibility = View.VISIBLE
}

if (!titleAttribute.isNullOrEmpty()) {
title.text = titleAttribute
} else {
throw RuntimeException(context.toString() + ": ActionableEmptyView must have a title (wpTitle)")
}

if (!subtitleAttribute.isNullOrEmpty()) {
subtitle.text = subtitleAttribute
subtitle.visibility = View.VISIBLE
}

if (!buttonAttribute.isNullOrEmpty()) {
button.text = buttonAttribute
button.visibility = View.VISIBLE
}

typedArray.recycle()
}
}

fun setButtonClickListener(@NonNull listener: OnClickListener) {
button.setOnClickListener(listener)
}

fun setImageResource(@NonNull @DrawableRes resId: Int) {
image.setImageResource(resId)
}

fun setSubtitleText(@NonNull charSequence: CharSequence) {
subtitle.text = charSequence
}

fun setTitleText(@NonNull charSequence: CharSequence) {
title.text = charSequence
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public void onReceive(Context context, Intent intent) {
}
};

private void showAddMediaPopup() {
public void showAddMediaPopup() {
View anchor = findViewById(R.id.menu_new_media);
PopupMenu popup = new PopupMenu(this, anchor);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
Expand All @@ -34,6 +34,7 @@
import org.wordpress.android.fluxc.store.MediaStore.MediaErrorType;
import org.wordpress.android.fluxc.store.MediaStore.OnMediaListFetched;
import org.wordpress.android.fluxc.utils.MediaUtils;
import org.wordpress.android.ui.ActionableEmptyView;
import org.wordpress.android.ui.EmptyViewMessageType;
import org.wordpress.android.ui.media.MediaGridAdapter.MediaGridAdapterCallback;
import org.wordpress.android.ui.media.services.MediaDeleteService;
Expand Down Expand Up @@ -146,7 +147,7 @@ private static MediaFilter fromMimeType(@NonNull String mimeType) {

private SwipeToRefreshHelper mSwipeToRefreshHelper;

private TextView mEmptyView;
private ActionableEmptyView mEmptyView;
private EmptyViewMessageType mEmptyViewMessageType = EmptyViewMessageType.NO_CONTENT;

private SiteModel mSite;
Expand Down Expand Up @@ -241,7 +242,14 @@ public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
}
});

mEmptyView = (TextView) view.findViewById(R.id.empty_view);
mEmptyView = (ActionableEmptyView) view.findViewById(R.id.actionable_empty_view);
mEmptyView.setButtonClickListener(new OnClickListener() {
@Override public void onClick(View view) {
if (isAdded() && getActivity() instanceof MediaBrowserActivity) {
((MediaBrowserActivity) getActivity()).showAddMediaPopup();
}
}
});
mRecycler.setEmptyView(mEmptyView);

// swipe to refresh setup
Expand Down Expand Up @@ -599,7 +607,7 @@ private void updateEmptyView(EmptyViewMessageType emptyViewMessageType) {
break;
}

mEmptyView.setText(getText(stringId));
mEmptyView.setTitleText(getText(stringId));
mEmptyView.setVisibility(View.VISIBLE);
} else {
mEmptyView.setVisibility(View.GONE);
Expand Down
28 changes: 28 additions & 0 deletions WordPress/src/main/res/drawable/img_illustration_media.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<vector
xmlns:android="http://schemas.android.com/apk/res/android"
android:height="81dp"
android:width="105dp"
android:viewportHeight="81"
android:viewportWidth="105" >

<path
android:fillColor="@color/grey_lighten_10"
android:pathData="M36.6,79L59,78.7c0,0,15-0.1,22.4-0.1l22.4-0.1l-1,1l-0.2-9.7c-0.1-3.2-0.2-6.5-0.1-9.7V40.5l0.1-39l0.9,0.9 L58.9,2.2L36.5,2L14.2,1.8l0.4-0.4l-0.1,6.9c0,0.2-0.1,0.4-0.4,0.4c-0.2,0-0.4-0.1-0.4-0.4l-0.1-6.9c0-0.2,0.1-0.4,0.4-0.4l22.4-0.1 h22.2l44.7-0.2c0.5,0,0.9,0.4,0.9,0.9l0.1,39v19.6c0,6.5,0.2,13.1,0.3,19.6c0,0.6-0.4,1-1,1l-22.4-0.1c-7.5,0-15,0-22.4-0.1 s-15-0.1-22.4-0.3L14,79.8c-0.1,0-0.1-0.1-0.2-0.2c0.1-0.1,0.3-0.1,0.4-0.1C21.6,79.2,29.1,79,36.6,79z M14.9,33.3 c0-1.2-0.1-2.4-0.4-3.6c0-0.1-0.1-0.2-0.2-0.3H14c-0.1,0.1-0.1,0.1-0.1,0.2c-0.3,1.2-0.4,2.3-0.4,3.6c-0.1,1.2-0.1,2.3-0.1,3.6 c0,0.6,0,1.2,0.1,1.8c0.1,1.7,0.1,3.5,0.3,5.2c0,0.2,0.2,0.4,0.4,0.4c0.2,0,0.4-0.1,0.4-0.4c0.2-1.7,0.4-3.3,0.3-5 c0-0.7,0-1.3,0.1-2l-0.1-1.8V33.3z" >
</path>

<path
android:fillColor="@color/grey_lighten_10"
android:pathData="M95.6,70.7H91c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4.6c0.3,0,0.5,0.2,0.5,0.5S95.8,70.7,95.6,70.7z M86.4,70.7h-4.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4.6c0.3,0,0.5,0.2,0.5,0.5S86.6,70.7,86.4,70.7z M77.2,70.7h-4.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4.6c0.3,0,0.5,0.2,0.5,0.5S77.4,70.7,77.2,70.7z M67.9,70.7h-4.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4.6c0.3,0,0.5,0.2,0.5,0.5S68.2,70.7,67.9,70.7z M58.7,70.7h-4.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4.6c0.3,0,0.5,0.2,0.5,0.5S59,70.7,58.7,70.7z M49.5,70.7h-4.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4.6c0.3,0,0.5,0.2,0.5,0.5S49.8,70.7,49.5,70.7z M40.3,70.7h-4.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,0.5-0.5h4.6c0.3,0,0.5,0.2,0.5,0.5S40.6,70.7,40.3,70.7z M31.1,70.7h-4.6c-0.3,0-0.5-0.2-0.5-0.5s0.2-0.5,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0.5,0.2-1.1,0.2-1.6-0.1c-0.2-0.2-0.2-0.6,0-0.8C20.9,17.8,21.1,17.7,21.4,17.8z M29.7,19.3c0.4,0.7,0.7,1.5,0.8,2.3c0.1,0.8,0.1,1.6,0.1,2.4c0,0.2-0.2,0.4-0.4,0.4s-0.4-0.1-0.4-0.4c0.1-1.5-0.2-3-0.9-4.2c-0.1-0.2-0.1-0.4,0.1-0.6C29.2,19,29.6,19,29.7,19.3z M34.6,23.9H38c0.1,0,0.3,0.1,0.3,0.3c0,0.1-0.1,0.3-0.2,0.3h-3.5c-0.2,0-0.4-0.1-0.4-0.4C34.3,24.1,34.4,23.9,34.6,23.9z" >
</path>

</vector>
70 changes: 70 additions & 0 deletions WordPress/src/main/res/layout/actionable_empty_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?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:gravity="center"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical" >

<android.support.v4.widget.NestedScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent" >

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center"
android:orientation="vertical" >

<ImageView
android:id="@+id/image"
android:adjustViewBounds="true"
android:contentDescription="@string/content_description_person_reading_device_notification"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_extra_large"
android:layout_marginTop="@dimen/margin_extra_large"
android:layout_width="wrap_content"
android:visibility="gone"
tools:srcCompat="@drawable/jetpack_connection_notifications"
tools:visibility="visible" >
</ImageView>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/title"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:fixWidowWords="true"
tools:text="No comments yet"
style="@style/ActionableEmptyStateTitle" >
</org.wordpress.android.widgets.WPTextView>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/subtitle"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:visibility="gone"
app:fixWidowWords="true"
tools:text="Join a conversation: comment on posts from blogs you follow"
tools:visibility="visible"
style="@style/ActionableEmptyStateSubtitle" >
</org.wordpress.android.widgets.WPTextView>

<android.support.v7.widget.AppCompatButton
android:id="@+id/button"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/margin_extra_large"
android:layout_width="wrap_content"
android:theme="@style/ActionableEmptyStateButton"
android:visibility="gone"
tools:text="Go to Reader"
tools:visibility="visible" >
</android.support.v7.widget.AppCompatButton>

</LinearLayout>

</android.support.v4.widget.NestedScrollView>

</LinearLayout>
24 changes: 9 additions & 15 deletions WordPress/src/main/res/layout/media_grid_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,15 @@
</org.wordpress.android.util.widgets.CustomSwipeRefreshLayout>
</LinearLayout>

<org.wordpress.android.widgets.WPTextView
android:id="@+id/empty_view"
style="@style/WordPress.EmptyList.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/empty_list_title_bottom_margin"
android:layout_marginLeft="@dimen/empty_list_title_side_margin"
android:layout_marginRight="@dimen/empty_list_title_side_margin"
android:gravity="center"
android:text="@string/media_empty_list"
<org.wordpress.android.ui.ActionableEmptyView
android:id="@+id/actionable_empty_view"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:visibility="gone"
app:fixWidowWords="true"
tools:visibility="visible"
android:layout_marginStart="@dimen/empty_list_title_side_margin"
android:layout_marginEnd="@dimen/empty_list_title_side_margin"/>
app:aevButton="@string/media_empty_upload_media"
app:aevImage="@drawable/img_illustration_media"
app:aevTitle="@string/media_empty_list"
tools:visibility="visible" >
</org.wordpress.android.ui.ActionableEmptyView>

</FrameLayout>
14 changes: 14 additions & 0 deletions WordPress/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,18 @@
<attr name="wpToolbarDisableScrollGestures" format="boolean"/>
</declare-styleable>

<!--
Actionable Empty View
-->
<declare-styleable name="ActionableEmptyView">
<!-- Optional: string text of button -->
<attr name="aevButton" format="string"/>
<!-- Optional: resource id of image -->
<attr name="aevImage" format="reference"/>
<!-- Optional: string text of subtitle -->
<attr name="aevSubtitle" format="string"/>
<!-- Required: string text of title -->
<attr name="aevTitle" format="string"/>
</declare-styleable>

</resources>
4 changes: 4 additions & 0 deletions WordPress/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -315,5 +315,9 @@
<dimen name="activity_log_icon_size">40dp</dimen>
<dimen name="activity_log_icon_margin">16dp</dimen>

<!-- actionable empty view -->
<dimen name="actionable_empty_view_text_margin_horizontal">30dp</dimen>
<dimen name="actionable_empty_view_text_maximum_width">440dp</dimen>

<dimen name="snackbar_message_margin_bottom">18dp</dimen>
</resources>
3 changes: 2 additions & 1 deletion WordPress/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,12 @@
<!-- Delete Media -->
<string name="cannot_delete_multi_media_items">Some media can\'t be deleted at this time. Try again later.</string>
<string name="cannot_retry_deleted_media_item">Media has been removed. Delete it from this post?</string>
<string name="media_empty_list">No media</string>
<string name="media_empty_list">You don\'t have any media</string>
<string name="media_empty_image_list">You don\'t have any images</string>
<string name="media_empty_videos_list">You don\'t have any videos</string>
<string name="media_empty_documents_list">You don\'t have any documents</string>
<string name="media_empty_audio_list">You don\'t have any audio</string>
<string name="media_empty_upload_media">Upload media</string>
<string name="delete">Delete</string>
<string name="confirm_delete_media_image">Delete this image?</string>
<string name="confirm_remove_media_image">Remove this image from the post?</string>
Expand Down
Loading

0 comments on commit e01d22b

Please sign in to comment.