Просмотр исходного кода

解决水波纹被大量隔断的问题

詹子聪 6 лет назад
Родитель
Сommit
c3da28522b

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

@@ -48,8 +48,8 @@ public class TabActivity extends BaseShiBeiActivity implements View.OnClickListe
         SlidingTabLayout stl_home = findViewById(R.id.stl_home);
         SlidingTabLayout stl_home = findViewById(R.id.stl_home);
         stl_home.setViewPager(vp_main, titles);
         stl_home.setViewPager(vp_main, titles);
 
 
-        ViewTool.setOnClickListener(this, new int[]{R.id.rl_search,
-                R.id.rl_search_top, R.id.rl_search_top_shadow, R.id.rl_more}, this);
+        ViewTool.setOnClickListener(this, new int[]{R.id.fl_search, R.id.fl_search_top,
+                R.id.fl_more}, this);
 
 
         double defaultHeight = getResources().getDimension(R.dimen.margin_default);
         double defaultHeight = getResources().getDimension(R.dimen.margin_default);
         double defaultWidth = getResources().getDimension(R.dimen.height_edit_text);
         double defaultWidth = getResources().getDimension(R.dimen.height_edit_text);
@@ -71,23 +71,14 @@ public class TabActivity extends BaseShiBeiActivity implements View.OnClickListe
     @Override
     @Override
     public void onClick(View v) {
     public void onClick(View v) {
         switch (v.getId()) {
         switch (v.getId()) {
-            case R.id.rl_more:
+            case R.id.fl_more:
                 startActivity(new Intent(this, MineActivity.class));
                 startActivity(new Intent(this, MineActivity.class));
                 break;
                 break;
-
-            case R.id.rl_search_top:
-                ToastTool.showShort("search top");
-                break;
-
-            case R.id.rl_search_top_shadow:
-                ToastTool.showShort("search top shadow");
+            case R.id.fl_search_top:
+            case R.id.fl_search:
+                ToastTool.showShort("search");
                 break;
                 break;
 
 
-            case R.id.rl_search:
-                ToastTool.showShort("search ");
-                break;
-
-
             default:
             default:
                 break;
                 break;
         }
         }

+ 38 - 20
app/src/main/res/layout/activity_tab.xml

@@ -67,31 +67,42 @@
                 <RelativeLayout
                 <RelativeLayout
                     android:id="@+id/rl_search_top_shadow"
                     android:id="@+id/rl_search_top_shadow"
                     android:layout_width="@dimen/height_edit_text"
                     android:layout_width="@dimen/height_edit_text"
-                    android:layout_height="@dimen/height_sliding_tab"
-                    android:background="?attr/selectableItemBackgroundBorderless">
+                    android:layout_height="@dimen/height_sliding_tab">
                     <!--无边界波纹-->
                     <!--无边界波纹-->
-                    <ImageView
-                        android:id="@+id/iv_search_top"
+                    <FrameLayout
+                        android:id="@+id/fl_search_top"
                         android:layout_width="wrap_content"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_centerInParent="true"
                         android:layout_centerInParent="true"
-                        android:src="@drawable/ic_search"
-                        android:tint="@color/black_theme" />
+                        android:padding="@dimen/margin_ss"
+                        android:background="?attr/selectableItemBackgroundBorderless">
+                        <ImageView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:src="@drawable/ic_search"
+                            android:tint="@color/black_theme"/>
+                    </FrameLayout>
+
                 </RelativeLayout>
                 </RelativeLayout>
             </FrameLayout>
             </FrameLayout>
 
 
             <RelativeLayout
             <RelativeLayout
-                android:id="@+id/rl_more"
                 android:layout_width="@dimen/height_edit_text"
                 android:layout_width="@dimen/height_edit_text"
-                android:layout_height="@dimen/height_sliding_tab"
-                android:background="?attr/selectableItemBackgroundBorderless">
+                android:layout_height="@dimen/height_sliding_tab">
                 <!--无边界波纹-->
                 <!--无边界波纹-->
-                <ImageView
+                <FrameLayout
+                    android:id="@+id/fl_more"
                     android:layout_width="wrap_content"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_height="wrap_content"
-                    android:src="@drawable/ic_more_vert"
-                    android:tint="@color/black_theme"
-                    android:layout_centerInParent="true"/>
+                    android:layout_centerInParent="true"
+                    android:padding="@dimen/margin_ss"
+                    android:background="?attr/selectableItemBackgroundBorderless">
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@drawable/ic_more_vert"
+                        android:tint="@color/black_theme"/>
+                </FrameLayout>
             </RelativeLayout>
             </RelativeLayout>
         </LinearLayout>
         </LinearLayout>
 
 
@@ -128,16 +139,23 @@
                 android:id="@+id/rl_search"
                 android:id="@+id/rl_search"
                 android:layout_width="@dimen/height_edit_text"
                 android:layout_width="@dimen/height_edit_text"
                 android:layout_height="@dimen/height_sliding_tab"
                 android:layout_height="@dimen/height_sliding_tab"
-                android:background="?attr/selectableItemBackgroundBorderless"
                 android:visibility="gone">
                 android:visibility="gone">
-                <!--无边界波纹-->
-                <ImageView
-                    android:id="@+id/iv_search"
+
+                <FrameLayout
+                    android:id="@+id/fl_search"
                     android:layout_width="wrap_content"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_height="wrap_content"
-                    android:src="@drawable/ic_search"
-                    android:tint="@color/black_theme"
-                    android:layout_centerInParent="true"/>
+                    android:layout_centerInParent="true"
+                    android:padding="@dimen/margin_ss"
+                    android:background="?attr/selectableItemBackgroundBorderless">
+                    <ImageView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:src="@drawable/ic_search"
+                        android:tint="@color/black_theme"/>
+                </FrameLayout>
+                <!--无边界波纹-->
+
             </RelativeLayout>
             </RelativeLayout>
 
 
         </LinearLayout>
         </LinearLayout>

+ 1 - 1
app/src/main/res/layout/item_goods.xml

@@ -28,7 +28,7 @@
                 android:layout_width="@dimen/size_image_list"
                 android:layout_width="@dimen/size_image_list"
                 android:layout_height="@dimen/size_image_list"
                 android:layout_height="@dimen/size_image_list"
                 android:scaleType="center"
                 android:scaleType="center"
-                android:src="@mipmap/logo_gray" />
+                android:src="@mipmap/logo_gray"/>
 
 
 
 
             <LinearLayout
             <LinearLayout

BIN
app/src/main/res/mipmap-xxxhdpi/logo_gray.png


+ 2 - 2
app/src/main/res/values/colors.xml

@@ -4,6 +4,8 @@
     <color name="colorPrimaryDark">#fafafa</color>
     <color name="colorPrimaryDark">#fafafa</color>
     <color name="colorAccent">@color/green_logo</color>
     <color name="colorAccent">@color/green_logo</color>
 
 
+    <color name="gray">#ededed</color>
+    <color name="grayDark">#adadad</color>
     <color name="gray_text_1">#62656A</color>
     <color name="gray_text_1">#62656A</color>
     <color name="gray_text_2">#5F6267</color>
     <color name="gray_text_2">#5F6267</color>
     <color name="gray_normal">#6D6D6D</color>
     <color name="gray_normal">#6D6D6D</color>
@@ -106,8 +108,6 @@
     <color name="blackAlpha50">#80000000</color>
     <color name="blackAlpha50">#80000000</color>
     <color name="blackAlpha45">#8c000000</color>
     <color name="blackAlpha45">#8c000000</color>
     <color name="blackAlpha20">#cc000000</color>
     <color name="blackAlpha20">#cc000000</color>
-    <color name="gray">#ededed</color>
-    <color name="grayDark">#adadad</color>
     <color name="loading">#cdcdcd</color>
     <color name="loading">#cdcdcd</color>