Improve detail scene layout

This commit is contained in:
seven332 committed 2015-07-05 20:53:22 +08:00
1 parent efed224018
commit 56fc7507e3
5 files changed
+283 -143

No files matched your search

@@ -49,105 +49,18 @@
android:layout_marginRight="@dimen/keyline_margin"
android:background="@color/divider_light"/>
<TextSwitcher
android:id="@+id/rating_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="16dp"
android:gravity="center"
android:inAnimation="@anim/fade_in"
android:outAnimation="@anim/fade_out"/>
<com.hippo.ehviewer.widget.RatingView
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
auto:starSize="48dp"
auto:starInterval="8dp"
auto:starCount="5"
auto:isIndicator="true"
auto:max="5"
auto:rating="3.7"/>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/favorite"/>
<TextView
android:id="@+id/torrent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:gravity="center_horizontal"
android:text="@string/torrent"
tools:ignore="RtlHardcoded"/>
<TextView
android:id="@+id/share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:gravity="center_horizontal"
android:text="@string/share"
tools:ignore="RtlHardcoded"/>
<TextView
android:id="@+id/rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:gravity="center_horizontal"
android:text="Rate"
tools:ignore="RtlHardcoded"/>
</LinearLayout>
</HorizontalScrollView>
<include
layout="@layout/gallery_detail_action"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="16dp"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginRight="@dimen/keyline_margin"
android:background="@color/divider_light"/>
<LinearLayout
android:id="@+id/tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/no_tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@color/theme_accent"
android:text="@string/no_tags"/>
</LinearLayout>
<include
layout="@layout/gallery_detail_tag"/>
<View
android:layout_width="match_parent"
@@ -166,12 +79,8 @@
android:layout_marginRight="@dimen/keyline_margin"
android:background="@color/divider_light"/>
<com.hippo.ehviewer.widget.PreviewLayout
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"/>
<include
layout="@layout/gallery_detail_preview"/>
</LinearLayout>
@@ -284,9 +193,3 @@
android:layout_gravity="center"/>
</FrameLayout>
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextSwitcher
android:id="@+id/rating_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:inAnimation="@anim/fade_in"
android:outAnimation="@anim/fade_out"/>
<com.hippo.ehviewer.widget.RatingView
xmlns:auto="http://schemas.android.com/apk/res-auto"
android:id="@+id/rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp"
auto:starSize="48dp"
auto:starInterval="8dp"
auto:starCount="5"
auto:isIndicator="true"
auto:max="5"
auto:rating="3.7"/>
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/favorite"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/favorite"/>
<TextView
android:id="@+id/torrent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:gravity="center_horizontal"
android:text="@string/torrent"/>
<TextView
android:id="@+id/share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:gravity="center_horizontal"
android:text="@string/share"/>
<TextView
android:id="@+id/rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:gravity="center_horizontal"
android:text="Rate"/>
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 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.
-->
<com.hippo.ehviewer.widget.PreviewLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/preview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"/>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tag"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:paddingTop="16dp"
android:paddingBottom="16dp">
<TextView
android:id="@+id/no_tags"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textColor="@color/theme_accent"
android:text="@string/no_tags"/>
</LinearLayout>
+123 -40
View File
@@ -14,67 +14,90 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<ScrollView
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:auto="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="match_parent"
android:overScrollMode="never"
android:scrollbarThumbVertical="@android:color/transparent">
<LinearLayout
android:id="@+id/detail_content"
<FrameLayout
android:id="@+id/detail_frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="250dp">
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sssss"/>
</LinearLayout>
<LinearLayout
android:id="@+id/detail_header_background"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="@color/theme_primary">
android:layout_height="match_parent"
android:paddingTop="@dimen/gallery_detail_content_margin_top"
android:orientation="vertical">
</FrameLayout>
<include
layout="@layout/gallery_detail_info"/>
<View
android:layout_width="match_parent"
android:layout_height="4dp"
android:background="@drawable/drop_shadow"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginRight="@dimen/keyline_margin"
android:background="@color/divider_light"/>
</LinearLayout>
<include
layout="@layout/gallery_detail_action"/>
<LinearLayout
android:id="@+id/detail_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginRight="@dimen/keyline_margin"
android:background="@color/divider_light"/>
<include
layout="@layout/gallery_detail_tag"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginRight="@dimen/keyline_margin"
android:background="@color/divider_light"/>
<include
layout="@layout/gallery_detail_comment"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginRight="@dimen/keyline_margin"
android:background="@color/divider_light"/>
<include
layout="@layout/gallery_detail_preview"/>
</LinearLayout>
<!-- Header -->
<RelativeLayout
android:id="@+id/header"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:background="@color/theme_primary">
<com.hippo.ehviewer.widget.LoadImageView
android:id="@+id/thumb"
android:layout_width="120dp"
android:layout_height="180dp"
android:layout_width="@dimen/gallery_detail_thumb_width"
android:layout_height="@dimen/gallery_detail_thumb_height"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginTop="@dimen/keyline_margin"
android:layout_marginBottom="@dimen/gallery_detail_thumb_margin_bottom"
tools:ignore="RtlHardcoded"/>
<TextView
@@ -99,13 +122,73 @@
android:layout_marginRight="@dimen/keyline_margin"
tools:ignore="RtlHardcoded"/>
<TextView
android:id="@+id/category"
style="@style/CardMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/title"
android:layout_below="@id/uploader"
android:layout_marginTop="12dp"
android:layout_marginRight="@dimen/keyline_margin"
android:paddingBottom="2dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="2dp"
android:background="@android:color/white"
android:textAllCaps="true"
android:textStyle="bold"
tools:ignore="RtlHardcoded"/>
</RelativeLayout>
</LinearLayout>
<!-- ActionCard -->
<com.hippo.widget.CardLinearLayout
android:id="@+id/action_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/keyline_margin"
android:layout_marginRight="@dimen/keyline_margin"
android:orientation="horizontal"
android:layout_marginTop="@dimen/gallery_detail_action_card_margin_top"
android:layout_marginBottom="8dp"
auto:cardElevation="4dp">
</FrameLayout>
<TextView
android:id="@+id/download"
style="@style/ButtonInCard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/download"/>
</ScrollView>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@color/divider_light"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"/>
<TextView
android:id="@+id/read"
style="@style/ButtonInCard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/theme_accent"
android:text="@string/read"/>
</com.hippo.widget.CardLinearLayout>
</FrameLayout>
</ScrollView>
<ProgressBar
android:id="@+id/progress_bar"
style="@style/ProgressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</FrameLayout>