From 3523503d08c3280cf05159536c830666fd484449 Mon Sep 17 00:00:00 2001 From: seven332 Date: Sun, 2 Aug 2015 11:38:30 +0800 Subject: [PATCH] Use ProgressView instance of ProgressBar, remove useless stuff --- .../hippo/ehviewer/gallery/ui/GLRootView.java | 3 +- .../ehviewer/ui/scene/GalleryDetailScene.java | 6 +-- .../hippo/ehviewer/widget/ContentLayout.java | 12 ++--- .../hippo/ehviewer/widget/PreviewLayout.java | 6 +-- .../anim/progress_indeterminate_material.xml | 46 ---------------- ...ogress_indeterminate_rotation_material.xml | 24 --------- .../main/res/anim/trim_end_interpolator.xml | 18 ------- .../main/res/anim/trim_start_interpolator.xml | 18 ------- .../res/drawable/progress_large_material.xml | 29 ----------- .../res/drawable/progress_medium_material.xml | 29 ----------- .../res/drawable/progress_small_material.xml | 29 ----------- .../vector_drawable_progress_bar_large.xml | 45 ---------------- .../vector_drawable_progress_bar_medium.xml | 45 ---------------- .../vector_drawable_progress_bar_small.xml | 45 ---------------- .../main/res/layout-land/activity_start.xml | 46 ---------------- app/src/main/res/layout/activity_start.xml | 46 ---------------- app/src/main/res/layout/item_gallery.xml | 52 ------------------- app/src/main/res/layout/scene_gallery.xml | 28 ---------- .../main/res/layout/scene_gallery_detail.xml | 6 +-- .../main/res/layout/widget_content_layout.xml | 4 +- .../layout/widget_float_label_edit_text.xml | 21 -------- .../main/res/layout/widget_preview_layout.xml | 4 +- app/src/main/res/raw/file_image.svg | 5 -- app/src/main/res/raw/file_image_off.svg | 8 --- app/src/main/res/values-v21/styles.xml | 30 ----------- app/src/main/res/values/styles.xml | 12 ----- 26 files changed, 20 insertions(+), 597 deletions(-) delete mode 100644 app/src/main/res/anim/progress_indeterminate_material.xml delete mode 100644 app/src/main/res/anim/progress_indeterminate_rotation_material.xml delete mode 100644 app/src/main/res/anim/trim_end_interpolator.xml delete mode 100644 app/src/main/res/anim/trim_start_interpolator.xml delete mode 100644 app/src/main/res/drawable/progress_large_material.xml delete mode 100644 app/src/main/res/drawable/progress_medium_material.xml delete mode 100644 app/src/main/res/drawable/progress_small_material.xml delete mode 100644 app/src/main/res/drawable/vector_drawable_progress_bar_large.xml delete mode 100644 app/src/main/res/drawable/vector_drawable_progress_bar_medium.xml delete mode 100644 app/src/main/res/drawable/vector_drawable_progress_bar_small.xml delete mode 100644 app/src/main/res/layout-land/activity_start.xml delete mode 100644 app/src/main/res/layout/activity_start.xml delete mode 100644 app/src/main/res/layout/item_gallery.xml delete mode 100644 app/src/main/res/layout/scene_gallery.xml delete mode 100644 app/src/main/res/layout/widget_float_label_edit_text.xml delete mode 100644 app/src/main/res/raw/file_image.svg delete mode 100644 app/src/main/res/raw/file_image_off.svg delete mode 100644 app/src/main/res/values-v21/styles.xml diff --git a/app/src/main/java/com/hippo/ehviewer/gallery/ui/GLRootView.java b/app/src/main/java/com/hippo/ehviewer/gallery/ui/GLRootView.java index 890718ac3..061844067 100644 --- a/app/src/main/java/com/hippo/ehviewer/gallery/ui/GLRootView.java +++ b/app/src/main/java/com/hippo/ehviewer/gallery/ui/GLRootView.java @@ -35,7 +35,6 @@ import com.hippo.ehviewer.gallery.glrenderer.BasicTexture; import com.hippo.ehviewer.gallery.glrenderer.GLCanvas; import com.hippo.ehviewer.gallery.glrenderer.GLES11Canvas; import com.hippo.ehviewer.gallery.glrenderer.GLES20Canvas; -import com.hippo.ehviewer.gallery.glrenderer.TextTexture; import com.hippo.ehviewer.gallery.glrenderer.UploadedTexture; import com.hippo.ehviewer.gallery.util.ApiHelper; import com.hippo.ehviewer.gallery.util.GalleryUtils; @@ -201,7 +200,7 @@ public class GLRootView extends GLSurfaceView } if (mRenderRequested) return; mRenderRequested = true; - if (ApiHelper.HAS_POST_ON_ANIMATION) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { postOnAnimation(mRequestRenderOnAnimationFrame); } else { super.requestRender(); diff --git a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java index d0ba8d3c3..c0bf40489 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/scene/GalleryDetailScene.java @@ -119,7 +119,7 @@ public class GalleryDetailScene extends Scene implements View.OnClickListener, private TextView mCommentMore; private PreviewLayout mPreviewLayout; - private View mProgressBar; + private View mProgressView; private ViewTransition mViewTransition; @@ -175,9 +175,9 @@ public class GalleryDetailScene extends Scene implements View.OnClickListener, mCommentMore = (TextView) mContent.findViewById(R.id.comment_more); mPreviewLayout = (PreviewLayout) mContent.findViewById(R.id.preview); - mProgressBar = findViewById(R.id.progress_bar); + mProgressView = findViewById(R.id.progress_view); - mViewTransition = new ViewTransition(mContent, mProgressBar); + mViewTransition = new ViewTransition(mContent, mProgressView); } private void handleAnnouncer(Announcer announcer) { diff --git a/app/src/main/java/com/hippo/ehviewer/widget/ContentLayout.java b/app/src/main/java/com/hippo/ehviewer/widget/ContentLayout.java index a04e0348f..aa5753e71 100644 --- a/app/src/main/java/com/hippo/ehviewer/widget/ContentLayout.java +++ b/app/src/main/java/com/hippo/ehviewer/widget/ContentLayout.java @@ -25,7 +25,6 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; -import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; @@ -33,6 +32,7 @@ import com.hippo.effect.ViewTransition; import com.hippo.ehviewer.R; import com.hippo.util.ExceptionUtils; import com.hippo.util.LayoutManagerUtils; +import com.hippo.widget.ProgressView; import com.hippo.widget.recyclerview.EasyRecyclerView; import com.hippo.widget.refreshlayout.RefreshLayout; import com.hippo.yorozuya.AssertUtils; @@ -47,7 +47,7 @@ public class ContentLayout extends FrameLayout { private static final String TAG = ContentLayout.class.getSimpleName(); - private ProgressBar mProgressBar; + private ProgressView mProgressView; private ViewGroup mTipView; private RefreshLayout mRefreshLayout; private EasyRecyclerView mRecyclerView; @@ -77,7 +77,7 @@ public class ContentLayout extends FrameLayout { private void init(Context context) { LayoutInflater.from(context).inflate(R.layout.widget_content_layout, this); - mProgressBar = (ProgressBar) getChildAt(0); + mProgressView = (ProgressView) getChildAt(0); mTipView = (ViewGroup) getChildAt(1); mRefreshLayout = (RefreshLayout) getChildAt(2); mRecyclerView = (EasyRecyclerView) mRefreshLayout.getChildAt(1); @@ -165,7 +165,7 @@ public class ContentLayout extends FrameLayout { private Context mContext; - private ProgressBar mProgressBar; + private ProgressView mProgressView; private ViewGroup mTipView; private RefreshLayout mRefreshLayout; private EasyRecyclerView mRecyclerView; @@ -277,7 +277,7 @@ public class ContentLayout extends FrameLayout { } private void init(ContentLayout contentLayout) { - mProgressBar = contentLayout.mProgressBar; + mProgressView = contentLayout.mProgressView; mTipView = contentLayout.mTipView; mRefreshLayout = contentLayout.mRefreshLayout; mRecyclerView = contentLayout.mRecyclerView; @@ -285,7 +285,7 @@ public class ContentLayout extends FrameLayout { mTextView = contentLayout.mTextView; mLayoutManager = generateLayoutManager(); - mViewTransition = new ViewTransition(mRefreshLayout, mProgressBar, mTipView); + mViewTransition = new ViewTransition(mRefreshLayout, mProgressView, mTipView); mViewTransition.showView(2, false); mRecyclerView.setLayoutManager(mLayoutManager); diff --git a/app/src/main/java/com/hippo/ehviewer/widget/PreviewLayout.java b/app/src/main/java/com/hippo/ehviewer/widget/PreviewLayout.java index f10b9ee1e..6c69b217b 100644 --- a/app/src/main/java/com/hippo/ehviewer/widget/PreviewLayout.java +++ b/app/src/main/java/com/hippo/ehviewer/widget/PreviewLayout.java @@ -48,7 +48,7 @@ public final class PreviewLayout extends LinearLayout implements View.OnClickLis private int mCurrentPreviewPage = -1; private SimpleGridLayout mSimpleGridLayout; - private View mProgressBar; + private View mProgressView; private View mTopPrevious; private TextView mTopSelection; private View mTopNext; @@ -93,7 +93,7 @@ public final class PreviewLayout extends LinearLayout implements View.OnClickLis mTopSelection = (TextView) viewGroup.getChildAt(2); mTopNext = viewGroup.getChildAt(4); mSimpleGridLayout = (SimpleGridLayout) getChildAt(1); - mProgressBar = getChildAt(2); + mProgressView = getChildAt(2); viewGroup = (ViewGroup) getChildAt(3); mBottomPrevious = viewGroup.getChildAt(0); mBottomSelection = (TextView) viewGroup.getChildAt(2); @@ -114,7 +114,7 @@ public final class PreviewLayout extends LinearLayout implements View.OnClickLis AccurateClick.setOnAccurateClickListener(mTopSelection, this); AccurateClick.setOnAccurateClickListener(mBottomSelection, this); - mViewTransition = new ViewTransition(mSimpleGridLayout, mProgressBar); + mViewTransition = new ViewTransition(mSimpleGridLayout, mProgressView); } public void setData(PreviewSet[] previewSets, int gid, LayoutInflater inflater, Conaco conaco) { diff --git a/app/src/main/res/anim/progress_indeterminate_material.xml b/app/src/main/res/anim/progress_indeterminate_material.xml deleted file mode 100644 index f19f3dae3..000000000 --- a/app/src/main/res/anim/progress_indeterminate_material.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/anim/progress_indeterminate_rotation_material.xml b/app/src/main/res/anim/progress_indeterminate_rotation_material.xml deleted file mode 100644 index 61cd74fb7..000000000 --- a/app/src/main/res/anim/progress_indeterminate_rotation_material.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/app/src/main/res/anim/trim_end_interpolator.xml b/app/src/main/res/anim/trim_end_interpolator.xml deleted file mode 100644 index f6e20f742..000000000 --- a/app/src/main/res/anim/trim_end_interpolator.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/app/src/main/res/anim/trim_start_interpolator.xml b/app/src/main/res/anim/trim_start_interpolator.xml deleted file mode 100644 index 428dd9f23..000000000 --- a/app/src/main/res/anim/trim_start_interpolator.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/progress_large_material.xml b/app/src/main/res/drawable/progress_large_material.xml deleted file mode 100644 index 6b8afea1e..000000000 --- a/app/src/main/res/drawable/progress_large_material.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/drawable/progress_medium_material.xml b/app/src/main/res/drawable/progress_medium_material.xml deleted file mode 100644 index d7523753d..000000000 --- a/app/src/main/res/drawable/progress_medium_material.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/drawable/progress_small_material.xml b/app/src/main/res/drawable/progress_small_material.xml deleted file mode 100644 index d2e1a2e32..000000000 --- a/app/src/main/res/drawable/progress_small_material.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/drawable/vector_drawable_progress_bar_large.xml b/app/src/main/res/drawable/vector_drawable_progress_bar_large.xml deleted file mode 100644 index 4f7e736a6..000000000 --- a/app/src/main/res/drawable/vector_drawable_progress_bar_large.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/drawable/vector_drawable_progress_bar_medium.xml b/app/src/main/res/drawable/vector_drawable_progress_bar_medium.xml deleted file mode 100644 index 402b8312a..000000000 --- a/app/src/main/res/drawable/vector_drawable_progress_bar_medium.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/drawable/vector_drawable_progress_bar_small.xml b/app/src/main/res/drawable/vector_drawable_progress_bar_small.xml deleted file mode 100644 index 89da44719..000000000 --- a/app/src/main/res/drawable/vector_drawable_progress_bar_small.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout-land/activity_start.xml b/app/src/main/res/layout-land/activity_start.xml deleted file mode 100644 index a6054bcf0..000000000 --- a/app/src/main/res/layout-land/activity_start.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_start.xml b/app/src/main/res/layout/activity_start.xml deleted file mode 100644 index 5a0f70eb6..000000000 --- a/app/src/main/res/layout/activity_start.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/layout/item_gallery.xml b/app/src/main/res/layout/item_gallery.xml deleted file mode 100644 index b810c854b..000000000 --- a/app/src/main/res/layout/item_gallery.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/scene_gallery.xml b/app/src/main/res/layout/scene_gallery.xml deleted file mode 100644 index 382f2a0c4..000000000 --- a/app/src/main/res/layout/scene_gallery.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - diff --git a/app/src/main/res/layout/scene_gallery_detail.xml b/app/src/main/res/layout/scene_gallery_detail.xml index eceae815d..942a003f6 100644 --- a/app/src/main/res/layout/scene_gallery_detail.xml +++ b/app/src/main/res/layout/scene_gallery_detail.xml @@ -129,9 +129,9 @@ - diff --git a/app/src/main/res/layout/widget_content_layout.xml b/app/src/main/res/layout/widget_content_layout.xml index d122c3be3..2d1caa796 100644 --- a/app/src/main/res/layout/widget_content_layout.xml +++ b/app/src/main/res/layout/widget_content_layout.xml @@ -20,8 +20,8 @@ xmlns:tools="http://schemas.android.com/tools" xmlns:auto="http://schemas.android.com/apk/res-auto"> - diff --git a/app/src/main/res/layout/widget_float_label_edit_text.xml b/app/src/main/res/layout/widget_float_label_edit_text.xml deleted file mode 100644 index a6340543b..000000000 --- a/app/src/main/res/layout/widget_float_label_edit_text.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/app/src/main/res/layout/widget_preview_layout.xml b/app/src/main/res/layout/widget_preview_layout.xml index 302639e6d..532f5f160 100644 --- a/app/src/main/res/layout/widget_preview_layout.xml +++ b/app/src/main/res/layout/widget_preview_layout.xml @@ -30,8 +30,8 @@ android:paddingRight="32dp" auto:itemMargin="8dp"/> - - - - - diff --git a/app/src/main/res/raw/file_image_off.svg b/app/src/main/res/raw/file_image_off.svg deleted file mode 100644 index f3a2817ca..000000000 --- a/app/src/main/res/raw/file_image_off.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml deleted file mode 100644 index ad18c5884..000000000 --- a/app/src/main/res/values-v21/styles.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index f7a47284a..4c06b1407 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -77,18 +77,6 @@ - - - - - -