diff --git a/app/src/main/java/com/hippo/ehviewer/ui/ContentActivity.java b/app/src/main/java/com/hippo/ehviewer/ui/ContentActivity.java index f33968249..d89af7189 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/ContentActivity.java +++ b/app/src/main/java/com/hippo/ehviewer/ui/ContentActivity.java @@ -18,6 +18,7 @@ package com.hippo.ehviewer.ui; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.Resources; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.widget.DrawerLayout; @@ -27,9 +28,11 @@ import com.hippo.content.VectorContext; import com.hippo.ehviewer.R; import com.hippo.ehviewer.ui.scene.GalleryListScene; import com.hippo.ehviewer.util.Config; +import com.hippo.ehviewer.widget.DrawerLeftPanel; import com.hippo.ehviewer.widget.StatusBarLayout; import com.hippo.scene.StageActivity; import com.hippo.scene.StageLayout; +import com.hippo.widget.DrawerListView; public class ContentActivity extends StageActivity implements StatusBarLayout.OnGetFitPaddingBottomListener { @@ -39,6 +42,8 @@ public class ContentActivity extends StageActivity private DrawerLayout mDrawerLayout; private StatusBarLayout mStatusBarLayout; private StageLayout mContentLayout; + private DrawerLeftPanel mDrawerLeftPanel; + private DrawerListView mDrawerListView; @Override protected boolean isShowStats() { @@ -53,13 +58,36 @@ public class ContentActivity extends StageActivity mResources = getResources(); mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); - mStatusBarLayout = (StatusBarLayout) mDrawerLayout.findViewById(R.id.status_bar_layout); + mStatusBarLayout = (StatusBarLayout) mDrawerLayout.getChildAt(0); mContentLayout = (StageLayout) mStatusBarLayout.findViewById(R.id.stage); + mDrawerLeftPanel = (DrawerLeftPanel) mDrawerLayout.getChildAt(1); + mDrawerListView = mDrawerLeftPanel.getDrawerListView(); mStatusBarLayout.setOnGetFitPaddingBottomListener(this); + // Drawer + Drawable[] drawerListDrawables = new Drawable[] { + mResources.getDrawable(R.drawable.ic_drawer_list_home), + mResources.getDrawable(R.drawable.ic_drawer_list_fire), + mResources.getDrawable(R.drawable.ic_drawer_list_history), + mResources.getDrawable(R.drawable.ic_drawer_list_heart), + mResources.getDrawable(R.drawable.ic_drawer_list_download), + mResources.getDrawable(R.drawable.ic_drawer_list_settings) + }; + CharSequence[] drawerListStrings = new CharSequence[] { + mResources.getString(R.string.homepage), + mResources.getString(R.string.whatshot), + mResources.getString(R.string.history), + mResources.getString(R.string.favorite), + mResources.getString(R.string.download), + mResources.getString(R.string.settings) + }; + mDrawerListView.setData(drawerListDrawables, drawerListStrings); + + // First time if (savedInstanceState == null) { startScene(GalleryListScene.class, null); + mDrawerListView.setActivatedPosition(0); } } 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 dc0a438de..2ca3863ce 100644 --- a/app/src/main/java/com/hippo/ehviewer/widget/ContentLayout.java +++ b/app/src/main/java/com/hippo/ehviewer/widget/ContentLayout.java @@ -55,7 +55,6 @@ public class ContentLayout extends FrameLayout { private int mRecyclerViewOriginTop; private int mRecyclerViewOriginBottom; - private int mSnackbarOriginBottom; public ContentLayout(Context context) { super(context); diff --git a/app/src/main/java/com/hippo/ehviewer/widget/DrawerLeftPanel.java b/app/src/main/java/com/hippo/ehviewer/widget/DrawerLeftPanel.java new file mode 100644 index 000000000..87bf67480 --- /dev/null +++ b/app/src/main/java/com/hippo/ehviewer/widget/DrawerLeftPanel.java @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2015 Hippo Seven + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hippo.ehviewer.widget; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Rect; +import android.os.Bundle; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.facebook.drawee.view.SimpleDraweeView; +import com.hippo.effect.ripple.RippleSalon; +import com.hippo.ehviewer.R; +import com.hippo.widget.DrawerListView; + +public class DrawerLeftPanel extends LinearLayout { + + private static final String STATE_KEY_SUPER = "super"; + private static final String STATE_KEY_DRAWER_LIST_VIEW = "drawer_list_view"; + + private static final int[] MAX_ATTRS = {android.R.attr.maxWidth}; + + private int mMaxWidth = -1; + + private ViewGroup mSuperUserPanel; + private ViewGroup mUserPanel; + private SimpleDraweeView mAvatar; + private TextView mUsename; + private TextView mAction; + private DrawerListView mDrawerListView; + + private int mFitPaddingTop; + private int mFitPaddingBottom; + + private int mSuperUserPanelHeight; + private int mUserPanelOriginalPaddingTop; + private int mDrawerListViewOriginalPaddingBottom; + + public DrawerLeftPanel(Context context, AttributeSet attrs) { + super(context, attrs); + init(context, attrs); + } + + public DrawerLeftPanel(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context, attrs); + } + + private void init(Context context, AttributeSet attrs) { + final TypedArray a = context.obtainStyledAttributes(attrs, MAX_ATTRS); + mMaxWidth = a.getDimensionPixelSize(0, -1); + a.recycle(); + + setOrientation(LinearLayout.VERTICAL); + + LayoutInflater.from(context).inflate(R.layout.widget_drawer_left_panel, this); + + mSuperUserPanel = (ViewGroup) getChildAt(0); + mUserPanel = (ViewGroup) mSuperUserPanel.getChildAt(1); + mAvatar = (SimpleDraweeView) mUserPanel.getChildAt(0); + mUsename = (TextView) mUserPanel.getChildAt(1); + mAction = (TextView) mUserPanel.getChildAt(2); + mDrawerListView = (DrawerListView) getChildAt(1); + + RippleSalon.addRipple(mAction, false); + + mAvatar.getHierarchy().setPlaceholderImage(R.drawable.theme_primary); + mUsename.setText("速度速度加快"); + mAction.setText("登出"); + + mSuperUserPanelHeight = mSuperUserPanel.getLayoutParams().height; + mUserPanelOriginalPaddingTop = mUserPanel.getPaddingTop(); + mDrawerListViewOriginalPaddingBottom = mDrawerListView.getPaddingBottom(); + } + + public DrawerListView getDrawerListView() { + return mDrawerListView; + } + + @Override + public Parcelable onSaveInstanceState() { + final Bundle state = new Bundle(); + state.putParcelable(STATE_KEY_SUPER, super.onSaveInstanceState()); + state.putParcelable(STATE_KEY_DRAWER_LIST_VIEW, mDrawerListView.onSaveInstanceState()); + return state; + } + + @Override + public void onRestoreInstanceState(Parcelable state) { + if (state instanceof Bundle) { + final Bundle savedState = (Bundle) state; + super.onRestoreInstanceState(savedState.getParcelable(STATE_KEY_SUPER)); + mDrawerListView.onRestoreInstanceState(savedState.getParcelable(STATE_KEY_DRAWER_LIST_VIEW)); + } + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec); + + if (mMaxWidth > 0) { + widthSpecSize = Math.min(mMaxWidth, widthSpecSize); + widthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSpecSize, + MeasureSpec.EXACTLY); + } + + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + } + + @SuppressWarnings("deprecation") + @Override + protected boolean fitSystemWindows(@NonNull Rect insets) { + int fitPaddingTop = insets.top; + int fitPaddingBottom = insets.bottom; + + if (mFitPaddingTop != fitPaddingTop) { + mFitPaddingTop = fitPaddingTop; + + ViewGroup.LayoutParams lp = mSuperUserPanel.getLayoutParams(); + lp.height = mSuperUserPanelHeight + fitPaddingTop; + mSuperUserPanel.setLayoutParams(lp); + + mUserPanel.setPadding(mUserPanel.getPaddingLeft(), + mUserPanelOriginalPaddingTop + fitPaddingTop, + mUserPanel.getPaddingRight(), + mUserPanel.getPaddingBottom()); + } + + if (mFitPaddingBottom != fitPaddingBottom) { + mDrawerListView.setPadding(mDrawerListView.getPaddingLeft(), + mDrawerListView.getPaddingTop(), + mDrawerListView.getPaddingRight(), + mDrawerListViewOriginalPaddingBottom + fitPaddingBottom); + } + + insets.set(insets.left, 0, insets.right, 0); + + return super.fitSystemWindows(insets); + } +} diff --git a/app/src/main/java/com/hippo/widget/DrawerFrameLayout.java b/app/src/main/java/com/hippo/widget/DrawerFrameLayout.java deleted file mode 100644 index 07ab4d3f0..000000000 --- a/app/src/main/java/com/hippo/widget/DrawerFrameLayout.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2015 Hippo Seven - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.hippo.widget; - -import android.content.Context; -import android.content.res.TypedArray; -import android.graphics.Rect; -import android.support.annotation.NonNull; -import android.util.AttributeSet; -import android.widget.FrameLayout; - -public class DrawerFrameLayout extends FrameLayout { - - private static final int[] MAX_ATTRS = {android.R.attr.maxWidth}; - - private int mMaxWidth = -1; - - private OnGetPaddingListener mOnGetPaddingListener; - - private int mFitPaddingLeft = -1; - private int mFitPaddingTop = -1; - private int mFitPaddingRight = -1; - private int mFitPaddingBottom = -1; - - public DrawerFrameLayout(Context context, AttributeSet attrs) { - super(context, attrs); - init(context, attrs); - } - - public DrawerFrameLayout(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - init(context, attrs); - } - - private void init(Context context, AttributeSet attrs) { - final TypedArray a = context.obtainStyledAttributes(attrs, MAX_ATTRS); - mMaxWidth = a.getDimensionPixelSize(0, -1); - a.recycle(); - } - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec); - - if (mMaxWidth > 0) { - widthSpecSize = Math.min(mMaxWidth, widthSpecSize); - widthMeasureSpec = MeasureSpec.makeMeasureSpec(widthSpecSize, - MeasureSpec.EXACTLY); - } - - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - } - - @SuppressWarnings("deprecation") - @Override - protected boolean fitSystemWindows(@NonNull Rect insets) { - mFitPaddingLeft = insets.left; - mFitPaddingTop = insets.top; - mFitPaddingRight = insets.right; - mFitPaddingBottom = insets.bottom; - if (mOnGetPaddingListener != null) { - mOnGetPaddingListener.onGetPadding(mFitPaddingLeft, mFitPaddingTop, - mFitPaddingRight, mFitPaddingBottom); - } - - insets.set(0, 0, 0, 0); - - return super.fitSystemWindows(insets); - } - - public void setOnGetPaddingListener(OnGetPaddingListener listener) { - mOnGetPaddingListener = listener; - } - - public int getFitPaddingLeft() { - return mFitPaddingLeft; - } - - public int getFitPaddingTop() { - return mFitPaddingTop; - } - - public int getFitPaddingRight() { - return mFitPaddingRight; - } - - public int getFitPaddingBottom() { - return mFitPaddingBottom; - } - - public interface OnGetPaddingListener { - public void onGetPadding(int l, int t, int r, int b); - } -} diff --git a/app/src/main/java/com/hippo/widget/DrawerListView.java b/app/src/main/java/com/hippo/widget/DrawerListView.java new file mode 100644 index 000000000..63ed59e5c --- /dev/null +++ b/app/src/main/java/com/hippo/widget/DrawerListView.java @@ -0,0 +1,185 @@ +/* + * Copyright (C) 2014-2015 Hippo Seven + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.hippo.widget; + +import android.annotation.TargetApi; +import android.content.Context; +import android.content.res.Resources; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.os.Bundle; +import android.os.Parcelable; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ListView; +import android.widget.TextView; + +import com.hippo.ehviewer.R; + +public class DrawerListView extends ListView { + + private static final String STATE_KEY_SUPER = "super"; + private static final String STATE_KEY_ACTIVATED_POSITION = "activated_position"; + + private Context mContext; + private DrawerListAdapter mAdapter; + + private int mActivatedPosition = -1; + private int mDrawableSize; + + public DrawerListView(Context context, AttributeSet attrs) { + super(context, attrs); + init(context); + } + + public DrawerListView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + init(context); + } + + private void init(Context context) { + mContext = context; + mAdapter = new DrawerListAdapter(); + setAdapter(mAdapter); + setDivider(context.getResources().getDrawable(R.drawable.transparent)); + setDividerHeight(0); + + Resources resources = context.getResources(); + mDrawableSize = resources.getDimensionPixelOffset(R.dimen.drawer_list_drawable_size); + } + + /** + * Drawable should be 24dp + */ + public void setData(Drawable[] drawableArray, CharSequence[] titleArray) { + mAdapter.setData(drawableArray, titleArray); + } + + public View getViewByPosition(int pos) { + final int firstListItemPosition = getFirstVisiblePosition(); + final int lastListItemPosition = firstListItemPosition + getChildCount() - 1; + + if (pos >= firstListItemPosition && pos <= lastListItemPosition) { + final int childIndex = pos - firstListItemPosition; + return getChildAt(childIndex); + } else { + return null; + } + } + + public void setActivatedPosition(int position) { + if (mActivatedPosition != position) { + int oldPosition = mActivatedPosition; + mActivatedPosition = position; + View oldView = getViewByPosition(oldPosition); + View newView = getViewByPosition(position); + if (oldView != null) { + oldView.setActivated(false); + } + if (newView != null) { + newView.setActivated(true); + } + } + } + + public int getActivatedPosition() { + return mActivatedPosition; + } + + @Override + public Parcelable onSaveInstanceState() { + final Bundle state = new Bundle(); + state.putParcelable(STATE_KEY_SUPER, super.onSaveInstanceState()); + state.putInt(STATE_KEY_ACTIVATED_POSITION, mActivatedPosition); + return state; + } + + @Override + public void onRestoreInstanceState(Parcelable state) { + if (state instanceof Bundle) { + final Bundle savedState = (Bundle) state; + super.onRestoreInstanceState(savedState.getParcelable(STATE_KEY_SUPER)); + setActivatedPosition(savedState.getInt(STATE_KEY_ACTIVATED_POSITION)); + } + } + + private class DrawerListAdapter extends BaseAdapter { + + private Drawable[] mDrawableArray; + private CharSequence[] mTitleArray; + + private void setData(Drawable[] drawableArray, CharSequence[] titleArray) { + if (drawableArray != null && titleArray != null) { + if (drawableArray.length != titleArray.length) + throw new IllegalStateException("drawableArray.length != titleArray.length"); + } else if (drawableArray == null && titleArray == null) { + throw new IllegalStateException("drawableArray and titleArray should be all null or not null"); + } + mDrawableArray = drawableArray; + mTitleArray = titleArray; + notifyDataSetChanged(); + } + + @Override + public int getCount() { + return mTitleArray == null ? 0 : mTitleArray.length; + } + + @Override + public Object getItem(int position) { + return position; + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + public View getView(int position, View convertView, ViewGroup parent) { + if (convertView == null) { + convertView = LayoutInflater.from(mContext).inflate(R.layout.item_drawer_list, parent, false); + } + + // Handle activated + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + if (position == mActivatedPosition) { + convertView.setActivated(true); + } else { + convertView.setActivated(false); + } + } + + TextView tv = (TextView) convertView; + CharSequence t = mTitleArray[position]; + tv.setText(t); + Drawable d = mDrawableArray[position]; + if (d != null) { + d.setBounds(0, 0, mDrawableSize, mDrawableSize); + tv.setCompoundDrawables(d, null, null, null); + } else { + tv.setCompoundDrawables(null, null, null, null); + } + + return convertView; + } + } +} diff --git a/app/src/main/res/color/float_label_edit_text_light.xml b/app/src/main/res/color/float_label_edit_text_light.xml index 22e748068..bbcf73f26 100644 --- a/app/src/main/res/color/float_label_edit_text_light.xml +++ b/app/src/main/res/color/float_label_edit_text_light.xml @@ -16,6 +16,7 @@ + diff --git a/app/src/main/res/color-v11/float_label_edit_text_light.xml b/app/src/main/res/color/text_drawer_list.xml similarity index 82% rename from app/src/main/res/color-v11/float_label_edit_text_light.xml rename to app/src/main/res/color/text_drawer_list.xml index bbcf73f26..7971de107 100644 --- a/app/src/main/res/color-v11/float_label_edit_text_light.xml +++ b/app/src/main/res/color/text_drawer_list.xml @@ -1,4 +1,5 @@ + - - - + + + + diff --git a/app/src/main/res/drawable/ic_download.xml b/app/src/main/res/drawable/ic_download.xml new file mode 100644 index 000000000..646ec8bb5 --- /dev/null +++ b/app/src/main/res/drawable/ic_download.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_download_dark.xml b/app/src/main/res/drawable/ic_download_dark.xml new file mode 100644 index 000000000..b650f34c6 --- /dev/null +++ b/app/src/main/res/drawable/ic_download_dark.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_drawer_list_download.xml b/app/src/main/res/drawable/ic_drawer_list_download.xml new file mode 100644 index 000000000..0f7eb1288 --- /dev/null +++ b/app/src/main/res/drawable/ic_drawer_list_download.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_drawer_list_fire.xml b/app/src/main/res/drawable/ic_drawer_list_fire.xml new file mode 100644 index 000000000..44ff76d76 --- /dev/null +++ b/app/src/main/res/drawable/ic_drawer_list_fire.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_drawer_list_heart.xml b/app/src/main/res/drawable/ic_drawer_list_heart.xml new file mode 100644 index 000000000..e3ebf36f2 --- /dev/null +++ b/app/src/main/res/drawable/ic_drawer_list_heart.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_drawer_list_history.xml b/app/src/main/res/drawable/ic_drawer_list_history.xml new file mode 100644 index 000000000..dd09bc6ca --- /dev/null +++ b/app/src/main/res/drawable/ic_drawer_list_history.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_drawer_list_home.xml b/app/src/main/res/drawable/ic_drawer_list_home.xml new file mode 100644 index 000000000..5a3afd835 --- /dev/null +++ b/app/src/main/res/drawable/ic_drawer_list_home.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_drawer_list_settings.xml b/app/src/main/res/drawable/ic_drawer_list_settings.xml new file mode 100644 index 000000000..b0b19231b --- /dev/null +++ b/app/src/main/res/drawable/ic_drawer_list_settings.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_fire.xml b/app/src/main/res/drawable/ic_fire.xml new file mode 100644 index 000000000..3ae93c3e6 --- /dev/null +++ b/app/src/main/res/drawable/ic_fire.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_fire_dark.xml b/app/src/main/res/drawable/ic_fire_dark.xml new file mode 100644 index 000000000..ed1a4c790 --- /dev/null +++ b/app/src/main/res/drawable/ic_fire_dark.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_heart.xml b/app/src/main/res/drawable/ic_heart.xml new file mode 100644 index 000000000..805156f9c --- /dev/null +++ b/app/src/main/res/drawable/ic_heart.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_heart_dark.xml b/app/src/main/res/drawable/ic_heart_dark.xml new file mode 100644 index 000000000..7e1262a37 --- /dev/null +++ b/app/src/main/res/drawable/ic_heart_dark.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_history.xml b/app/src/main/res/drawable/ic_history.xml new file mode 100644 index 000000000..2a3bb0616 --- /dev/null +++ b/app/src/main/res/drawable/ic_history.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_history_dark.xml b/app/src/main/res/drawable/ic_history_dark.xml new file mode 100644 index 000000000..a29abf077 --- /dev/null +++ b/app/src/main/res/drawable/ic_history_dark.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_home.xml b/app/src/main/res/drawable/ic_home.xml new file mode 100644 index 000000000..68e33427f --- /dev/null +++ b/app/src/main/res/drawable/ic_home.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_home_dark.xml b/app/src/main/res/drawable/ic_home_dark.xml new file mode 100644 index 000000000..72a8204fa --- /dev/null +++ b/app/src/main/res/drawable/ic_home_dark.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_settings.xml b/app/src/main/res/drawable/ic_settings.xml new file mode 100644 index 000000000..987dfa549 --- /dev/null +++ b/app/src/main/res/drawable/ic_settings.xml @@ -0,0 +1,39 @@ + + + + + + + diff --git a/app/src/main/res/drawable/ic_settings_dark.xml b/app/src/main/res/drawable/ic_settings_dark.xml new file mode 100644 index 000000000..0d3e4f959 --- /dev/null +++ b/app/src/main/res/drawable/ic_settings_dark.xml @@ -0,0 +1,40 @@ + + + + + + + + diff --git a/app/src/main/res/layout/activity_content.xml b/app/src/main/res/layout/activity_content.xml index efec6e926..90d528e25 100644 --- a/app/src/main/res/layout/activity_content.xml +++ b/app/src/main/res/layout/activity_content.xml @@ -18,7 +18,8 @@ xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:fitsSystemWindows="true"> - - - - - + tools:ignore="RtlHardcoded"/> diff --git a/app/src/main/res/layout/item_drawer_list.xml b/app/src/main/res/layout/item_drawer_list.xml new file mode 100644 index 000000000..30ff555a1 --- /dev/null +++ b/app/src/main/res/layout/item_drawer_list.xml @@ -0,0 +1,29 @@ + + + + + diff --git a/app/src/main/res/layout/widget_drawer_left_panel.xml b/app/src/main/res/layout/widget_drawer_left_panel.xml new file mode 100644 index 000000000..dbc2c15af --- /dev/null +++ b/app/src/main/res/layout/widget_drawer_left_panel.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 4c489ee69..577f8d663 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -15,6 +15,9 @@ --> + + 24dp + 16dp 1dp diff --git a/app/src/main/res/values/drawables.xml b/app/src/main/res/values/drawables.xml new file mode 100644 index 000000000..89c124fca --- /dev/null +++ b/app/src/main/res/values/drawables.xml @@ -0,0 +1,25 @@ + + + + + + @android:color/transparent + @color/theme_primary + @color/theme_accent + @color/ripple_material_light + @color/ripple_material_dark + + diff --git a/app/src/main/res/values/pathdata.xml b/app/src/main/res/values/pathdata.xml index 33f7d8b14..141da19e4 100644 --- a/app/src/main/res/values/pathdata.xml +++ b/app/src/main/res/values/pathdata.xml @@ -25,5 +25,11 @@ M10.5,7A6.5,6.5 0 0,0 4,13.5A6.5,6.5 0 0,0 10.5,20H14V18H10.5C8,18 6,16 6,13.5C6,11 8,9 10.5,9H16.17L13.09,12.09L14.5,13.5L20,8L14.5,2.5L13.08,3.91L16.17,7H10.5M18,18H16V20H18V18Z M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z M12,15.89V6.59L13.71,10.63L18.09,11L14.77,13.88L15.76,18.16M22,9.74L14.81,9.13L12,2.5L9.19,9.13L2,9.74L7.45,14.47L5.82,21.5L12,17.77L18.18,21.5L16.54,14.47L22,9.74Z + M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z + M11.71,19C9.93,19 8.5,17.59 8.5,15.86C8.5,14.24 9.53,13.1 11.3,12.74C13.07,12.38 14.9,11.53 15.92,10.16C16.31,11.45 16.5,12.81 16.5,14.2C16.5,16.84 14.36,19 11.71,19M13.5,0.67C13.5,0.67 14.24,3.32 14.24,5.47C14.24,7.53 12.89,9.2 10.83,9.2C8.76,9.2 7.2,7.53 7.2,5.47L7.23,5.1C5.21,7.5 4,10.61 4,14A8,8 0 0,0 12,22A8,8 0 0,0 20,14C20,8.6 17.41,3.8 13.5,0.67Z + M11,7V12.11L15.71,14.9L16.5,13.62L12.5,11.25V7M12.5,2C8.97,2 5.91,3.92 4.27,6.77L2,4.5V11H8.5L5.75,8.25C6.96,5.73 9.5,4 12.5,4A7.5,7.5 0 0,1 20,11.5A7.5,7.5 0 0,1 12.5,19C9.23,19 6.47,16.91 5.44,14H3.34C4.44,18.03 8.11,21 12.5,21C17.74,21 22,16.75 22,11.5A9.5,9.5 0 0,0 12.5,2Z + M12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35Z + M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z + M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 584c61d22..3b55720f0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -94,5 +94,11 @@ Retry Go to Unknown + Homepage + What\'s hot + History + Favorite + Download + Settings diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index bbfeacd33..a712bb32c 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -128,11 +128,13 @@