Sfoglia il codice sorgente

review
优化主页顶部距离

zengjiebin 7 anni fa
parent
commit
806af79a11

+ 6 - 6
app/src/main/java/com/sheep/gamegroup/view/fragment/FgtFind.java

@@ -52,12 +52,14 @@ public class FgtFind extends BaseFragment {
         initView();
         initData();
     }
+
     Unbinder unbinder;
+
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
         // TODO: inflate a fragment view
         View rootView = super.onCreateView(inflater, container, savedInstanceState);
-        if(rootView != null)
+        if (rootView != null)
             unbinder = ButterKnife.bind(this, rootView);
         return rootView;
     }
@@ -67,8 +69,7 @@ public class FgtFind extends BaseFragment {
         super.onDestroyView();
         unbinder.unbind();
     }
-    @BindView(R.id.layout_navigationBar)
-    View layout_navigationBar;
+
     @BindView(R.id.indicator)
     TabLayout indicator;
     @BindView(R.id.pager)
@@ -77,7 +78,6 @@ public class FgtFind extends BaseFragment {
     private TitleFragmentListAdapter mAdapter;
 
     private void initView() {
-        layout_navigationBar.setVisibility(View.GONE);
         mAdapter = new TitleFragmentListAdapter(getFragmentManager());
         mAdapter.add(FgtFindChild.newInstance(0), "全部");
     }
@@ -85,7 +85,7 @@ public class FgtFind extends BaseFragment {
     private void initData() {
         //尝试获取缓存数据
         List<FindTag> newList = DataUtil.getInstance().getCacheList(ApiKey.articles_tags, FindTag.class);
-        if(ListUtil.isEmpty(newList)){
+        if (ListUtil.isEmpty(newList)) {
             initNetData();
         } else {
             loadList(newList);
@@ -110,7 +110,7 @@ public class FgtFind extends BaseFragment {
                     @Override
                     public void onNext(BaseMessage baseMessage) {
                         List<FindTag> newList = baseMessage.getDatas(FindTag.class);
-                        if(list.isEmpty() && !ListUtil.isEmpty(newList))//有缓存时不会加载,没有缓存时获取到数据会加载
+                        if (list.isEmpty() && !ListUtil.isEmpty(newList))//有缓存时不会加载,没有缓存时获取到数据会加载
                             loadList(newList);
                     }
 

+ 2 - 2
app/src/main/res/layout/act_audit_layout.xml

@@ -11,7 +11,7 @@
         android:layout_height="wrap_content"
         android:background="@mipmap/audit_top_bg"
         android:paddingBottom="@dimen/content_padding_15"
-        android:paddingTop="@dimen/content_padding_15">
+        android:layout_marginTop="5dp">
 
 
         <ImageView
@@ -123,7 +123,7 @@
     <android.support.design.widget.TabLayout
         android:id="@+id/indicator"
         style="@style/style_tab"
-        android:background="@color/white"  />
+        android:background="@color/white" />
 
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"

+ 2 - 6
app/src/main/res/layout/fgt_find.xml

@@ -7,15 +7,11 @@
 
     <View
         android:layout_width="match_parent"
-        android:layout_height="0dp"
-        android:layout_marginTop="24dp" />
-
-    <include layout="@layout/title" />
+        android:layout_height="20dp" />
 
     <android.support.design.widget.TabLayout
         android:id="@+id/indicator"
-        style="@style/style_tab"
-        android:layout_marginTop="7dp" />
+        style="@style/style_tab" />
 
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"

+ 12 - 7
app/src/main/res/layout/fgt_personacenter_item_top.xml

@@ -13,6 +13,8 @@
         <RelativeLayout
             android:id="@+id/layout_navigationBar"
             android:layout_width="match_parent"
+            android:layout_marginTop="10dp"
+            app:layout_constraintTop_toTopOf="parent"
             android:layout_height="?attr/actionBarSize">
 
             <ImageView
@@ -40,21 +42,23 @@
             <!--右边消息图标按钮-->
             <ImageButton
                 android:id="@+id/ibtn_baseactivity_message"
-                android:layout_width="?attr/actionBarSize"
-                android:layout_height="wrap_content"
+                android:layout_width="40dp"
+                android:layout_height="40dp"
+                android:layout_marginEnd="16dp"
                 android:layout_alignParentBottom="true"
-                android:layout_alignParentRight="true"
+                android:layout_alignParentEnd="true"
                 android:background="@color/translate"
                 android:gravity="center"
                 android:src="@mipmap/message_read_icon" />
             <!--右边设置图标按钮-->
             <ImageButton
                 android:id="@+id/ibtn_baseactivity_right"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
+                android:layout_width="40dp"
+                android:layout_height="40dp"
+                android:layout_marginEnd="56dp"
                 android:layout_alignParentBottom="true"
+                android:layout_alignParentEnd="true"
                 android:background="@color/translate"
-                android:layout_toLeftOf="@id/ibtn_baseactivity_message"
                 android:gravity="center"
                 android:src="@mipmap/setting" />
 
@@ -71,11 +75,12 @@
             android:id="@+id/icon_img_iv"
             android:layout_width="55dp"
             android:layout_height="55dp"
+            android:layout_marginTop="60dp"
             android:layout_marginBottom="@dimen/content_padding"
             android:layout_marginStart="@dimen/content_padding_15"
             android:src="@drawable/avatar"
             app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toBottomOf="@+id/layout_navigationBar" />
+            app:layout_constraintTop_toTopOf="parent" />
 
         <TextView
             android:id="@+id/name_tv"