Ray Zhang 12 سال پیش
والد
کامیت
df953ece8a

+ 5 - 1
Apex/AndroidManifest.xml

@@ -56,7 +56,7 @@
         <activity
             android:name="com.usai.apex.DirectTrackingFragment"
             android:label="@string/title_activity_direct_tracking" >
-        </activity>
+        </activity>

         -->
         <activity
             android:name="com.usai.apex.FunctionSelectActivity"
@@ -82,6 +82,10 @@
             android:name="com.usai.apex.LocationDetailActivity"
             android:label="@string/title_activity_location_detail" >
         </activity>
+        <activity
+            android:name="com.usai.apex.InnerMapActivity"
+            android:label="@string/title_activity_inner_map" >
+        </activity>
     </application>
 
 </manifest>

+ 7 - 1
Apex/res/layout-hdpi/activity_function_select.xml

@@ -52,11 +52,17 @@
             android:id="@+id/tableRow1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content" >
-
+            <ImageButton
+                android:id="@+id/ibtn_location"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:src="@drawable/ic_test" />
             <ImageButton
                 android:id="@+id/ibtn_exit"
                 android:src="@drawable/ic_exit" />
 
+
+
         </TableRow>
     </TableLayout>
 

+ 6 - 6
Apex/res/layout/activity_function_select.xml

@@ -52,16 +52,16 @@
             android:id="@+id/tableRow1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content" >
-
-            <ImageButton
-                android:id="@+id/ibtn_exit"
-                android:src="@drawable/ic_exit" />
-
             <ImageButton
-                android:id="@+id/imageButton1"
+                android:id="@+id/ibtn_location"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:src="@drawable/ic_test" />
+            <ImageButton
+                android:id="@+id/ibtn_exit"
+                android:src="@drawable/ic_exit" />
+
+
 
         </TableRow>
     </TableLayout>

+ 17 - 0
Apex/res/layout/activity_inner_map.xml

@@ -0,0 +1,17 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:paddingBottom="@dimen/activity_vertical_margin"
+    android:paddingLeft="@dimen/activity_horizontal_margin"
+    android:paddingRight="@dimen/activity_horizontal_margin"
+    android:paddingTop="@dimen/activity_vertical_margin"
+    tools:context=".InnerMapActivity" >
+
+            <FrameLayout
+                android:id="@+id/map"
+                android:layout_width="fill_parent"
+                android:layout_height="fill_parent" >
+            </FrameLayout>
+
+</RelativeLayout>

+ 9 - 0
Apex/res/menu/inner_map.xml

@@ -0,0 +1,9 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+
+    <item
+        android:id="@+id/action_settings"
+        android:orderInCategory="100"
+        android:showAsAction="never"
+        android:title="@string/action_settings"/>
+
+</menu>

+ 1 - 0
Apex/res/values/strings.xml

@@ -16,5 +16,6 @@
     <string name="title_activity_customize_fields">CustomizeFieldsActivity</string>
     <string name="title_activity_result">ResultActivity</string>
     <string name="title_activity_location_detail">LocationDetail</string>
+    <string name="title_activity_inner_map">InnerMapActivity</string>
 
 </resources>

+ 11 - 1
Apex/src/com/usai/apex/FunctionSelectActivity.java

@@ -100,7 +100,17 @@ public class FunctionSelectActivity extends FragmentActivity implements OnClickL
             System.exit(0);  
             break;
 		}
-			
+		case R.id.ibtn_location:
+		{
+			Log.d("==============", "start location activity");
+			Intent intent = new Intent();
+			intent.setClass(this, InnerMapActivity.class);
+//			intent.putExtra("user", user);
+//			intent.putExtra("password", password);
+//			intent.putExtra("function_name", "Container detail");
+			startActivity(intent);			
+			break;		
+		}
 			
 
 		default:

+ 44 - 0
Apex/src/com/usai/apex/InnerMapActivity.java

@@ -0,0 +1,44 @@
+package com.usai.apex;
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentActivity;
+import android.support.v4.app.FragmentTransaction;
+
+public class InnerMapActivity extends FragmentActivity
+{
+
+	@Override
+	protected void onCreate(Bundle savedInstanceState)
+	{
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_inner_map);
+//		setUpMapIfNeeded();
+	    Fragment slFragment=  new ServiceLocationFragment();
+	    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
+	    ft.replace(R.id.map, slFragment);
+	    ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
+	    ft.addToBackStack("Location");
+	    ft.commit();
+	}
+
+//	@Override
+//	public boolean onCreateOptionsMenu(Menu menu)
+//	{
+//		// Inflate the menu; this adds items to the action bar if it is present.
+//		getMenuInflater().inflate(R.menu.inner_map, menu);
+//		return true;
+//	}
+//    private void setUpMapIfNeeded() {
+//        // Do a null check to confirm that we have not already instantiated the map.
+//        if (mMap == null) {
+//            // Try to obtain the map from the SupportMapFragment.
+//            mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
+//                    .getMap();
+//            // Check if we were successful in obtaining the map.
+//            if (mMap != null) {
+//                setUpMap();
+//            }
+//        }
+//    }
+}