Browse Source

UI更新2.0

gongpm 9 years ago
parent
commit
1e070b621c

+ 5 - 6
WeiChat/src/main/java/com/sk/weichat/ui/calendar/views/MonthView.java

@@ -576,8 +576,7 @@ public class MonthView extends View {
                         regions.add(region);
                         final String date = centerYear + "-" + centerMonth + "-" +
                                 mCManager.obtainDPInfo(centerYear, centerMonth)[i][j].strG;
-                        final String data= centerYear + "年" + centerMonth + "月" +
-                                mCManager.obtainDPInfo(centerYear, centerMonth)[i][j].strG+"日";
+
                         BGCircle circle = createCircle(
                                 region.getBounds().centerX() + indexMonth * width,
                                 region.getBounds().centerY() + indexYear * height);
@@ -612,9 +611,9 @@ public class MonthView extends View {
                                 @Override
                                 public void onAnimationEnd(Animator animation) {
                                     if (null != onDatePickedListener) {
-                                        datePicker.setMonth(true, data);
+                                        datePicker.setMonth(true, date);
                                         if (isTime)
-                                            onDatePickedListener.onDatePicked(data + "  " + tim);
+                                            onDatePickedListener.onDatePicked(date + "  " + tim);
                                     }
                                 }
                             });
@@ -624,9 +623,9 @@ public class MonthView extends View {
                         if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
                             invalidate();
                             if (null != onDatePickedListener) {
-                                datePicker.setMonth(true, data);
+                                datePicker.setMonth(true, date);
                                 if (isTime)
-                                    onDatePickedListener.onDatePicked(data + "  " + tim);
+                                    onDatePickedListener.onDatePicked(date + "  " + tim);
                             }
                         }
                     } else if (mDPMode == DPMode.MULTIPLE) {

+ 10 - 23
WeiChat/src/main/java/com/sk/weichat/ui/calendar/views/TimeView.java

@@ -20,6 +20,7 @@ public class TimeView extends LinearLayout implements View.OnClickListener {
     private boolean isMonth = false;
     private String month;
     private int time = 0;
+    private String strTime;
     private Context mContext;
     private GridView gv;
     private TextView tvTime;
@@ -51,17 +52,20 @@ public class TimeView extends LinearLayout implements View.OnClickListener {
         gv = (GridView) findViewById(R.id.gv_time);
         gv.setAdapter(new mAdapter());
         tvTime = (TextView) findViewById(R.id.tv_time);
-        findViewById(R.id.img_remove).setOnClickListener(this);
-        findViewById(R.id.img_add).setOnClickListener(this);
         gv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
             @Override
             public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                 time = i + 1;
-                tvTime.setText("" + time);
-                datePicker.setTime(true,time+"时");
+                if (time<10){
+                    strTime="0"+time;
+                }else{
+                    strTime=time+"";
+                }
+                tvTime.setText(strTime);
+                datePicker.setTime(true,strTime);
 //                setTime(time);
                 if (isMonth){
-                    onDatePickedListener.onDatePicked(month+" " + time+"时");
+                    onDatePickedListener.onDatePicked(month+" " + strTime);
                 }
 
             }
@@ -71,24 +75,7 @@ public class TimeView extends LinearLayout implements View.OnClickListener {
 
     @Override
     public void onClick(View view) {
-        switch (view.getId()) {
-            case R.id.img_add:
-                if (time < 24)
-                    time++;
-                else
-                    time = 24;
-                tvTime.setText("" + time);
-                break;
-            case R.id.img_remove:
-                if (time > 0) {
-                    time--;
-
-                } else {
-                    time = 0;
-                }
-                tvTime.setText("" + time);
-                break;
-        }
+
     }
 
     class mAdapter extends BaseAdapter {

+ 4 - 4
WeiChat/src/main/java/com/sk/weichat/ui/erp/activity/AddTaskActivity.java

@@ -270,8 +270,8 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
             @Override
             public void onDatePicked(String date) {
                 Log.i("gongpengming","点击日期"+date);
-                Toast.makeText(AddTaskActivity.this, date, Toast.LENGTH_LONG).show();
-                et_task_startime.setText(date);
+//                Toast.makeText(AddTaskActivity.this, date, Toast.LENGTH_LONG).show();
+                et_task_startime.setText(date+":00:00");
                 dialog.dismiss();
             }
         });
@@ -279,8 +279,8 @@ public class AddTaskActivity extends BaseActivity implements OnClickListener {
             @Override
             public void onDatePicked(String date) {
                 Log.i("gongpengming","点击时间"+date);
-                Toast.makeText(AddTaskActivity.this, date, Toast.LENGTH_LONG).show();
-                et_task_startime.setText(date);
+//                Toast.makeText(AddTaskActivity.this, date, Toast.LENGTH_LONG).show();
+                et_task_startime.setText(date+":00:00");
                 dialog.dismiss();
             }
         });

+ 47 - 8
WeiChat/src/main/res/layout/fragment_works.xml

@@ -33,10 +33,20 @@
                 android:contentDescription="@string/app_name" />
         </RelativeLayout>
 
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/item_line" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:layout_marginTop="7dp"
+            android:background="@color/item_line" />
+
         <RelativeLayout
             android:id="@+id/my_friend_rl"
-            style="@style/IMTbleLine"
-            android:layout_marginTop="7dp">
+            style="@style/IMTbleLine">
 
             <TextView
                 android:id="@+id/tv_zone"
@@ -69,10 +79,20 @@
                 android:contentDescription="@string/app_name" />
         </RelativeLayout>
 
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/item_line" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:layout_marginTop="7dp"
+            android:background="@color/item_line" />
+
         <RelativeLayout
             android:id="@+id/rl_uas_sys"
-            style="@style/IMTbleLine"
-            android:layout_marginTop="7dp">
+            style="@style/IMTbleLine">
 
             <TextView
                 android:layout_width="wrap_content"
@@ -95,10 +115,20 @@
                 android:contentDescription="@string/app_name" />
         </RelativeLayout>
 
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/item_line" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:layout_marginTop="7dp"
+            android:background="@color/item_line" />
+
         <RelativeLayout
             android:id="@+id/setting_rl"
-            style="@style/IMTbleLine"
-            android:layout_marginTop="7dp">
+            style="@style/IMTbleLine">
 
             <TextView
                 android:layout_width="wrap_content"
@@ -121,10 +151,14 @@
                 android:contentDescription="@string/app_name" />
         </RelativeLayout>
 
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/item_line" />
+
         <RelativeLayout
             android:id="@+id/goods_find"
-            style="@style/IMTbleLine"
-            android:layout_marginTop="1dp">
+            style="@style/IMTbleLine">
 
             <TextView
                 android:layout_width="wrap_content"
@@ -146,6 +180,11 @@
                 android:background="@drawable/set_list_next"
                 android:contentDescription="@string/app_name" />
         </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:background="@color/item_line" />
     </LinearLayout>
 
 </ScrollView>

+ 13 - 12
WeiChat/src/main/res/layout/item_date_time.xml

@@ -2,9 +2,14 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:layout_margin="10dp"
+    android:background="@color/bg_main"
     android:gravity="center">
 
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="1dp"
+        android:background="@color/item_line" />
+
     <RelativeLayout
         android:id="@+id/top"
         android:layout_width="match_parent"
@@ -13,26 +18,22 @@
         android:gravity="center">
 
 
-        <ImageView
-            android:id="@+id/img_remove"
+        <TextView
+            android:id="@+id/tvt"
             android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:src="@drawable/add_picture" />
+            android:layout_height="match_parent"
+            android:gravity="center_vertical"
+            android:text="选择时间:" />
 
         <TextView
             android:id="@+id/tv_time"
             android:layout_width="80dp"
             android:layout_height="match_parent"
-            android:layout_toRightOf="@+id/img_remove"
+            android:layout_toRightOf="@+id/tvt"
             android:gravity="center"
             android:hint="时钟" />
 
-        <ImageView
-            android:id="@+id/img_add"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_toRightOf="@+id/tv_time"
-            android:src="@drawable/add_picture" />
+
     </RelativeLayout>
 
     <GridView

+ 1 - 1
build.gradle

@@ -4,7 +4,7 @@ buildscript {
         jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:1.3.0'
+        classpath 'com.android.tools.build:gradle:2.0.0'
     }
 }
 allprojects {