This commit is contained in:
seven332 committed 2015-02-12 20:43:25 +08:00
1 parent ccc1032ecb
commit b63ea27415
34 files changed
+508 -163

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
</project>
+2 -4
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
@@ -7,9 +7,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/main" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
+7 -5
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="EhViewer" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
@@ -25,6 +25,7 @@
</component>
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
@@ -84,12 +85,13 @@
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="annotations-12.0" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="svg-android-2.0.6" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" />
</component>
</module>
+1
View File
@@ -27,6 +27,7 @@ dependencies {
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.github.japgolly.android:svg-android:2.0.6'
compile 'com.intellij:annotations:12.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
+2 -1
View File
@@ -41,7 +41,8 @@
android:name="com.hippo.ehviewer.ui.ContentActivity"
android:configChanges="screenSize|uiMode"
android:label="@string/app_name"
android:theme="@style/AppTheme.Content">
android:theme="@style/AppTheme.Content"
android:windowSoftInputMode="stateAlwaysHidden">
</activity>
</application>
@@ -16,24 +16,19 @@
package com.hippo.ehviewer.ui;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.widget.Toolbar;
import com.hippo.ehviewer.R;
import com.hippo.ehviewer.ui.scene.GalleryListScene;
import com.hippo.scene.StageActivity;
import com.hippo.scene.StageLayout;
import com.hippo.util.UiUtils;
public class ContentActivity extends StageActivity {
private Resources mResources;
private DrawerLayout mDrawerLayout;
private Toolbar mToolbar;
private StageLayout mStage;
@Override
@@ -44,14 +39,8 @@ public class ContentActivity extends StageActivity {
mResources = getResources();
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);
mToolbar = (Toolbar) mDrawerLayout.findViewById(R.id.toolbar);
mStage = (StageLayout) mDrawerLayout.findViewById(R.id.stage);
setSupportActionBar(mToolbar);
mToolbar.setTitleTextColor(Color.WHITE);
ViewCompat.setElevation(mToolbar, UiUtils.dp2pix(4)); // TODO
mDrawerLayout.setStatusBarBackground(R.color.theme_primary_dark);
startFirstScene(GalleryListScene.class);
@@ -26,9 +26,11 @@ import com.hippo.ehviewer.data.GalleryListUrlBuilder;
import com.hippo.ehviewer.ui.fragment.GalleryListFragment;
import com.hippo.ehviewer.ui.fragment.SearchFragment;
import com.hippo.scene.Scene;
import com.hippo.widget.Appbar;
public class GalleryListScene extends Scene implements SearchFragment.OnSearchListener {
private Appbar mAppbar;
private ViewPager mViewPager;
private GalleryListPagerAdapter mAdapter;
@@ -37,10 +39,13 @@ public class GalleryListScene extends Scene implements SearchFragment.OnSearchLi
public void onCreate() {
setContentView(R.layout.scene_gallery_list);
mAppbar = (Appbar) findViewById(R.id.appbar);
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mAdapter = new GalleryListPagerAdapter(getSupportFragmentManager());
mViewPager.setAdapter(mAdapter);
mAppbar.setTitle("EhViewer");
}
@Override
@@ -16,11 +16,12 @@
package com.hippo.ehviewer.widget;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SwitchCompat;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.LayoutInflater;
@@ -33,7 +34,6 @@ import android.widget.TextView;
import com.hippo.effect.ripple.RippleSalon;
import com.hippo.ehviewer.R;
import com.hippo.util.UiUtils;
import com.hippo.util.ViewUtils;
import com.hippo.widget.FloatingActionButton;
import com.hippo.widget.PrefixEditText;
@@ -69,6 +69,7 @@ public class SearchLayout extends FrameLayout implements CompoundButton.OnChecke
};
private Context mContext;
private Resources mResources;
private int mSearchType = SEARCH_TYPE_NORMAL;
private boolean mEnableAdvance = false;
@@ -80,7 +81,7 @@ public class SearchLayout extends FrameLayout implements CompoundButton.OnChecke
private CategoryTable mTableCategory;
private CheckBox mCheckSpecifyAuthor;
private PrefixEditText mTextSearch;
private CheckBox mCheckEnableAdvance;
private SwitchCompat mSwitchEnableAdvance;
private View mAdvanceView;
private AdvanceSearchTable mTableAdvanceSearch;
@@ -111,6 +112,7 @@ public class SearchLayout extends FrameLayout implements CompoundButton.OnChecke
private void init(Context context) {
mContext = context;
mResources = mContext.getResources();
LayoutInflater.from(context).inflate(R.layout.widget_search_layout, this);
@@ -162,7 +164,7 @@ public class SearchLayout extends FrameLayout implements CompoundButton.OnChecke
if (buttonView == mCheckSpecifyAuthor) {
mTextSearch.setPrefix(isChecked ? "uploader:" : null);
} else if (buttonView == mCheckEnableAdvance) {
} else if (buttonView == mSwitchEnableAdvance) {
mEnableAdvance = isChecked;
if (mSearchType == SEARCH_TYPE_NORMAL) {
if (isChecked) {
@@ -241,7 +243,7 @@ public class SearchLayout extends FrameLayout implements CompoundButton.OnChecke
bindActionView((ActionHolder) holder);
} else {
View view = mInflater.inflate(R.layout.search_category, parent, false);
ViewCompat.setElevation(view, UiUtils.dp2pix(4)); // TODO
// ViewCompat.setElevation(view, UiUtils.dp2pix(4)); // TODO
holder = new SearchHolder(view);
switch (viewType) {
case ITEM_TYPE_NORMAL:{
@@ -275,7 +277,7 @@ public class SearchLayout extends FrameLayout implements CompoundButton.OnChecke
mTableCategory = (CategoryTable) mNormalView.findViewById(R.id.search_category_table);
mCheckSpecifyAuthor = (CheckBox) mNormalView.findViewById(R.id.search_specify_author);
mTextSearch = (PrefixEditText) mNormalView.findViewById(R.id.search_text);
mCheckEnableAdvance = (CheckBox) mNormalView.findViewById(R.id.search_enable_advance);
mSwitchEnableAdvance = (SwitchCompat) mNormalView.findViewById(R.id.search_enable_advance);
// Restore state
if (mSavedInstanceState != null) {
@@ -283,7 +285,8 @@ public class SearchLayout extends FrameLayout implements CompoundButton.OnChecke
}
mCheckSpecifyAuthor.setOnCheckedChangeListener(SearchLayout.this);
mCheckEnableAdvance.setOnCheckedChangeListener(SearchLayout.this);
mSwitchEnableAdvance.setOnCheckedChangeListener(SearchLayout.this);
mSwitchEnableAdvance.setSwitchPadding(mResources.getDimensionPixelSize(R.dimen.switch_padding));
} else {
ViewUtils.removeFromParent(mNormalView);
holder.content.removeAllViews();
@@ -0,0 +1,80 @@
/*
* 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.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import com.hippo.ehviewer.R;
import com.hippo.util.ViewUtils;
public class Appbar extends FrameLayout {
private Context mContext;
private ImageView mNavigationIcon;
private TextView mTitle;
private String mTitleString;
public Appbar(Context context) {
super(context);
init(context);
}
public Appbar(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public Appbar(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public Appbar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context);
}
private void init(Context context) {
mContext = context;
LayoutInflater.from(context).inflate(R.layout.widget_app_bar, this);
mNavigationIcon = (ImageView) findViewById(R.id.ab_navigation_icon);
mTitle = (TextView) findViewById(R.id.ab_title);
ViewUtils.setVisibility(mNavigationIcon, View.GONE);
}
public void setTitle(int resId) {
setTitle(mContext.getString(resId));
}
public void setTitle(String title) {
mTitleString = title;
mTitle.setText(title);
}
}
@@ -18,16 +18,21 @@ package com.hippo.widget;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Rect;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import org.jetbrains.annotations.NotNull;
public class DrawerFrameLayout extends FrameLayout {
private static final int[] MAX_ATTRS = {android.R.attr.maxWidth};
private int mMaxWidth = -1;
private OnGetPaddingListener mOnGetPaddingListener;
public DrawerFrameLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs, 0, 0);
@@ -50,6 +55,7 @@ public class DrawerFrameLayout extends FrameLayout {
a.recycle();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec);
@@ -62,4 +68,25 @@ public class DrawerFrameLayout extends FrameLayout {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
@SuppressWarnings("deprecation")
@Override
protected boolean fitSystemWindows(@NotNull Rect insets) {
if (mOnGetPaddingListener != null) {
mOnGetPaddingListener.onGetPadding(insets.left, insets.top,
insets.right, insets.bottom);
}
insets.set(0, 0, 0, 0);
return super.fitSystemWindows(insets);
}
public void setOnGetPaddingListener(OnGetPaddingListener listener) {
mOnGetPaddingListener = listener;
}
public interface OnGetPaddingListener {
public void onGetPadding(int l, int t, int r, int b);
}
}
@@ -16,6 +16,8 @@
package com.hippo.widget;
import android.content.Context;
import android.os.Bundle;
import android.os.Parcelable;
import android.text.Editable;
import android.text.Selection;
import android.text.TextWatcher;
@@ -25,6 +27,9 @@ import android.widget.AutoCompleteTextView;
public class PrefixEditText extends AutoCompleteTextView
implements TextWatcher {
private static final String STATE_KEY_SUPER = "super";
private static final String STATE_KEY_PREFIX = "prefix";
private Context mContext;
private String mPrefix;
@@ -95,4 +100,21 @@ public class PrefixEditText extends AutoCompleteTextView
}
}
@Override
public Parcelable onSaveInstanceState() {
final Bundle state = new Bundle();
state.putParcelable(STATE_KEY_SUPER, super.onSaveInstanceState());
state.putString(STATE_KEY_PREFIX, mPrefix);
return state;
}
@Override
public void onRestoreInstanceState(Parcelable state) {
if (state instanceof Bundle) {
final Bundle savedState = (Bundle) state;
super.onRestoreInstanceState(savedState.getParcelable(STATE_KEY_SUPER));
setPrefix(savedState.getString(STATE_KEY_PREFIX));
}
}
}
@@ -23,7 +23,7 @@
<com.hippo.widget.Space
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" />
android:layout_weight="1"/>
<TextView
android:id="@+id/text_welcome"
@@ -33,13 +33,14 @@
android:gravity="center"
android:textSize="32sp"
android:textColor="@color/primary_text_dark"
android:text="@string/tip_welcome" />
android:text="@string/tip_welcome"/>
<ImageView
android:id="@+id/image_mascot"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="6"
android:scaleType="fitCenter" />
android:scaleType="fitCenter"
android:contentDescription="@null"/>
</LinearLayout>
@@ -14,11 +14,21 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<resources>
<com.hippo.widget.Appbar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/appbar_height"
android:background="?attr/colorPrimary"/>
<!-- Search view padding in its container -->
<dimen name="search_padding_start">128dp</dimen>
<dimen name="search_padding_end">128dp</dimen>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</resources>
</FrameLayout>
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="@dimen/search_category_padding_bottom">
<com.hippo.widget.Space
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
<TextView
android:id="@+id/search_action_1"
style="@style/SearchAction"
android:layout_width="@dimen/search_action_button_width"
android:layout_height="wrap_content"
android:gravity="center"/>
<TextView
android:id="@+id/search_action_2"
style="@style/SearchAction"
android:layout_width="@dimen/search_action_button_width"
android:layout_height="wrap_content"
android:gravity="center"/>
</LinearLayout>
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/search_category_interval">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/search_category_padding_start"
android:paddingRight="@dimen/search_category_padding_end"
android:paddingBottom="@dimen/search_category_padding_bottom">
<TextView
android:id="@+id/category_title"
android:layout_width="match_parent"
android:layout_height="@dimen/search_category_title_height"
android:singleLine="true"
android:ellipsize="marquee"
android:gravity="center_vertical"
android:textAppearance="@style/TextAppearance.CategoryTitle"/>
<FrameLayout
android:id="@+id/category_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v7.widget.CardView>
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<merge
xmlns:android="http://schemas.android.com/apk/res/android">
<com.hippo.widget.recyclerview.EasyRecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/appbar_size"
android:paddingLeft="52dp"
android:paddingRight="52dp"
android:clipToPadding="false"/>
<com.hippo.widget.FloatingActionButton
xmlns:auto="http://schemas.android.com/apk/res-auto"
style="@style/FloatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="@dimen/appbar_fab_margin_top"
android:layout_marginRight="24dp"
auto:fabColor="?attr/colorAccent"
auto:fabDrawable="@drawable/ic_fab_search"/>
</merge>
+6 -21
View File
@@ -20,34 +20,19 @@
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<LinearLayout
<com.hippo.scene.StageLayout
android:id="@+id/stage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-app"
android:id="@+id/toolbar"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:minHeight="?attr/actionBarSize"
android:background="?attr/colorPrimary"/>
<com.hippo.scene.StageLayout
android:id="@+id/stage"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>
android:layout_height="match_parent"/>
<com.hippo.widget.DrawerFrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:maxWidth="320dp"
android:background="@color/background_light"
android:fitsSystemWindows="true">
android:background="?attr/colorAccent"
android:fitsSystemWindows="true"
android:clickable="true">
<include
layout="@layout/draw_left"/>
+2 -1
View File
@@ -40,6 +40,7 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="6"
android:scaleType="fitCenter"/>
android:scaleType="fitCenter"
android:contentDescription="@null"/>
</LinearLayout>
+2 -2
View File
@@ -13,11 +13,11 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:orientation="vertical"
android:background="@android:color/black">
</LinearLayout>
+1 -5
View File
@@ -17,8 +17,4 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/search_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/search_padding_start"
android:paddingRight="@dimen/search_padding_end"
android:paddingTop="@dimen/search_padding_top"
android:paddingBottom="@dimen/search_padding_bottom"/>
android:layout_height="match_parent"/>
+15 -4
View File
@@ -13,10 +13,21 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<android.support.v4.view.ViewPager
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
</android.support.v4.view.ViewPager>
<com.hippo.widget.Appbar
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/appbar_size"
android:background="?attr/colorPrimary"/>
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
+2 -2
View File
@@ -23,7 +23,7 @@
<TextView
android:id="@+id/search_action_1"
style="@style/SearchAction"
android:layout_width="0dp"
android:layout_width="@dimen/search_action_button_width"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"/>
@@ -31,7 +31,7 @@
<TextView
android:id="@+id/search_action_2"
style="@style/SearchAction"
android:layout_width="0dp"
android:layout_width="@dimen/search_action_button_width"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"/>
+4 -8
View File
@@ -17,18 +17,17 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/search_category_interval"
android:paddingLeft="@dimen/search_category_padding_start"
android:paddingRight="@dimen/search_category_padding_end"
android:paddingBottom="@dimen/search_category_padding_bottom"
android:orientation="vertical"
android:background="@color/search_category_background_color"
android:layout_marginBottom="8dip">
android:background="@color/search_category_background_color">
<TextView
android:id="@+id/category_title"
android:layout_width="match_parent"
android:layout_height="@dimen/search_category_title_height"
android:paddingLeft="@dimen/search_category_widget_margin_start"
android:paddingRight="@dimen/search_category_widget_margin_start"
android:singleLine="true"
android:ellipsize="marquee"
android:gravity="center_vertical"
@@ -37,9 +36,6 @@
<FrameLayout
android:id="@+id/category_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/search_category_widget_margin_start"
android:paddingRight="@dimen/search_category_widget_margin_start"
android:paddingBottom="@dimen/search_category_widget_margin_start"/>
android:layout_height="wrap_content"/>
</LinearLayout>
+6 -2
View File
@@ -22,25 +22,29 @@
<com.hippo.ehviewer.widget.CategoryTable
android:id="@+id/search_category_table"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/search_item_interval"/>
<CheckBox
android:id="@+id/search_specify_author"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/search_item_interval"
android:text="@string/search_specify_author"/>
<com.hippo.widget.PrefixEditText
android:id="@+id/search_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/search_item_interval"
android:hint="@string/hint_no_keyword"
android:singleLine="true"/>
<CheckBox
<android.support.v7.widget.SwitchCompat
android:id="@+id/search_enable_advance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/search_enable_advance"/>
</LinearLayout>
@@ -22,6 +22,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginRight="@dimen/advance_search_table_item_margin_half"
android:checked="true"
android:text="@string/search_sname"/>
@@ -30,6 +32,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginLeft="@dimen/advance_search_table_item_margin_half"
android:checked="true"
android:text="@string/search_stags"/>
</TableRow>
@@ -40,6 +44,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginRight="@dimen/advance_search_table_item_margin_half"
android:text="@string/search_sdesc"/>
<CheckBox
@@ -47,6 +54,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginLeft="@dimen/advance_search_table_item_margin_half"
android:text="@string/search_storr"/>
</TableRow>
@@ -56,6 +66,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginRight="@dimen/advance_search_table_item_margin_half"
android:text="@string/search_sto"/>
<CheckBox
@@ -63,6 +76,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginLeft="@dimen/advance_search_table_item_margin_half"
android:text="@string/search_sdt1"/>
</TableRow>
@@ -72,6 +88,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginRight="@dimen/advance_search_table_item_margin_half"
android:text="@string/search_sdt2"/>
<CheckBox
@@ -79,6 +98,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginBottom="@dimen/advance_search_table_item_margin_half"
android:layout_marginLeft="@dimen/advance_search_table_item_margin_half"
android:text="@string/search_sh"/>
</TableRow>
@@ -88,6 +110,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginRight="@dimen/advance_search_table_item_margin_half"
android:text="@string/search_sr"/>
<Spinner
@@ -95,6 +119,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="@dimen/advance_search_table_item_margin_half"
android:layout_marginLeft="@dimen/advance_search_table_item_margin_half"
android:entries="@array/search_min_rating"/>
</TableRow>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/appbar_size"
android:orientation="horizontal">
<ImageView
android:id="@+id/ab_navigation_icon"
android:layout_width="@dimen/appbar_size"
android:layout_height="@dimen/appbar_size"
android:contentDescription="@null"/>
<TextView
android:id="@+id/ab_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="@dimen/keyline_margin"
android:textAppearance="@style/TextAppearance.AppCompat.Widget.ActionBar.Title.Inverse"/>
</LinearLayout>
@@ -23,8 +23,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="4dp"
android:layout_marginRight="4dp"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginRight="@dimen/category_table_item_margin_half"
android:background="@color/doujinshi"
android:textColor="@android:color/white"
android:text="@string/doujinshi" />
@@ -35,8 +35,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginLeft="@dimen/category_table_item_margin_half"
android:background="@color/manga"
android:textColor="@android:color/white"
android:text="@string/manga" />
@@ -49,9 +49,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginRight="@dimen/category_table_item_margin_half"
android:background="@color/artist_cg"
android:textColor="@android:color/white"
android:text="@string/artist_cg" />
@@ -62,9 +62,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginLeft="@dimen/category_table_item_margin_half"
android:background="@color/game_cg"
android:textColor="@android:color/white"
android:text="@string/game_cg" />
@@ -77,9 +77,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginRight="@dimen/category_table_item_margin_half"
android:background="@color/western"
android:textColor="@android:color/white"
android:text="@string/western" />
@@ -90,9 +90,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginLeft="@dimen/category_table_item_margin_half"
android:background="@color/non_h"
android:textColor="@android:color/white"
android:text="@string/non_h" />
@@ -105,9 +105,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginRight="@dimen/category_table_item_margin_half"
android:background="@color/image_set"
android:textColor="@android:color/white"
android:text="@string/image_set" />
@@ -118,9 +118,9 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginBottom="@dimen/category_table_item_margin_half"
android:layout_marginLeft="@dimen/category_table_item_margin_half"
android:background="@color/cosplay"
android:textColor="@android:color/white"
android:text="@string/cosplay" />
@@ -133,8 +133,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginRight="@dimen/category_table_item_margin_half"
android:background="@color/asian_porn"
android:textColor="@android:color/white"
android:text="@string/asian_porn" />
@@ -145,8 +145,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginLeft="4dp"
android:layout_marginTop="@dimen/category_table_item_margin_half"
android:layout_marginLeft="@dimen/category_table_item_margin_half"
android:background="@color/misc"
android:textColor="@android:color/white"
android:text="@string/misc" />
+26 -3
View File
@@ -16,11 +16,34 @@
-->
<resources>
<!-- Search category padding start / end -->
<dimen name="search_category_padding_start">16dp</dimen>
<dimen name="search_category_padding_end">24dp</dimen>
<!-- Search category title layout height -->
<dimen name="search_category_title_height">64dp</dimen>
<!-- Search category padding start / end / bottom -->
<dimen name="search_category_padding_start">52dp</dimen>
<dimen name="search_category_padding_end">52dp</dimen>
<dimen name="search_category_padding_bottom">32dp</dimen>
<!-- Search item interval -->
<dimen name="search_item_interval">16dp</dimen>
<!-- Search category interval -->
<dimen name="search_category_interval">16dp</dimen>
<dimen name="search_action_button_width">160dp</dimen>
<!-- Keyline -->
<dimen name="keyline_margin">24dp</dimen>
<!-- AppBar -->
<dimen name="appbar_height">224dp</dimen>
<dimen name="appbar_fab_margin_top">196dp</dimen>
<!-- CategoryTable -->
<dimen name="category_table_item_height">48dp</dimen>
<dimen name="category_table_item_margin_half">8dp</dimen>
<!-- AdvanceSearchTable -->
<dimen name="advance_search_table_item_margin_half">8dp</dimen>
</resources>
@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ 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.
-->
<resources>
<!-- Search view padding in its container -->
<dimen name="search_padding_start">80dp</dimen>
<dimen name="search_padding_end">80dp</dimen>
<!-- Search category padding start / end -->
<dimen name="search_category_padding_start">24dp</dimen>
<dimen name="search_category_padding_end">24dp</dimen>
</resources>
+11 -1
View File
@@ -22,8 +22,18 @@
<string name="search_tag">标签搜索</string>
<string name="search_image">图片搜索</string>
<string name="search_specify_author">指定上传者</string>
<string name="search_enable_advance">启用高级选项</string>
<string name="hint_no_keyword">没关键字也行</string>
<string name="search_enable_advance">启用高级选项</string>
<string name="search_sname">搜索画廊</string>
<string name="search_stags">搜索画廊标签</string>
<string name="search_sdesc">搜索画廊描述</string>
<string name="search_storr">搜索种子文件名</string>
<string name="search_sto">仅显示有种子的本子</string>
<string name="search_sdt1">搜索 Low-Power 标签</string>
<string name="search_sdt2">搜索 Downvoted 标签</string>
<string name="search_sh">显示 Expunged 画廊</string>
<string name="search_sr">最低评分:</string>
<string name="search_add">添加</string>
<string name="search_mode">模式</string>
+12 -8
View File
@@ -16,25 +16,29 @@
<resources>
<declare-styleable name="FixedAspectImageView">
<attr name="faiAspect" format="float" />
<attr name="faiAspect" format="float"/>
</declare-styleable>
<declare-styleable name="FixedAspectLayout">
<attr name="falAspect" format="float" />
<attr name="falAspect" format="float"/>
</declare-styleable>
<declare-styleable name="FloatingActionButton">
<attr name="fabColor" format="color" />
<attr name="fabDrawable" format="reference" />
<attr name="fabColor" format="color"/>
<attr name="fabDrawable" format="reference"/>
</declare-styleable>
<declare-styleable name="FloatLabelEditText">
<attr name="fllLabelAppearance" format="reference" />
<attr name="fllHint" format="string" />
<attr name="fllLabelAppearance" format="reference"/>
<attr name="fllHint" format="string"/>
<attr name="fllTrigger" format="enum">
<enum name="text" value="0" />
<enum name="focus" value="1" />
<enum name="text" value="0"/>
<enum name="focus" value="1"/>
</attr>
</declare-styleable>
<declare-styleable name="Appbar">
<attr name="abTitleAppearance" format="reference"/>
</declare-styleable>
</resources>
+26 -12
View File
@@ -15,15 +15,10 @@
-->
<resources>
<!-- Search view padding in its container -->
<dimen name="search_padding_start">0dp</dimen>
<dimen name="search_padding_end">0dp</dimen>
<dimen name="search_padding_top">0dp</dimen>
<dimen name="search_padding_bottom">0dp</dimen>
<!-- Search category padding start / end -->
<dimen name="search_category_padding_start">0dp</dimen>
<dimen name="search_category_padding_end">0dp</dimen>
<!-- Search category padding start / end / bottom -->
<dimen name="search_category_padding_start">16dp</dimen>
<dimen name="search_category_padding_end">16dp</dimen>
<dimen name="search_category_padding_bottom">8dp</dimen>
<!-- Search category panel elevation -->
<dimen name="search_category_elevation">4dp</dimen>
@@ -31,11 +26,30 @@
<!-- Search category title layout height -->
<dimen name="search_category_title_height">48dp</dimen>
<!-- Search category title margin start -->
<dimen name="search_category_widget_margin_start">16dp</dimen>
<dimen name="search_category_widget_margin_end">16dp</dimen>
<!-- Search item interval -->
<dimen name="search_item_interval">8dp</dimen>
<!-- Search category interval -->
<dimen name="search_category_interval">16dp</dimen>
<dimen name="search_action_button_width">0dp</dimen>
<!-- Switch padding -->
<dimen name="switch_padding">8dp</dimen>
<!-- Keyline -->
<dimen name="keyline_margin">16dp</dimen>
<!-- AppBar -->
<dimen name="appbar_size">56dp</dimen>
<dimen name="appbar_height">@dimen/appbar_size</dimen>
<dimen name="appbar_fab_margin_top">28dp</dimen>
<!-- CategoryTable -->
<dimen name="category_table_item_height">40dp</dimen>
<dimen name="category_table_item_margin_half">4dp</dimen>
<!-- AdvanceSearchTable -->
<dimen name="advance_search_table_item_margin_half">4dp</dimen>
</resources>
+1 -2
View File
@@ -39,6 +39,7 @@
<string name="search_tag">Tag</string>
<string name="search_image">Image</string>
<string name="search_specify_author">Specify Uploader</string>
<string name="hint_no_keyword">No keyword is OK</string>
<string name="search_enable_advance">Enable advance options</string>
<string name="search_sname">Search Gallery</string>
@@ -51,8 +52,6 @@
<string name="search_sh">Show Expunged Galleries</string>
<string name="search_sr">Minimum Rating:</string>
<string name="hint_no_keyword">No keyword is OK</string>
<string name="search_add">Add</string>
<string name="search_mode">Mode</string>
+2 -2
View File
@@ -39,14 +39,14 @@
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Subhead</item>
<item name="android:textStyle">bold</item>
<item name="android:gravity">center</item>
<item name="android:minHeight">40dp</item>
<item name="android:minHeight">@dimen/category_table_item_height</item>
</style>
<style name="SearchAction">
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Button</item>
<item name="android:textStyle">bold</item>
<item name="android:gravity">center</item>
<item name="android:minHeight">40dp</item>
<item name="android:minHeight">48dp</item>
<item name="android:textColor">?attr/colorPrimary</item>
</style>