Kaynağa Gözat

Apex Mobile
增加communicaiton 框架

Ray Zhang 8 yıl önce
ebeveyn
işleme
772db5d98c

+ 58 - 0
Apex Mobile/app/src/main/java/com/usai/apex/DetailFragment.java

@@ -658,6 +658,64 @@ public class DetailFragment extends Fragment implements OnClickListener /*
 					//
 					// }
 				}
+				if (grouptype.equals("communication"))
+				{
+					LinearLayout listview = (LinearLayout) inflater.inflate(
+							R.layout.list_content, null);
+					listview.setId(commonUtil.generateViewId());
+					control.put(v.getId(), listview.getId());
+					ll_root.addView(listview);
+
+					// 添加收件人和cc
+					ConstraintLayout commu_header = (ConstraintLayout) inflater
+							.inflate(R.layout.commu_item_header, null);
+
+//					TextView tvitem = (TextView) listitem
+//							.findViewById(R.id.tv_item);
+//					String val = groupobj.getString("line" + j);
+//					tvitem.setText(val);
+					// tvitem.setBackgroundResource(R.drawable.detail_item);
+//					listitem.removeView(tvitem);
+
+					listview.addView(commu_header);
+
+
+					long list_count = groupobj.getInt("count");
+					for (int j = 0; j < list_count; j++)
+					{
+						ConstraintLayout msgitem = (ConstraintLayout) inflater
+								.inflate(R.layout.commu_item_msg, null);
+
+//						TextView tvitem = (TextView) listitem
+//								.findViewById(R.id.tv_item);
+//						String val = groupobj.getString("line" + j);
+//						tvitem.setText(val);
+//						// tvitem.setBackgroundResource(R.drawable.detail_item);
+//						listitem.removeView(tvitem);
+
+						listview.addView(msgitem);
+					}
+
+
+//添加 消息输入和发送
+					ConstraintLayout commu_footer = (ConstraintLayout) inflater
+							.inflate(R.layout.commu_item_footer, null);
+
+//					TextView tvitem = (TextView) listitem
+//							.findViewById(R.id.tv_item);
+//					String val = groupobj.getString("line" + j);
+//					tvitem.setText(val);
+					// tvitem.setBackgroundResource(R.drawable.detail_item);
+//					listitem.removeView(tvitem);
+
+					listview.addView(commu_footer);
+					// Iterator itgroup = groupobj.keys();
+					// while (itgroup.hasNext())
+					// {
+					// String keygroup = (String) itgroup.next();
+					//
+					// }
+				}
 				// String value = obj.getString(key);
 				// JSONArray array = obj.getJSONArray(key);
 				// for(int i=0;i<array.length();i++){

+ 1 - 1
Apex Mobile/app/src/main/java/com/usai/apex/mainframe/LoginFragment.java

@@ -78,7 +78,7 @@ public class LoginFragment extends Fragment/* implements OnClickListener */
 		View view = inflater.inflate(R.layout.fragment_login, null);
 		TextView tv_ver = (TextView) view.findViewById(R.id.tv_ver);
 		try {
-			tv_ver.setText(getText(R.string.str_ver)+"2.10." +ApexTrackingApplication.get_instance().getPackageManager().getPackageInfo(
+			tv_ver.setText(getText(R.string.str_ver)+"2.11." +ApexTrackingApplication.get_instance().getPackageManager().getPackageInfo(
 						"com.usai.apex", 0).versionName);
 		} catch (NameNotFoundException e1) {
 			// TODO Auto-generated catch block

+ 33 - 0
Apex Mobile/app/src/main/res/layout/commu_item_footer.xml

@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <EditText
+        android:id="@+id/editText2"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginLeft="8dp"
+        android:layout_marginRight="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:ems="10"
+        android:inputType="textMultiLine"
+        app:layout_constraintEnd_toStartOf="@+id/button3"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <Button
+        android:id="@+id/button3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:text="Button"
+        app:layout_constraintBottom_toBottomOf="@+id/editText2"
+        app:layout_constraintEnd_toEndOf="parent" />
+</android.support.constraint.ConstraintLayout>

+ 56 - 0
Apex Mobile/app/src/main/res/layout/commu_item_header.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/textView2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="4dp"
+        android:layout_marginStart="4dp"
+        android:layout_marginTop="4dp"
+        android:text="Receipt:"
+        android:textStyle="bold"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/textView4"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="4dp"
+        android:layout_marginLeft="4dp"
+        android:layout_marginRight="4dp"
+        android:layout_marginStart="4dp"
+        android:text="TextView"
+        app:layout_constraintBottom_toBottomOf="@+id/textView2"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toEndOf="@+id/textView2" />
+
+    <TextView
+        android:id="@+id/textView5"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="CC:"
+        android:textStyle="bold"
+        app:layout_constraintStart_toStartOf="@+id/textView2"
+        app:layout_constraintTop_toTopOf="@+id/editText" />
+
+    <EditText
+        android:id="@+id/editText"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:ems="10"
+        android:inputType="textEmailAddress"
+        app:layout_constraintEnd_toEndOf="@+id/textView4"
+        app:layout_constraintStart_toEndOf="@+id/textView5"
+        app:layout_constraintTop_toBottomOf="@+id/textView4" />
+
+</android.support.constraint.ConstraintLayout>

+ 56 - 0
Apex Mobile/app/src/main/res/layout/commu_item_msg.xml

@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.constraint.ConstraintLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/textView6"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="Sender"
+        android:textSize="16sp"
+        android:textStyle="bold"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent" />
+
+    <TextView
+        android:id="@+id/textView7"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="message"
+        android:textStyle="bold"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView6" />
+
+    <TextView
+        android:id="@+id/textView8"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="8dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="8dp"
+        android:text="time"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/textView7" />
+
+    <Button
+        android:id="@+id/button4"
+        android:layout_width="wrap_content"
+        android:layout_height="33dp"
+        android:layout_marginBottom="8dp"
+        android:layout_marginEnd="8dp"
+        android:layout_marginRight="8dp"
+        android:text="Email Content"
+        app:layout_constraintBottom_toBottomOf="@+id/textView8"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/textView8" />
+</android.support.constraint.ConstraintLayout>