詹子聪 5 rokov pred
rodič
commit
53215821f4

+ 1 - 1
app/src/main/java/com/itant/shibei/ui/TabActivity.java

@@ -95,7 +95,7 @@ public class TabActivity extends BaseBeiActivity implements View.OnClickListener
         ViewTool.setOnClickListener(this, this,
                 new int[]{R.id.fl_search, R.id.fl_search_top, R.id.fl_more});
 
-        double defaultHeight = getResources().getDimension(R.dimen.margin_default);
+        double defaultHeight = -getResources().getDimension(R.dimen.margin_ss);
         double defaultWidth = getResources().getDimension(R.dimen.height_edit_text);
 
         View rl_search_top = findViewById(R.id.rl_search_top);

+ 2 - 2
app/src/main/java/com/itant/shibei/widget/AppbarTranslateListener.java

@@ -112,10 +112,10 @@ public class AppbarTranslateListener implements AppBarLayout.OnOffsetChangedList
 
         // add之后,要紧接动画
         mViewGroup.getOverlay().add(rl_search_top);
-        // 横向移动
+        // 横向移动(向右移动为正)
         ObjectAnimator tranXAnim = ObjectAnimator.ofFloat(rl_search_top, "translationX", (float) (mDefaultWidth*fraction));
         tranXAnim.setDuration(0);
-        // 纵向移动
+        // 纵向移动(向下移动为正)
         ObjectAnimator tranYAnim = ObjectAnimator.ofFloat(rl_search_top, "translationY", (float) (-mDefaultHeight*fraction));
         tranYAnim.setDuration(0);
 

+ 7 - 6
app/src/main/res/layout/activity_tab.xml

@@ -17,11 +17,11 @@
         <!--android:minHeight="?actionBarSize"水波纹居中和gravity属性有关-->
         <LinearLayout
             android:layout_width="match_parent"
-            android:layout_height="64dp"
+            android:layout_height="wrap_content"
             android:paddingStart="@dimen/margin_default"
+            android:paddingEnd="@dimen/margin_s"
             android:orientation="horizontal"
             app:layout_scrollFlags="scroll|enterAlways|snap"
-            android:paddingTop="@dimen/margin_default"
             android:gravity="center_vertical">
             <ImageView
                 android:layout_width="@dimen/size_icon_big"
@@ -35,7 +35,7 @@
                 android:id="@+id/title"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="拾贝 · 精选"
+                android:text="伊甸园"
                 android:textStyle="bold"
                 android:textColor="@color/white"
                 android:textSize="@dimen/size_hello" />
@@ -110,13 +110,14 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="horizontal"
-            android:gravity="center_vertical">
+            android:gravity="center_vertical"
+            android:paddingEnd="@dimen/margin_s">
 
             <com.flyco.tablayout.SlidingTabLayout
                 android:id="@+id/stl_home"
                 android:layout_width="0dp"
                 android:layout_weight="1"
-                android:layout_height="@dimen/height_sliding_tab"
+                android:layout_height="@dimen/height_template_item"
                 android:layout_gravity="center_horizontal"
                 app:tl_iconVisible="false"
                 app:tl_indicator_bounce_enable="false"
@@ -128,7 +129,7 @@
                 app:tl_textSelectColor="@color/white"
                 app:tl_textUnselectColor="#82AFAA"
                 app:tl_textsize="@dimen/size_title_s"
-                app:tl_indicator_margin_bottom="@dimen/margin_s"
+                app:tl_indicator_margin_bottom="@dimen/margin_message"
                 android:layout_marginStart="@dimen/margin_s"
                 android:layout_marginEnd="@dimen/margin_default"/>