|
@@ -300,7 +300,7 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
private ShipMap mTrackingMap;
|
|
private ShipMap mTrackingMap;
|
|
|
- private int mSelectTrackingPosition = -1;
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -312,6 +312,7 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
}
|
|
}
|
|
|
outState.putInt("selectContactPosition",mSelectContactPosition);
|
|
outState.putInt("selectContactPosition",mSelectContactPosition);
|
|
|
outState.putInt("selectTrackingPosition",mSelectTrackingPosition);
|
|
outState.putInt("selectTrackingPosition",mSelectTrackingPosition);
|
|
|
|
|
+ outState.putInt("selectTrackingChild",mSelectTrackingChild);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void configureMap(ShipMap map) {
|
|
private void configureMap(ShipMap map) {
|
|
@@ -352,6 +353,7 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
fragment_content = savedInstanceState.getString("content");
|
|
fragment_content = savedInstanceState.getString("content");
|
|
|
mSelectContactPosition = savedInstanceState.getInt("selectContactPosition");
|
|
mSelectContactPosition = savedInstanceState.getInt("selectContactPosition");
|
|
|
mSelectTrackingPosition = savedInstanceState.getInt("selectTrackingPosition");
|
|
mSelectTrackingPosition = savedInstanceState.getInt("selectTrackingPosition");
|
|
|
|
|
+ mSelectTrackingChild = savedInstanceState.getInt("selectTrackingChild");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -453,6 +455,29 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
public JSONObject mContent;
|
|
public JSONObject mContent;
|
|
|
|
|
|
|
|
private int mSelectContactPosition = -1;
|
|
private int mSelectContactPosition = -1;
|
|
|
|
|
+ private int mSelectTrackingPosition = -1;
|
|
|
|
|
+ private int mSelectTrackingChild = -1;
|
|
|
|
|
+ private View mSelectedTrackingCell = null;
|
|
|
|
|
+
|
|
|
|
|
+ private void selectLocation(View view,int group,int child,JSONObject location) {
|
|
|
|
|
+
|
|
|
|
|
+ if (mSelectedTrackingCell != null) {
|
|
|
|
|
+ mSelectedTrackingCell.setBackgroundColor(Color.WHITE);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ mSelectTrackingPosition = group;
|
|
|
|
|
+ mSelectTrackingChild = child;
|
|
|
|
|
+ mSelectedTrackingCell = view;
|
|
|
|
|
+
|
|
|
|
|
+ if (mSelectedTrackingCell != null) {
|
|
|
|
|
+ mSelectedTrackingCell.setBackgroundColor(Color.LTGRAY);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (mTrackingMap != null && location != null) {
|
|
|
|
|
+ mTrackingMap.showShipAnnotation(location);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
void init(String jstr, LayoutInflater inflater)
|
|
void init(String jstr, LayoutInflater inflater)
|
|
|
{
|
|
{
|
|
@@ -758,28 +783,36 @@ public class DetailFragment extends Fragment implements OnClickListener /*
|
|
|
// ViewGroup.LayoutParams lp1=listitem.getLayoutParams();
|
|
// ViewGroup.LayoutParams lp1=listitem.getLayoutParams();
|
|
|
|
|
|
|
|
final int selectIndex = i;
|
|
final int selectIndex = i;
|
|
|
|
|
+ final int child = j;
|
|
|
|
|
+ final JSONObject location = groupobj.optJSONObject("location");
|
|
|
|
|
+
|
|
|
listitem.setOnClickListener(new OnClickListener() {
|
|
listitem.setOnClickListener(new OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
|
|
|
|
|
- if (mTrackingMap != null) {
|
|
|
|
|
- JSONObject location = groupobj.optJSONObject("location");
|
|
|
|
|
- if (location != null) {
|
|
|
|
|
- mTrackingMap.showShipAnnotation(location);
|
|
|
|
|
- }
|
|
|
|
|
- mSelectTrackingPosition = selectIndex;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if (mTrackingMap != null) {
|
|
|
|
|
+// JSONObject location = groupobj.optJSONObject("location");
|
|
|
|
|
+// if (location != null) {
|
|
|
|
|
+// mTrackingMap.showShipAnnotation(location);
|
|
|
|
|
+// }
|
|
|
|
|
+// mSelectTrackingPosition = selectIndex;
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ selectLocation(v,selectIndex,child,location);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- if (mSelectTrackingPosition == i) {
|
|
|
|
|
- if (mTrackingMap != null) {
|
|
|
|
|
- JSONObject location = groupobj.optJSONObject("location");
|
|
|
|
|
- if (location != null) {
|
|
|
|
|
- mTrackingMap.showShipAnnotation(location);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (mSelectTrackingPosition == selectIndex && mSelectTrackingChild == child) {
|
|
|
|
|
+
|
|
|
|
|
+// if (mTrackingMap != null) {
|
|
|
|
|
+// JSONObject location = groupobj.optJSONObject("location");
|
|
|
|
|
+// if (location != null) {
|
|
|
|
|
+// mTrackingMap.showShipAnnotation(location);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+ selectLocation(listitem,selectIndex,child,location);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|