FANGLH 8 years ago
parent
commit
f95b90f1bf

+ 12 - 7
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/oa/ExpenseReimbursementActivity.java

@@ -12,8 +12,6 @@ import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
-import android.text.Editable;
-import android.text.TextWatcher;
 import android.util.DisplayMetrics;
 import android.util.Log;
 import android.view.Gravity;
@@ -40,7 +38,6 @@ import com.alibaba.fastjson.JSONException;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.serializer.PropertyFilter;
 import com.andreabaccega.widget.FormEditText;
-import com.iflytek.cloud.thirdparty.V;
 import com.lidroid.xutils.HttpUtils;
 import com.lidroid.xutils.ViewUtils;
 import com.lidroid.xutils.exception.HttpException;
@@ -162,6 +159,7 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
 
     private AddCostBean mAddCostBean;
     private List<AddCostBean> mAddCost_list; // popwindow要展示的消费明细类型
+    private String[] default_Cost =  {"交通费","通讯费","招待费","差旅费","办公费","税费","物业费","其他"};
 
     //点击新增需要展示的消费明数据细主表
     private List<CostTypeSingleBean> costtypesinglebeanList;
@@ -860,9 +858,10 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
                 doSingleSelect(money_combdatas,2,getString(R.string.currency),SELECT_CURRENCY);
                 break;
             case R.id.add_details_tv:
-                if ("S".equals(dg_type)){
-                  showEditWindow();
-                }else if ("DF".equals(dg_type)){
+                if ("S".equals(dg_type)) {
+                    showEditWindow();
+//                }else if ("DF".equals(dg_type)){
+                }else {
                     showPopupWindow();
                 }
                 putDownInput();
@@ -1345,7 +1344,13 @@ public class ExpenseReimbursementActivity extends BaseActivity implements View.O
         }
     }
     private void initAddDatas() {
-        if (ListUtils.isEmpty(mAddCost_list)) return;
+        if (ListUtils.isEmpty(mAddCost_list)) {
+            for (int i = 0; i < default_Cost.length; i++) {
+                AddCostBean m = new AddCostBean();
+                m.setFcs_itemname(default_Cost[0]);
+                mAddCost_list.add(m);
+            }
+        }
         if (!ListUtils.isEmpty(costFormModel_list) && ListUtils.isEmpty(selected_detailsData)){
             for (int i = 0; i < costFormModel_list.size(); i++) {
                 selected_detailsData.add(costFormModel_list.get(i).getCost_type());

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/newpedo/service/StepService.java

@@ -107,7 +107,7 @@ public class StepService extends Service implements SensorEventListener {
          */
         nfIntent = new Intent(this, StepSplashActivity.class);
         builder.setContentIntent(PendingIntent.getActivity(this, 0, nfIntent, 0)) // 设置PendingIntent
-               // .setLargeIcon(BitmapFactory.decodeResource(this.getResources(), R.drawable.uuu)) // 设置下拉列表中的图标(大图标)
+                .setLargeIcon(BitmapFactory.decodeResource(this.getResources(), R.drawable.uuu)) // 设置下拉列表中的图标(大图标)
                 .setContentTitle(MyApplication.getInstance().getString(R.string.uu_step_Running_in_the_background)) // 设置下拉列表里的标题
                 .setSmallIcon(R.drawable.uuu) // 设置状态栏内的小图标
                 .setContentText(MyApplication.getInstance().getString(R.string.comeon_more_sport)); // 设置上下文内容

+ 2 - 2
WeiChat/src/main/res/layout/expense_details_menu.xml

@@ -10,10 +10,10 @@
         android:padding="10dp"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:text="若未获取到明细,请前往通讯录下拉获取您的部门信息"
+        android:text="@string/crm_nodatas"
         android:drawableLeft="@drawable/expense_tishi_detail"
         android:background="@color/bg_main"
-        android:visibility="visible"
+        android:visibility="gone"
         />
     <com.xzjmyk.pm.activity.ui.erp.view.CustomerScrollView
         android:layout_width="match_parent"

+ 4 - 4
app_core/commom/build.gradle

@@ -2,13 +2,13 @@ apply plugin: 'com.android.library'
 
 
 android {
-    compileSdkVersion 25
-    buildToolsVersion "25.0.3"
+    compileSdkVersion 24
+    buildToolsVersion "25.0.0"
 
 
     defaultConfig {
         minSdkVersion 9
-        targetSdkVersion 25
+        targetSdkVersion 24
         versionCode 1
         versionName "1.0"
 
@@ -29,6 +29,6 @@ dependencies {
         exclude group: 'com.android.support', module: 'support-annotations'
     })
 
-    compile 'com.android.support:appcompat-v7:25.3.1'
+    compile 'com.android.support:appcompat-v7:24.2.1'
     testCompile 'junit:junit:4.12'
 }

+ 1 - 0
app_core/message/.gitignore

@@ -0,0 +1 @@
+/build

+ 34 - 0
app_core/message/build.gradle

@@ -0,0 +1,34 @@
+apply plugin: 'com.android.library'
+
+
+android {
+    compileSdkVersion 24
+    buildToolsVersion "25.0.3"
+
+
+    defaultConfig {
+        minSdkVersion 14
+        targetSdkVersion 24
+        versionCode 1
+        versionName "1.0"
+
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+    }
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+        }
+    }
+}
+
+dependencies {
+    compile fileTree(dir: 'libs', include: ['*.jar'])
+    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+        exclude group: 'com.android.support', module: 'support-annotations'
+    })
+
+    compile 'com.android.support:appcompat-v7:24.2.1'
+    testCompile 'junit:junit:4.12'
+}

+ 25 - 0
app_core/message/proguard-rules.pro

@@ -0,0 +1,25 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in E:\Android-Studio\sdk/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 26 - 0
app_core/message/src/androidTest/java/com/umano/message/supertoasts/ExampleInstrumentedTest.java

@@ -0,0 +1,26 @@
+package com.umano.message.supertoasts;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumentation test, which will execute on an Android device.
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() throws Exception {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getTargetContext();
+
+        assertEquals("com.umano.fanglh.supertoasts.test", appContext.getPackageName());
+    }
+}

+ 2 - 0
app_core/message/src/main/AndroidManifest.xml

@@ -0,0 +1,2 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.umano.message.supertoasts" />

+ 47 - 0
app_core/message/src/main/java/com/umano/message/supertoasts/interfacepack/BaseToast.java

@@ -0,0 +1,47 @@
+package com.umano.message.supertoasts.interfacepack;
+
+import android.app.Activity;
+import android.content.Context;
+import android.text.Layout;
+
+/**
+ * 统一规范消息组件的调用
+ * 方向:底部,中部,顶部
+ * 监听事件:
+ * 样式:
+ * 第一步:构建指定参数的公共接口
+ * 第二步:通过builder模式传入大量自定义化参数的接口
+ * Created by Arison on 2017/5/25.
+ * messageColor:字体颜色,不设置传-1
+ * background:背景颜色,不设置传-1
+ */
+public interface BaseToast {
+    
+    /**
+      * @desc:APP系统级别的消息提示
+      *        与Activity生命周期无关
+      *  @author:Arison
+     */
+    void show(String text,int messageColor, int background);
+    void showAtTop(String text,int messageColor, int background);
+    void showAtCenter(String text,int messageColor, int background);
+    void showAtBottom(String text,int messageColor, int background);
+    void showAtNotiftion(Class<? extends Activity> clazz,String title, String text);
+    void CustomLayout(Layout layout);
+
+    /**
+      * @desc:Activity 生命周期绑定的消息提示
+      * @author:Arison 
+      */
+    void show(Context ct, String text,int messageColor, int background);
+    void showAtTop(Context ct, String text,int messageColor, int background);
+    void showAtCenter(Context ct, String text,int messageColor, int background);
+    void showAtBottom(Context ct, String text,int messageColor, int background);
+    void showAtNotiftion(Context ct,Class<? extends Activity> clazz, String title,String text);
+    void CustomLayout(Context ct,Layout layout);
+
+    /**
+     * 自定义布局
+     */
+
+}

+ 147 - 0
app_core/message/src/main/java/com/umano/message/supertoasts/utils/ToastImpl.java

@@ -0,0 +1,147 @@
+package com.umano.message.supertoasts.utils;
+
+import android.app.Activity;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.app.NotificationCompat;
+import android.text.Layout;
+import android.view.Gravity;
+import android.view.View;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.umano.message.supertoasts.R;
+import com.umano.message.supertoasts.interfacepack.BaseToast;
+
+
+/**
+ * Created by FANGlh on 2017/8/10.
+ * function:
+ */
+
+public class ToastImpl implements BaseToast {
+    private static ToastImpl instance;
+    public static ToastImpl getInstance(){
+        if (instance==null){
+            synchronized (ToastImpl.class){
+                if (instance==null){
+                    instance=new ToastImpl();
+                }
+            }
+        }
+        return  instance;
+    }
+
+
+    @Override
+    public void show(String text,int messageColor, int background) {
+//        ToastUtils.showLong(text);
+    }
+
+    @Override
+    public void showAtTop(String text,int messageColor, int background) {
+    }
+
+    @Override
+    public void showAtCenter(String text,int messageColor, int background) {
+
+    }
+
+    @Override
+    public void showAtBottom(String text,int messageColor, int background) {
+
+    }
+
+    @Override
+    public void showAtNotiftion(Class<? extends Activity> clazz, String title, String text) {
+
+    }
+
+    @Override
+    public void CustomLayout(Layout layout) {
+
+    }
+
+
+    @Override
+    public void show(Context ct, String text,int messageColor, int background) {
+        Toast toast = null;
+        toast = Toast.makeText(ct, text, Toast.LENGTH_LONG);
+        View view = toast.getView();
+        TextView message=((TextView) view.findViewById(android.R.id.message));
+        if (background != -1)
+            message.setBackgroundColor(background);
+        if (messageColor != -1)
+            message.setTextColor(messageColor);
+        toast.show();
+    }
+
+    @Override
+    public void showAtTop(Context ct, String text,int messageColor, int background) {
+        Toast toast = null;
+        toast = Toast.makeText(ct, text, Toast.LENGTH_LONG);
+        //设置Toast的位置
+        toast.setGravity(Gravity.TOP, toast.getXOffset()/2, toast.getYOffset()/5);
+        View view = toast.getView();
+        TextView message=((TextView) view.findViewById(android.R.id.message));
+        if (background != -1)
+            message.setBackgroundColor(background);
+        if (messageColor != -1)
+            message.setTextColor(messageColor);
+        toast.show();
+    }
+
+    @Override
+    public void showAtCenter(Context ct, String text,int messageColor, int background) {
+        Toast toast = null;
+        toast = Toast.makeText(ct, text, Toast.LENGTH_LONG);
+        //设置Toast的位置
+        toast.setGravity(Gravity.CENTER, toast.getXOffset()/2, toast.getYOffset()/2);
+        View view = toast.getView();
+        TextView message=((TextView) view.findViewById(android.R.id.message));
+        if (background != -1)
+            message.setBackgroundColor(background);
+        if (messageColor != -1)
+            message.setTextColor(messageColor);
+        toast.show();
+    }
+
+    @Override
+    public void showAtBottom(Context ct, String text,int messageColor, int background) {
+        Toast toast = null;
+        toast = Toast.makeText(ct, text, Toast.LENGTH_LONG);
+        //设置Toast的位置
+        toast.setGravity(Gravity.BOTTOM, toast.getXOffset()/2, toast.getYOffset()/5);
+        View view = toast.getView();
+        TextView message=((TextView) view.findViewById(android.R.id.message));
+        if (background != -1)
+            message.setBackgroundColor(background);
+        if (messageColor != -1)
+            message.setTextColor(messageColor);
+        toast.show();
+    }
+
+    @Override
+    public void showAtNotiftion(Context ct,Class<? extends Activity> clazz, String title, String text) {
+        NotificationManager mNotificationManager = (NotificationManager) ct.getSystemService(Context.NOTIFICATION_SERVICE);
+        NotificationCompat.Builder builder = new NotificationCompat.Builder(ct.getApplicationContext());
+        builder.setSmallIcon(R.drawable.uuu);
+        builder.setDefaults(Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
+        builder.setAutoCancel(true);
+        builder.setContentTitle(title);
+        builder.setContentText(text);
+        Intent intent = new Intent(ct, clazz);
+        PendingIntent pendingIntent = PendingIntent.getActivity(ct.getApplicationContext(), 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
+        builder.setContentIntent(pendingIntent);
+        mNotificationManager.notify(1000, builder.build());
+    }
+
+    @Override
+    public void CustomLayout(Context ct, Layout layout) {
+
+    }
+
+}

+ 33 - 0
app_core/message/src/main/java/com/umano/message/supertoasts/utils/ToastUtils.java

@@ -0,0 +1,33 @@
+package com.umano.message.supertoasts.utils;
+
+import com.umano.message.supertoasts.interfacepack.BaseToast;
+
+/**
+ * 全局消息调用层
+ * Created by Arison on 2017/5/27.
+ */
+
+public class ToastUtils  {
+    private BaseToast mToast;
+    private static ToastUtils instance;
+
+    public ToastUtils(BaseToast toast){
+        mToast= toast;
+    }
+
+    public static ToastUtils create(BaseToast mToast){
+        if (instance==null){
+            synchronized (ToastUtils.class){
+                if (instance==null){
+                    instance=new ToastUtils(mToast);
+                }
+            }
+        }
+        return  instance;
+    }
+
+
+    public  BaseToast Builder(){
+        return  mToast;
+    }
+}

+ 10 - 0
app_core/message/src/main/java/com/umano/message/supertoasts/utils/ViewUtils.java

@@ -0,0 +1,10 @@
+package com.umano.message.supertoasts.utils;
+
+/**
+ * Created by FANGlh on 2017/8/10.
+ * function:
+ */
+
+public class ViewUtils {
+
+}

BIN
app_core/message/src/main/res/drawable-hdpi/uuu.png


BIN
app_core/message/src/main/res/drawable-xhdpi/uuu.png


BIN
app_core/message/src/main/res/drawable-xxhdpi/uuu.png


+ 3 - 0
app_core/message/src/main/res/values/strings.xml

@@ -0,0 +1,3 @@
+<resources>
+    <string name="app_name">SuperToasts</string>
+</resources>

+ 17 - 0
app_core/message/src/test/java/com/umano/message/supertoasts/ExampleUnitTest.java

@@ -0,0 +1,17 @@
+package com.umano.message.supertoasts;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() throws Exception {
+        assertEquals(4, 2 + 2);
+    }
+}

+ 4 - 3
settings.gradle

@@ -1,10 +1,11 @@
 //主工程
-include ':WeiChat'
+include ':WeiChat', ':commontoasts'
 
 //核心模块
 include ':network'
 include ':imageload'
-include  ':commom'
+include ':commom'
+include ':message'
 
 //第三库模块
 include ':lib-zxing'
@@ -22,7 +23,7 @@ include ':pullToRefershLibraryMy'
 project(':network').projectDir = new File('app_core/network')
 project(':imageload').projectDir = new File('app_core/imageload')
 project(':commom').projectDir = new File('app_core/commom')
-
+project(':message').projectDir = new File('app_core/message')
 
 //第三库模块
 project(':lib-zxing').projectDir = new File('app_third/lib-zxing')