daimajia / daimajia/AndroidSwipeLayout
google map is not working
- Dominant language
- Java
- Stars
- 12.3k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
I have tried to import a google map fragment with relativelayout within the swipe component and it is not working.
It affects the another items too.
``` xml
```
I tried to implement with the google code like so
``` java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.act_order);
orderFragement of = (orderFragement) getFragmentManager().findFragmentById(R.id.order_fragement);
dialog_collection = new DialogTools(this);
driver_control = new DriverControl(new DialogTools(this), new DealFace(), new Identity(this), of);
driver_control.initView(this);
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
MapFragment mf = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
mMap = mf.getMap();
if (mMap != null) {
installMap();
}
}
//setDealReportTime
}
private void installMap() {
final BitmapDescriptor Bdescriptor = BitmapDescriptorFactory.fromResource(R.drawable.car);
mo = new MarkerOptions()
.position(currentLatLng)
// .snippet("Job" + Content.current_job_task.getID())
//.title("Job" + Content.current_job_task.getID())
.icon(Bdescriptor)
.draggable(true);
// .flat(true);
//.rotation(3f);
mMap.setMyLocationEnabled(true);
mMap.getUiSettings().setCompassEnabled(true);
mMap.getUiSettings().setZoomControlsEnabled(true);
mMap.getUiSettings().setMyLocationButtonEnabled(true);
mMap.getUiSettings().setTiltGesturesEnabled(true);
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
mMap.setTrafficEnabled(false);
mMap.setBuildingsEnabled(false);
mMap.setIndoorEnabled(false);
mMap.setOnMyLocationButtonClickListener(this);
mMap.setOnMyLocationChangeListener(this);
// mMap.setPadding(0, 10, 0, 0);
mMap.setOnMarkerDragListener(this);
if (hasSavedInstance()) {
mapType = saved_instance.getInt("map_type", GoogleMap.MAP_TYPE_NORMAL);
double savedLat = saved_instance.getDouble("lat", 0.0000d);
double savedLng = saved_instance.getDouble("lng", 0.0000d);
currentLatLng = new LatLng(savedLat, savedLng);
cameraZoom = saved_instance.getFloat("zoom", Config._default.cameraZoomDefault);
} else {
cameraZoom = Config._default.cameraZoomDefault;
}
// mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(currentLatLng, cameraZoom));
// markerP = mMap.addMarker(mo);
}
```
With DriverControl class
``` java
public class DriverControl {
private ImageButton callcustomer, report_time_est, start, release;
private DialogTools dialog_collection;
private DealFace dealSet;
private OrderView _ctx;
private Identity logininfo;
private static String TAG = "Driver Control";
private orderFragement order_f;
private SwipeLayout map_panel_swipe;
public DriverControl(DialogTools drt, DealFace df, Identity id, orderFragement orderf) {
this.dialog_collection = drt;
this.logininfo = id;
this.dealSet = df;
this.order_f = orderf;
}
public void initView(OrderView ctxx) {
_ctx = ctxx;
callcustomer = (ImageButton) _ctx.findViewById(R.id.call_customer);
report_time_est = (ImageButton) _ctx.findViewById(R.id.report_time_est);
start = (ImageButton) _ctx.findViewById(R.id.start_taxi_now);
release = (ImageButton) _ctx.findViewById(R.id.release_order);
map_panel_swipe = (SwipeLayout)_ctx.findViewById(R.id.control_panel_driver);
// map_panel_swipe.setDragEdge(SwipeLayout.DragEdge.Top);
// map_panel_swipe.setShowMode(SwipeLayout.ShowMode.PullOut);
//timer
callcustomer.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
CallCustomer();
}
});
release.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog_collection.writeNote(
new MaterialDialog.ListCallback() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int i, CharSequence charSequence) {
switch (i) {
case 0:
// CallRemove();
break;
case 1:
CallPrompt(new CallRecordStatusChange(Config.current_view_order.getOrderId(), logininfo.getNumbr(), "public"),
new Runnable() {
@Override
public void run() {
_ctx.finish();
dialog_collection.progress_bar_dismiss();
}
});
break;
}
}
});
}
});
report_time_est.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog_collection.deal(
new MaterialDialog.ListCallback() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int i, CharSequence charSequence) {
dealSet.setDeal(
Config.current_view_order.getOrderId(),
logininfo.getNumbr(),
charSequence.toString()
);
CallsetDeal();
//report the time
}
});
}
});
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
CallPrompt(new CallRecordStatusChange(Config.current_view_order.getOrderId(), logininfo.getNumbr(), "stage2"),
new Runnable() {
@Override
public void run() {
dialog_collection.progress_bar_dismiss();
start_customer_prompt();
dialog_collection.progress_bar_start(R.string.waiting_customer_res_prompt);
}
});
}
});
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.