Remove sad panda
This commit is contained in:
1 parent
81c22811d6
commit
f3b42f0070
7 files changed
+55
-126
No files matched your search
@@ -19,6 +19,7 @@ package com.hippo.ehviewer.ui.scene;
|
||||
import android.animation.Animator;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
@@ -53,6 +54,7 @@ import com.hippo.scene.StageActivity;
|
||||
import com.hippo.text.Html;
|
||||
import com.hippo.text.URLImageGetter;
|
||||
import com.hippo.util.ActivityHelper;
|
||||
import com.hippo.util.DrawableManager;
|
||||
import com.hippo.util.ReadableTime;
|
||||
import com.hippo.util.TextUrl;
|
||||
import com.hippo.view.ViewTransition;
|
||||
@@ -60,6 +62,7 @@ import com.hippo.widget.LinkifyTextView;
|
||||
import com.hippo.yorozuya.AnimationUtils;
|
||||
import com.hippo.yorozuya.LayoutUtils;
|
||||
import com.hippo.yorozuya.SimpleAnimatorListener;
|
||||
import com.hippo.yorozuya.ViewUtils;
|
||||
|
||||
public final class GalleryCommentsScene extends ToolbarScene
|
||||
implements EasyRecyclerView.OnItemClickListener,
|
||||
@@ -134,11 +137,15 @@ public final class GalleryCommentsScene extends ToolbarScene
|
||||
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.scene_gallery_comments, container, false);
|
||||
EasyRecyclerView recyclerView = (EasyRecyclerView) view.findViewById(R.id.recycler_view);
|
||||
View tip = view.findViewById(R.id.tip);
|
||||
mEditPanel = view.findViewById(R.id.edit_panel);
|
||||
mSendImage = (ImageView) mEditPanel.findViewById(R.id.send);
|
||||
mEditText = (EditText) mEditPanel.findViewById(R.id.edit_text);
|
||||
mFab = (FloatingActionButton) view.findViewById(R.id.fab);
|
||||
TextView tip = (TextView) ViewUtils.$$(view, R.id.tip);
|
||||
mEditPanel = ViewUtils.$$(view, R.id.edit_panel);
|
||||
mSendImage = (ImageView) ViewUtils.$$(mEditPanel, R.id.send);
|
||||
mEditText = (EditText) ViewUtils.$$(mEditPanel, R.id.edit_text);
|
||||
mFab = (FloatingActionButton) ViewUtils.$$(view, R.id.fab);
|
||||
|
||||
Drawable drawable = DrawableManager.getDrawable(getContext(), R.drawable.big_weird_face);
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
tip.setCompoundDrawables(null, drawable, null, null);
|
||||
|
||||
mAdapter = new CommentAdapter();
|
||||
recyclerView.setAdapter(mAdapter);
|
||||
|
||||
@@ -74,7 +74,6 @@ import com.hippo.ehviewer.client.parser.RateGalleryParser;
|
||||
import com.hippo.ehviewer.dao.DownloadInfo;
|
||||
import com.hippo.ehviewer.ui.CommonOperations;
|
||||
import com.hippo.ehviewer.ui.GalleryActivity;
|
||||
import com.hippo.ehviewer.ui.annotation.ViewLifeCircle;
|
||||
import com.hippo.ehviewer.ui.annotation.WholeLifeCircle;
|
||||
import com.hippo.rippleold.RippleSalon;
|
||||
import com.hippo.scene.Announcer;
|
||||
@@ -131,19 +130,13 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
private static final String KEY_GALLERY_DETAIL = "gallery_detail";
|
||||
private static final String KEY_REQUEST_ID = "request_id";
|
||||
|
||||
@Nullable
|
||||
@ViewLifeCircle
|
||||
private ViewGroup mFailedView;
|
||||
@Nullable
|
||||
@ViewLifeCircle
|
||||
private TextView mFailedText;
|
||||
@Nullable
|
||||
@ViewLifeCircle
|
||||
private ViewTransition mViewTransition;
|
||||
|
||||
/*---------------
|
||||
View life cycle
|
||||
---------------*/
|
||||
@Nullable
|
||||
private TextView mTip;
|
||||
@Nullable
|
||||
private ViewTransition mViewTransition;
|
||||
// Header
|
||||
@Nullable
|
||||
private View mHeader;
|
||||
@@ -400,10 +393,13 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
ViewGroup main = (ViewGroup) ViewUtils.$$(view, R.id.main);
|
||||
View mainView = ViewUtils.$$(main, R.id.scroll_view);
|
||||
View progressView = ViewUtils.$$(main, R.id.progress_view);
|
||||
mFailedView = (ViewGroup) ViewUtils.$$(main, R.id.tip);
|
||||
mFailedText = (TextView) ViewUtils.$$(mFailedView, R.id.tip_text);
|
||||
mFailedView.setOnClickListener(this);
|
||||
mViewTransition = new ViewTransition(mainView, progressView, mFailedView);
|
||||
mTip = (TextView) ViewUtils.$$(main, R.id.tip);
|
||||
mViewTransition = new ViewTransition(mainView, progressView, mTip);
|
||||
|
||||
Drawable drawable = DrawableManager.getDrawable(getContext(), R.drawable.big_weird_face);
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
mTip.setCompoundDrawables(null, drawable, null, null);
|
||||
mTip.setOnClickListener(this);
|
||||
|
||||
mHeader = ViewUtils.$$(mainView, R.id.header);
|
||||
mColorBg = ViewUtils.$$(mHeader, R.id.color_bg);
|
||||
@@ -487,7 +483,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
adjustViewVisibility(STATE_REFRESH, false);
|
||||
}
|
||||
} else {
|
||||
mFailedText.setText(R.string.error_cannot_find_gallery);
|
||||
mTip.setText(R.string.error_cannot_find_gallery);
|
||||
adjustViewVisibility(STATE_FAILED, false);
|
||||
}
|
||||
|
||||
@@ -507,8 +503,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
|
||||
EhApplication.getDownloadManager(getContext()).removeDownloadInfoListener(this);
|
||||
|
||||
mFailedView = null;
|
||||
mFailedText = null;
|
||||
mTip = null;
|
||||
mViewTransition = null;
|
||||
|
||||
mHeader = null;
|
||||
@@ -962,7 +957,7 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mFailedView == v) {
|
||||
if (mTip == v) {
|
||||
if (request()) {
|
||||
adjustViewVisibility(STATE_REFRESH, true);
|
||||
}
|
||||
@@ -1270,8 +1265,8 @@ public class GalleryDetailScene extends BaseScene implements View.OnClickListene
|
||||
e.printStackTrace();
|
||||
if (isViewCreated()) {
|
||||
String error = ExceptionUtils.getReadableString(getContext(), e);
|
||||
if (mFailedText != null) {
|
||||
mFailedText.setText(error);
|
||||
if (mTip != null) {
|
||||
mTip.setText(error);
|
||||
adjustViewVisibility(STATE_FAILED, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.hippo.ehviewer.ui.scene;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
@@ -32,6 +33,7 @@ import com.hippo.ehviewer.client.EhRequest;
|
||||
import com.hippo.scene.Announcer;
|
||||
import com.hippo.scene.SceneFragment;
|
||||
import com.hippo.scene.StageActivity;
|
||||
import com.hippo.util.DrawableManager;
|
||||
import com.hippo.util.ExceptionUtils;
|
||||
import com.hippo.view.ViewTransition;
|
||||
|
||||
@@ -59,8 +61,7 @@ public final class ProgressScene extends BaseScene implements View.OnClickListen
|
||||
private String mPToken;
|
||||
private int mPage;
|
||||
|
||||
private View mTip;
|
||||
private TextView mTipText;
|
||||
private TextView mTip;
|
||||
private ViewTransition mViewTransition;
|
||||
|
||||
@Override
|
||||
@@ -155,11 +156,13 @@ public final class ProgressScene extends BaseScene implements View.OnClickListen
|
||||
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.scene_progress, container, false);
|
||||
View progress = view.findViewById(R.id.progress);
|
||||
mTip = view.findViewById(R.id.tip);
|
||||
mTipText = (TextView) mTip.findViewById(R.id.tip_text);
|
||||
mTip = (TextView) view.findViewById(R.id.tip);
|
||||
|
||||
Drawable drawable = DrawableManager.getDrawable(getContext(), R.drawable.big_weird_face);
|
||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
||||
mTip.setCompoundDrawables(null, drawable, null, null);
|
||||
mTip.setOnClickListener(this);
|
||||
mTipText.setText(mError);
|
||||
mTip.setText(mError);
|
||||
|
||||
mViewTransition = new ViewTransition(progress, mTip);
|
||||
|
||||
@@ -200,7 +203,7 @@ public final class ProgressScene extends BaseScene implements View.OnClickListen
|
||||
if (isViewCreated()) {
|
||||
// Show tip
|
||||
mViewTransition.showView(1);
|
||||
mTipText.setText(mError);
|
||||
mTip.setText(mError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user