ソースを参照

1.完成打卡结果页面

wsad5123 5 年 前
コミット
a1c7b8db33

+ 3 - 0
app/src/main/AndroidManifest.xml

@@ -261,6 +261,9 @@
         <activity
             android:name=".ui.activity.cclient.image.CropperImageActivity"
             android:screenOrientation="portrait" />
+        <activity
+            android:name=".ui.activity.cclient.clock.ClockInResultActivity"
+            android:screenOrientation="portrait" />
         <!-- B Client-->
         <activity
             android:name=".ui.activity.bclient.BMainActivity"

+ 40 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/activity/cclient/clock/ClockInResultActivity.java

@@ -1,11 +1,30 @@
 package com.tongyu.luck.happywork.ui.activity.cclient.clock;
 
+import android.graphics.Typeface;
+import android.os.Bundle;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
 import com.tongyu.luck.happywork.R;
+import com.tongyu.luck.happywork.callback.OnActionBarMenuClickListener;
 import com.tongyu.luck.happywork.ui.base.BaseActivity;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.ClockInResultContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.presenter.ClockInResultPresenter;
 
+import butterknife.BindView;
+
 public class ClockInResultActivity extends BaseActivity<ClockInResultPresenter> implements ClockInResultContacts.IClockInResultView {
+    @BindView(R.id.tv_result)
+    TextView tvResult;
+    @BindView(R.id.tv_time)
+    TextView tvTime;
+    @BindView(R.id.tv_money)
+    TextView tvMoney;
+    @BindView(R.id.ll_money)
+    LinearLayout llMoney;
+    @BindView(R.id.tv_day)
+    TextView tvDay;
+
     @Override
     public int getLayoutId() {
         return R.layout.activity_clock_in_result;
@@ -15,4 +34,25 @@ public class ClockInResultActivity extends BaseActivity<ClockInResultPresenter>
     public ClockInResultPresenter bindPresenter() {
         return new ClockInResultPresenter(this);
     }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        initView();
+    }
+
+    OnActionBarMenuClickListener onActionBarMenuClickListener = new OnActionBarMenuClickListener() {
+        @Override
+        public void onClick(int resId) {
+            finish();
+        }
+    };
+
+    private void initView() {
+        setTitle(R.string.clock_happy);
+        setBackVisibility(false);
+        setActionBarMenu(onActionBarMenuClickListener, R.mipmap.ic_clock_result_close);
+        Typeface typeFace = Typeface.createFromAsset(mContext.getAssets(), "fonts/DIN_Condensed_Bold.woff.ttf");
+        tvMoney.setTypeface(typeFace);
+    }
 }

+ 7 - 1
app/src/main/java/com/tongyu/luck/happywork/ui/base/BaseActivity.java

@@ -206,7 +206,13 @@ public abstract class BaseActivity<P extends IPresenter> extends RxAppCompatActi
     public void setOnBackListener(View.OnClickListener onRefreshClickListener) {
         mBaseHolder.setOnBackClickListener(onRefreshClickListener);
     }
-
+    /**
+     * 设置返回按钮是否可见
+     * @param isVisibility
+     */
+    public void setBackVisibility(boolean isVisibility) {
+        mBaseHolder.setBackVisibility(isVisibility);
+    }
     /**
      * C1.2 版本标题风格
      */

+ 8 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/base/BaseActivityHolder.java

@@ -197,6 +197,14 @@ public class BaseActivityHolder extends BaseViewHolder {
         }
     }
 
+    /**
+     * 设置返回按钮是否可见
+     * @param isVisibility
+     */
+    public void setBackVisibility(boolean isVisibility) {
+        llBack.setVisibility(isVisibility ? View.VISIBLE : View.GONE);
+    }
+
 
     /**
      * 设置按钮

+ 12 - 0
app/src/main/java/com/tongyu/luck/happywork/ui/fragment/cclient/ClockInFragment.java

@@ -1,5 +1,6 @@
 package com.tongyu.luck.happywork.ui.fragment.cclient;
 
+import android.content.Intent;
 import android.graphics.Typeface;
 import android.os.Bundle;
 import android.view.LayoutInflater;
@@ -9,12 +10,14 @@ import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.tongyu.luck.happywork.R;
+import com.tongyu.luck.happywork.ui.activity.cclient.clock.ClockInResultActivity;
 import com.tongyu.luck.happywork.ui.base.BaseFragment;
 import com.tongyu.luck.happywork.ui.mvp.cclient.contacts.ClockInFragmentContacts;
 import com.tongyu.luck.happywork.ui.mvp.cclient.presenter.ClockInFragmentPresenter;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
+import butterknife.OnClick;
 import butterknife.Unbinder;
 
 public class ClockInFragment extends BaseFragment<ClockInFragmentPresenter> implements ClockInFragmentContacts.IClockInFragmentView {
@@ -69,6 +72,15 @@ public class ClockInFragment extends BaseFragment<ClockInFragmentPresenter> impl
         super.onDestroyView();
     }
 
+    @OnClick(R.id.v_clock)
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.v_clock:
+                startActivity(new Intent(mContext, ClockInResultActivity.class));
+                break;
+        }
+    }
+
     private void initView() {
         Typeface typeFace = Typeface.createFromAsset(mContext.getAssets(), "fonts/DIN_Condensed_Bold.woff.ttf");
         tvWorkHour.setTypeface(typeFace);

ファイルの差分が大きいため隠しています
+ 0 - 34
app/src/main/res/drawable-v24/ic_launcher_foreground.xml


+ 9 - 0
app/src/main/res/drawable/corners_stroke_black_5dp.xml

@@ -0,0 +1,9 @@
+<?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" />
+    <stroke
+        android:width="2px"
+        android:color="@color/text_black" />
+</shape>

+ 123 - 4
app/src/main/res/layout/activity_clock_in_result.xml

@@ -1,6 +1,125 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.constraint.ConstraintLayout
-    xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
-    android:layout_height="match_parent">
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/gray_bg">
 
-</android.support.constraint.ConstraintLayout>
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+
+        <android.support.v7.widget.CardView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="15dp"
+            android:layout_marginTop="16dp"
+            android:layout_marginRight="15dp"
+            android:layout_marginBottom="16dp"
+            app:cardCornerRadius="10dp"
+            app:cardElevation="2dp">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/white"
+                android:orientation="vertical">
+
+                <TextView
+                    android:id="@+id/tv_result"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="24dp"
+                    android:layout_marginTop="34dp"
+                    android:text="@string/clock_in_success"
+                    android:textColor="@color/text_black"
+                    android:textSize="@dimen/px72_24sp"
+                    android:textStyle="bold" />
+
+                <TextView
+                    android:id="@+id/tv_time"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="24dp"
+                    android:layout_marginTop="5dp"
+                    android:text="打卡时间 08:20"
+                    android:textColor="@color/text_black"
+                    android:textSize="@dimen/px45_15sp" />
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="160dp"
+                    android:layout_marginTop="48dp"
+                    android:background="@mipmap/ic_clock_in_result_bg" />
+
+
+                <LinearLayout
+                    android:id="@+id/ll_money"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginBottom="20dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/clock_today_repay"
+                        android:textColor="@color/text_black"
+                        android:textSize="@dimen/px51_17sp"
+                        android:textStyle="bold" />
+
+                    <TextView
+                        android:id="@+id/tv_money"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="5dp"
+                        android:layout_marginRight="5dp"
+                        android:text="81.7"
+                        android:textColor="@color/blue_01"
+                        android:textSize="@dimen/px84_28sp" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="@string/yuan"
+                        android:textColor="@color/text_black"
+                        android:textSize="@dimen/px51_17sp"
+                        android:textStyle="bold" />
+                </LinearLayout>
+
+                <TextView
+                    android:id="@+id/tv_day"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:text="本月累计打卡 10 天"
+                    android:textColor="@color/text_black"
+                    android:textSize="@dimen/px51_17sp"
+                    android:textStyle="bold" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginTop="5dp"
+                    android:text="@string/clock_result_tips"
+                    android:textColor="@color/text_black_66"
+                    android:textSize="@dimen/px45_15sp" />
+
+                <Button
+                    android:layout_width="269dp"
+                    android:layout_height="43dp"
+                    android:layout_gravity="center_horizontal"
+                    android:layout_marginTop="85dp"
+                    android:layout_marginBottom="96dp"
+                    android:background="@drawable/corners_stroke_black_5dp"
+                    android:text="@string/clock_result_watch"
+                    android:textColor="@color/text_black"
+                    android:textSize="@dimen/px45_15sp" />
+            </LinearLayout>
+
+        </android.support.v7.widget.CardView>
+    </RelativeLayout>
+</ScrollView>

BIN
app/src/main/res/mipmap-hdpi/ic_clock_in_result_bg.png


BIN
app/src/main/res/mipmap-hdpi/ic_clock_result_close.png


BIN
app/src/main/res/mipmap-xhdpi/ic_clock_in_result_bg.png


BIN
app/src/main/res/mipmap-xhdpi/ic_clock_result_close.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_clock_in_result_bg.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_clock_result_close.png


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


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


+ 1 - 0
app/src/main/res/values/dimens.xml

@@ -7,6 +7,7 @@
     <dimen name="px99_33sp">33dp</dimen>
     <dimen name="px93_31sp">31dp</dimen>
     <dimen name="px90_30sp">30dp</dimen>
+    <dimen name="px84_28sp">28dp</dimen>
     <dimen name="px81_27sp">27dp</dimen>
     <dimen name="px78_26sp">26dp</dimen>
     <dimen name="px72_24sp">24dp</dimen>

+ 5 - 0
app/src/main/res/values/strings.xml

@@ -68,9 +68,14 @@
     <string name="statistics">统计</string>
     <string name="service">客服</string>
     <string name="rules">规则</string>
+    <string name="clock_in_success">上班打卡成功</string>
     <string name="clock_in">上班打卡</string>
     <string name="clock_out">下班打卡</string>
     <string name="clock_tips">实际预支发放结合企业考勤,以上金额仅供参考。</string>
+    <string name="clock_result_tips">新的一天开始了,好好工作,天天向上!</string>
+    <string name="clock_result_watch">查看打卡结果</string>
+    <string name="clock_today_repay">今日可预支工资</string>
+    <string name="clock_happy">开心打卡</string>
     <string name="no_finish">未完成</string>
     <!-- C Client-->
     <string name="login_phone">手机登录</string>