浏览代码

1.优化UI

wsad5123 5 年之前
父节点
当前提交
677f5ec588

+ 1 - 1
app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/CMainActivity.java

@@ -81,7 +81,7 @@ public class CMainActivity extends BaseActivity<MainPresenter> implements MainCo
                 if (!rlHome.isSelected()) {
                     vpContent.setCurrentItem(0);
                     initTabCheck(view);
-                    ActionBarUtils.setStatusBarDarkTheme(this, true);
+                    ActionBarUtils.setStatusBarDarkTheme(this, false);
                 }
                 break;
             case R.id.rl_clock_in:

+ 11 - 9
app/src/main/java/com/tongyu/luck/happywork/ui/fragment/cclient/HomeFragment.java

@@ -22,7 +22,6 @@ import com.tongyu.luck.happywork.baselibrary.AppConstant;
 import com.tongyu.luck.happywork.baselibrary.EventConstant;
 import com.tongyu.luck.happywork.baselibrary.IntentConstant;
 import com.tongyu.luck.happywork.baselibrary.imageloader.ImageLoaderUtil;
-import com.tongyu.luck.happywork.baselibrary.utils.PxUtils;
 import com.tongyu.luck.happywork.baselibrary.widget.ScrollListView;
 import com.tongyu.luck.happywork.baselibrary.widget.banner.ViewPagerBanner;
 import com.tongyu.luck.happywork.baselibrary.widget.banner.ViewPagerIndicator;
@@ -47,6 +46,7 @@ import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.HomeFragmentContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.presenter.HomeFragmentPresenter;
 import com.tongyu.luck.happywork.ui.viewholder.cclient.FooterViewHolder;
 import com.tongyu.luck.happywork.ui.widget.MarqueeTextView;
+import com.tongyu.luck.happywork.utils.ActionBarUtils;
 import com.youth.banner.BannerConfig;
 import com.youth.banner.Transformer;
 import com.youth.banner.listener.OnBannerListener;
@@ -58,17 +58,15 @@ import org.greenrobot.eventbus.Subscribe;
 import java.util.List;
 
 import butterknife.BindView;
+import butterknife.ButterKnife;
 import butterknife.OnClick;
+import butterknife.Unbinder;
 
 public class HomeFragment extends BaseFragment<HomeFragmentPresenter> implements HomeFragmentContacts.IHomeFragmentView {
-    @BindView(R.id.iv_content)
-    ScrollListView ivContent;
-    @BindView(R.id.prl_refresh)
-    ProgressRefreshLayout prlRefresh;
-    @BindView(R.id.v_loc)
-    View vLoc;
     @BindView(R.id.tv_loc)
     TextView tvLoc;
+    @BindView(R.id.v_loc)
+    View vLoc;
     @BindView(R.id.ll_city)
     LinearLayout llCity;
     @BindView(R.id.v_search)
@@ -77,17 +75,21 @@ public class HomeFragment extends BaseFragment<HomeFragmentPresenter> implements
     TextView tvSearch;
     @BindView(R.id.ll_search)
     LinearLayout llSearch;
+    @BindView(R.id.iv_content)
+    ScrollListView ivContent;
+    @BindView(R.id.prl_refresh)
+    ProgressRefreshLayout prlRefresh;
     @BindView(R.id.v_service)
     View vService;
 
     HomeHeaderHolder mHomeHeaderHolder;
     FooterViewHolder mHomeFooterHolder;
     JobListAdapter mAdapter;
-
     @Nullable
     @Override
     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
         View view = super.onCreateView(inflater, container, savedInstanceState);
+        setActionBarBackgroundResource(R.color.blue_01);
         EventBus.getDefault().register(this);
         initView();
         return view;
@@ -259,7 +261,7 @@ public class HomeFragment extends BaseFragment<HomeFragmentPresenter> implements
         prlRefresh.setOnRefreshListener(onRefreshListener);
 
         mHomeHeaderHolder = new HomeHeaderHolder(mContext);
-        mHomeFooterHolder = new FooterViewHolder(mContext, true);
+        mHomeFooterHolder = new FooterViewHolder(mContext, false);
 
         mvpPresenter.init();
 

+ 10 - 10
app/src/main/java/com/tongyu/luck/happywork/ui/viewholder/cclient/PositionListViewHolder.java

@@ -145,16 +145,16 @@ public class PositionListViewHolder extends BaseViewHolder {
     }
 
     public void initView(final PositionListBean bean, int position) {
-        if (isTopInterval) {
-            vMarginTop.setVisibility(View.VISIBLE);
-            vLine.setVisibility(View.GONE);
-        } else if (position == 0) {
-            vMarginTop.setVisibility(View.VISIBLE);
-            vLine.setVisibility(View.VISIBLE);
-        } else {
-            vMarginTop.setVisibility(View.GONE);
-            vLine.setVisibility(View.VISIBLE);
-        }
+//        if (isTopInterval) {
+//            vMarginTop.setVisibility(View.VISIBLE);
+//            vLine.setVisibility(View.GONE);
+//        } else if (position == 0) {
+//            vMarginTop.setVisibility(View.VISIBLE);
+//            vLine.setVisibility(View.VISIBLE);
+//        } else {
+//            vMarginTop.setVisibility(View.GONE);
+//            vLine.setVisibility(View.VISIBLE);
+//        }
         if (isFullType(bean.getPositionCategory())) {
             tvJobName.setText(bean.getPositionName());
             String salary = "";

+ 7 - 0
app/src/main/res/drawable/corners_white_5dp.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--圆角半径-->
+    <corners android:radius="5dp" />
+    <solid
+        android:color="@color/white"/>
+</shape>

+ 20 - 27
app/src/main/res/layout/fragment_home.xml

@@ -7,8 +7,8 @@
 
     <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="@dimen/title_height"
-        android:background="@color/white"
+        android:layout_height="50dp"
+        android:background="@color/blue_01"
         android:gravity="center_vertical"
         android:orientation="horizontal">
 
@@ -19,34 +19,35 @@
             android:gravity="center_vertical"
             android:orientation="horizontal">
 
-            <View
-                android:id="@+id/v_loc"
-                android:layout_width="13dp"
-                android:layout_height="16dp"
-                android:layout_marginLeft="27dp"
-                android:background="@mipmap/ic_location_blue" />
-
             <TextView
                 android:id="@+id/tv_loc"
                 android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="3dp"
-                android:layout_marginRight="23dp"
+                android:layout_height="22dp"
+                android:layout_marginLeft="14dp"
                 android:ellipsize="end"
+                android:gravity="center"
                 android:maxWidth="100dp"
                 android:singleLine="true"
-                android:textColor="@color/text_blue_00"
-                android:textSize="@dimen/px51_17sp" />
+                android:textColor="@color/white"
+                android:textSize="@dimen/px45_15sp" />
+
+            <View
+                android:id="@+id/v_loc"
+                android:layout_width="10dp"
+                android:layout_height="5dp"
+                android:layout_marginLeft="4dp"
+                android:background="@mipmap/ic_white_down" />
         </LinearLayout>
 
 
         <LinearLayout
             android:id="@+id/ll_search"
             android:layout_width="0dp"
-            android:layout_height="36dp"
-            android:layout_marginRight="20dp"
+            android:layout_height="31dp"
+            android:layout_marginLeft="9dp"
+            android:layout_marginRight="14dp"
             android:layout_weight="1"
-            android:background="@drawable/corners_stroke_blue_01_18dp"
+            android:background="@drawable/corners_white_5dp"
             android:gravity="center_vertical"
             android:orientation="horizontal">
 
@@ -56,7 +57,7 @@
                 android:layout_height="14dp"
                 android:layout_marginLeft="12dp"
                 android:layout_marginRight="5dp"
-                android:background="@mipmap/ic_search_gray" />
+                android:background="@mipmap/ic_search_gray_home" />
 
             <TextView
                 android:id="@+id/tv_search"
@@ -66,16 +67,8 @@
                 android:singleLine="true"
                 android:text="@string/home_search_title"
                 android:textColor="@color/text_gray_aa"
-                android:textSize="@dimen/px39_13sp" />
+                android:textSize="@dimen/px36_12sp" />
 
-            <TextView
-                android:layout_width="61dp"
-                android:layout_height="match_parent"
-                android:background="@drawable/corners_blue_01_18dp"
-                android:gravity="center"
-                android:text="@string/search"
-                android:textColor="@color/white"
-                android:textSize="@dimen/px39_13sp" />
         </LinearLayout>
     </LinearLayout>
 

+ 32 - 30
app/src/main/res/layout/item_recycler_home_header.xml

@@ -9,13 +9,13 @@
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="11dp"
         android:background="@color/white"
         android:orientation="vertical">
 
         <android.support.v7.widget.CardView
             android:layout_width="match_parent"
             android:layout_height="133dp"
+            android:visibility="gone"
             android:layout_marginLeft="15dp"
             android:layout_marginTop="10dp"
             android:layout_marginRight="15dp"
@@ -57,6 +57,7 @@
         <View
             android:layout_width="match_parent"
             android:layout_height="1dp"
+            android:visibility="gone"
             android:background="@color/view_line_color_gray" />
 
         <LinearLayout
@@ -64,8 +65,8 @@
             android:layout_height="36dp"
             android:gravity="center_vertical"
             android:orientation="horizontal"
-            android:paddingLeft="15dp"
-            android:paddingRight="15dp">
+            android:paddingLeft="14dp"
+            android:paddingRight="10dp">
 
             <TextView
                 android:layout_width="wrap_content"
@@ -73,7 +74,7 @@
                 android:drawableLeft="@mipmap/ic_home_hot"
                 android:drawablePadding="6dp"
                 android:text="@string/happy_news_title"
-                android:textColor="@color/text_black"
+                android:textColor="@color/text_black_33"
                 android:textSize="@dimen/px39_13sp" />
 
             <com.tongyu.luck.happywork.ui.widget.MarqueeTextView
@@ -93,17 +94,15 @@
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginTop="10dp"
         android:background="@color/white"
         android:orientation="vertical">
 
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="15dp"
+            android:layout_marginLeft="14dp"
             android:layout_marginTop="10dp"
-            android:layout_marginRight="15dp"
-            android:layout_marginBottom="10dp"
+            android:layout_marginRight="14dp"
             android:orientation="horizontal">
 
 
@@ -122,7 +121,8 @@
                 <TextView
                     android:id="@+id/tv_job_type1"
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
+                    android:layout_height="16dp"
+                    android:gravity="center"
                     android:layout_marginTop="5dp"
                     android:text="@string/home_job_type1"
                     android:textColor="@color/text_black_55"
@@ -149,7 +149,8 @@
                 <TextView
                     android:id="@+id/tv_job_type2"
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
+                    android:layout_height="16dp"
+                    android:gravity="center"
                     android:layout_marginTop="5dp"
                     android:text="@string/home_job_type2"
                     android:textColor="@color/text_black_55"
@@ -176,7 +177,8 @@
                 <TextView
                     android:id="@+id/tv_job_type3"
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
+                    android:layout_height="16dp"
+                    android:gravity="center"
                     android:layout_marginTop="5dp"
                     android:text="@string/home_job_type3"
                     android:textColor="@color/text_black_55"
@@ -204,7 +206,8 @@
                 <TextView
                     android:id="@+id/tv_job_type4"
                     android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
+                    android:layout_height="16dp"
+                    android:gravity="center"
                     android:layout_marginTop="5dp"
                     android:text="@string/home_job_type4"
                     android:textColor="@color/text_black_55"
@@ -218,10 +221,10 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="horizontal"
-            android:paddingLeft="15dp"
+            android:paddingLeft="14dp"
             android:paddingTop="10dp"
-            android:paddingRight="15dp"
-            android:paddingBottom="15dp">
+            android:paddingRight="14dp"
+            android:paddingBottom="10dp">
 
             <View
                 android:layout_width="0dp"
@@ -255,20 +258,19 @@
                 android:layout_weight="1" />
         </LinearLayout>
 
-        <View
-            android:layout_width="match_parent"
-            android:layout_height="1dp"
-            android:background="@color/view_line_color_gray" />
-
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="42dp"
-            android:background="@color/white"
-            android:gravity="center_vertical"
-            android:paddingLeft="15dp"
-            android:text="@string/recommend_for_you"
-            android:textColor="@color/text_black_66"
-            android:textSize="@dimen/px39_13sp" />
     </LinearLayout>
-
+    <TextView
+        android:layout_width="match_parent"
+        android:layout_height="38dp"
+        android:background="@color/white"
+        android:gravity="center_vertical"
+        android:paddingLeft="14dp"
+        android:layout_marginTop="5dp"
+        android:text="@string/recommend_for_you"
+        android:textColor="@color/text_black_66"
+        android:textSize="@dimen/px39_13sp" />
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:background="@color/view_line_color_gray" />
 </LinearLayout>

+ 4 - 2
app/src/main/res/layout/item_recycler_job_content.xml

@@ -15,6 +15,7 @@
 
     <RelativeLayout
         android:id="@+id/ll_content"
+        android:layout_marginBottom="5dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:orientation="vertical">
@@ -300,8 +301,8 @@
 
         <View
             android:id="@+id/v_tag"
-            android:layout_width="33dp"
-            android:layout_height="33dp"
+            android:layout_width="29dp"
+            android:layout_height="29dp"
             android:background="@mipmap/ic_list_salary"
             android:visibility="gone" />
     </RelativeLayout>
@@ -311,5 +312,6 @@
         android:id="@+id/v_line"
         android:layout_width="match_parent"
         android:layout_height="1dp"
+android:visibility="gone"
         android:background="@color/view_line_color_gray" />
 </LinearLayout>

二进制
app/src/main/res/mipmap-hdpi/ic_list_salary.png


二进制
app/src/main/res/mipmap-hdpi/ic_search_gray_home.png


二进制
app/src/main/res/mipmap-hdpi/ic_white_down.png


二进制
app/src/main/res/mipmap-xhdpi/ic_list_salary.png


二进制
app/src/main/res/mipmap-xhdpi/ic_search_gray_home.png


二进制
app/src/main/res/mipmap-xhdpi/ic_white_down.png


二进制
app/src/main/res/mipmap-xxhdpi/ic_list_salary.png


二进制
app/src/main/res/mipmap-xxhdpi/ic_search_gray_home.png


二进制
app/src/main/res/mipmap-xxhdpi/ic_white_down.png


二进制
app/src/main/res/mipmap-xxxhdpi/ic_list_salary.png


二进制
app/src/main/res/mipmap-xxxhdpi/ic_search_gray_home.png


二进制
app/src/main/res/mipmap-xxxhdpi/ic_white_down.png