|
|
@@ -21,12 +21,15 @@ import android.view.ViewGroup;
|
|
|
import android.widget.BaseAdapter;
|
|
|
import android.widget.FrameLayout;
|
|
|
import android.widget.ImageView;
|
|
|
+import android.widget.LinearLayout;
|
|
|
import android.widget.ProgressBar;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.usai.apex.ApexTrackingApplication;
|
|
|
import com.usai.apex.R;
|
|
|
import com.usai.apex.Result.PullRefreshListView;
|
|
|
+import com.usai.apex.ShipMap.ShipMap;
|
|
|
+import com.usai.util.RAUtil;
|
|
|
import com.usai.util.commonUtil;
|
|
|
|
|
|
import org.apache.http.util.EncodingUtils;
|
|
|
@@ -39,7 +42,7 @@ import java.util.Map;
|
|
|
/**
|
|
|
* A simple {@link Fragment} subclass.
|
|
|
*/
|
|
|
-public class TrackingListFragment extends ListFragment {
|
|
|
+public class TrackingListFragment extends ListFragment implements View.OnClickListener{
|
|
|
protected BaseAdapter adapter;
|
|
|
boolean bdirty = false;
|
|
|
// List<Map<String, Object>> list_data;
|
|
|
@@ -77,7 +80,14 @@ TrackingListSearchResult searchresult = new TrackingListSearchResult();
|
|
|
// requestData();
|
|
|
}
|
|
|
|
|
|
-// protected class TrackingListSearchResult implements Serializable
|
|
|
+ public TrackingListFragment self = this;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // protected class TrackingListSearchResult implements Serializable
|
|
|
// {
|
|
|
// private static final long serialVersionUID = 335021506170621905L;
|
|
|
// List<Map<String, Object>> datalist = new ArrayList<Map<String, Object>>();
|
|
|
@@ -268,6 +278,10 @@ TrackingListSearchResult searchresult = new TrackingListSearchResult();
|
|
|
.findViewById(R.id.iv_status);
|
|
|
iv_status.setImageResource((int)result.getData().get(position).get("icon"));
|
|
|
|
|
|
+ // new icon click
|
|
|
+ iv_status.setOnClickListener(self);
|
|
|
+ iv_status.setTag(position);
|
|
|
+
|
|
|
View v=(View) convertView
|
|
|
.findViewById(R.id.v_transport_stage);
|
|
|
|
|
|
@@ -516,6 +530,17 @@ TrackingListSearchResult searchresult = new TrackingListSearchResult();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public static int dp2px(Context context, float dpValue) {
|
|
|
+ float scale = context.getResources().getDisplayMetrics().density;
|
|
|
+ return (int) (dpValue * scale + 0.5f);
|
|
|
+ }
|
|
|
+
|
|
|
+ private ShipMap mShipMap;
|
|
|
+
|
|
|
+ public ShipMap getShipMap() {
|
|
|
+ return mShipMap;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
|
Bundle savedInstanceState) {
|
|
|
@@ -530,6 +555,22 @@ TrackingListSearchResult searchresult = new TrackingListSearchResult();
|
|
|
IntentFilter intentFilter = new IntentFilter("com.apex.broadcast.person_mode");
|
|
|
localBroadcastManager.registerReceiver(mReceiver,intentFilter);
|
|
|
|
|
|
+ // -------------------------
|
|
|
+
|
|
|
+ LinearLayout linearLayout = new LinearLayout(context);
|
|
|
+ linearLayout.setOrientation(LinearLayout.VERTICAL);
|
|
|
+
|
|
|
+ if (this instanceof RecentFragment) {
|
|
|
+
|
|
|
+ ShipMap shipMap = new ShipMap(context);
|
|
|
+ mShipMap = shipMap;
|
|
|
+
|
|
|
+ LinearLayout.LayoutParams mapLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0,1.0f);
|
|
|
+ mapLayoutParams.setMargins(dp2px(context,5),dp2px(context,2),dp2px(context,5),dp2px(context,2));
|
|
|
+
|
|
|
+ linearLayout.addView(shipMap,mapLayoutParams);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
@@ -564,8 +605,11 @@ TrackingListSearchResult searchresult = new TrackingListSearchResult();
|
|
|
lframe.addView(swipeRefreshLayout, new FrameLayout.LayoutParams(
|
|
|
ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
|
|
|
|
- root.addView(lframe, new FrameLayout.LayoutParams(
|
|
|
- ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
|
+ LinearLayout.LayoutParams lfLayoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 0,2.0f);
|
|
|
+ linearLayout.addView(lframe,lfLayoutParams);
|
|
|
+
|
|
|
+// root.addView(lframe, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
|
+ root.addView(linearLayout, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|