VancedMicroG/src/org/microg/gms/maps/UiSettingsImpl.java

118 lines
3.5 KiB
Java

package org.microg.gms.maps;
import android.os.RemoteException;
import com.google.android.gms.maps.internal.IUiSettingsDelegate;
public class UiSettingsImpl extends IUiSettingsDelegate.Stub {
private boolean zoomControlsEnabled;
private boolean compassEnabled;
private boolean myLocationButtonEnabled;
private boolean scrollGesturesEnabled;
private boolean zoomGesturesEnabled;
private boolean tiltGesturesEnabled;
private boolean rotateGesturesEnabled;
private UiSettingsListener listener;
public UiSettingsImpl() {
}
public UiSettingsImpl(UiSettingsListener listener) {
this.listener = listener;
}
public void setListener(UiSettingsListener listener) {
this.listener = listener;
}
@Override
public void setZoomControlsEnabled(boolean zoomControlsEnabled) throws RemoteException {
this.zoomControlsEnabled = zoomControlsEnabled;
listener.onUiSettingsChanged(this);
}
@Override
public void setCompassEnabled(boolean compassEnabled) throws RemoteException {
this.compassEnabled = compassEnabled;
listener.onUiSettingsChanged(this);
}
@Override
public void setMyLocationButtonEnabled(boolean myLocationButtonEnabled) throws RemoteException {
this.myLocationButtonEnabled = myLocationButtonEnabled;
listener.onUiSettingsChanged(this);
}
@Override
public void setScrollGesturesEnabled(boolean scrollGesturesEnabled) throws RemoteException {
this.scrollGesturesEnabled = scrollGesturesEnabled;
listener.onUiSettingsChanged(this);
}
@Override
public void setZoomGesturesEnabled(boolean zoomGestures) throws RemoteException {
this.zoomGesturesEnabled = zoomGestures;
listener.onUiSettingsChanged(this);
}
@Override
public void setTiltGesturesEnabled(boolean tiltGesturesEnabled) throws RemoteException {
this.tiltGesturesEnabled = tiltGesturesEnabled;
listener.onUiSettingsChanged(this);
}
@Override
public void setRotateGesturesEnabled(boolean rotateGesturesEnabled) throws RemoteException {
this.rotateGesturesEnabled = rotateGesturesEnabled;
listener.onUiSettingsChanged(this);
}
@Override
public void setAllGesturesEnabled(boolean gestures) throws RemoteException {
scrollGesturesEnabled = gestures;
zoomGesturesEnabled = gestures;
tiltGesturesEnabled = gestures;
rotateGesturesEnabled = gestures;
listener.onUiSettingsChanged(this);
}
@Override
public boolean isZoomControlsEnabled() throws RemoteException {
return zoomControlsEnabled;
}
@Override
public boolean isCompassEnabled() throws RemoteException {
return compassEnabled;
}
@Override
public boolean isMyLocationButtonEnabled() throws RemoteException {
return myLocationButtonEnabled;
}
@Override
public boolean isScrollGesturesEnabled() throws RemoteException {
return scrollGesturesEnabled;
}
@Override
public boolean isZoomGesturesEnabled() throws RemoteException {
return zoomGesturesEnabled;
}
@Override
public boolean isTiltGesturesEnabled() throws RemoteException {
return tiltGesturesEnabled;
}
@Override
public boolean isRotateGesturesEnabled() throws RemoteException {
return rotateGesturesEnabled;
}
public static interface UiSettingsListener {
void onUiSettingsChanged(UiSettingsImpl settings) throws RemoteException;
}
}