mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-25 23:38:56 +00:00
Removed all references to google play and firebase.
Removed phone number utils. Slowly remove signal code.
This commit is contained in:
@@ -7,26 +7,18 @@ import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.gms.location.places.Place;
|
||||
import com.google.android.gms.maps.CameraUpdateFactory;
|
||||
import com.google.android.gms.maps.GoogleMap;
|
||||
import com.google.android.gms.maps.MapView;
|
||||
import com.google.android.gms.maps.OnMapReadyCallback;
|
||||
import com.google.android.gms.maps.model.MarkerOptions;
|
||||
|
||||
import network.loki.messenger.R;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.util.concurrent.ListenableFuture;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SettableFuture;
|
||||
|
||||
import network.loki.messenger.R;
|
||||
|
||||
public class SignalMapView extends LinearLayout {
|
||||
|
||||
private MapView mapView;
|
||||
private ImageView imageView;
|
||||
private TextView textView;
|
||||
|
||||
@@ -49,7 +41,6 @@ public class SignalMapView extends LinearLayout {
|
||||
setOrientation(LinearLayout.VERTICAL);
|
||||
LayoutInflater.from(context).inflate(R.layout.signal_map_view, this, true);
|
||||
|
||||
this.mapView = ViewUtil.findById(this, R.id.map_view);
|
||||
this.imageView = ViewUtil.findById(this, R.id.image_view);
|
||||
this.textView = ViewUtil.findById(this, R.id.address_view);
|
||||
}
|
||||
@@ -57,39 +48,8 @@ public class SignalMapView extends LinearLayout {
|
||||
public ListenableFuture<Bitmap> display(final SignalPlace place) {
|
||||
final SettableFuture<Bitmap> future = new SettableFuture<>();
|
||||
|
||||
this.mapView.onCreate(null);
|
||||
this.mapView.onResume();
|
||||
|
||||
this.mapView.setVisibility(View.VISIBLE);
|
||||
this.imageView.setVisibility(View.GONE);
|
||||
|
||||
this.mapView.getMapAsync(new OnMapReadyCallback() {
|
||||
@Override
|
||||
public void onMapReady(final GoogleMap googleMap) {
|
||||
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(place.getLatLong(), 13));
|
||||
googleMap.addMarker(new MarkerOptions().position(place.getLatLong()));
|
||||
googleMap.setBuildingsEnabled(true);
|
||||
googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
|
||||
googleMap.getUiSettings().setAllGesturesEnabled(false);
|
||||
googleMap.setOnMapLoadedCallback(new GoogleMap.OnMapLoadedCallback() {
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
googleMap.snapshot(new GoogleMap.SnapshotReadyCallback() {
|
||||
@Override
|
||||
public void onSnapshotReady(Bitmap bitmap) {
|
||||
future.set(bitmap);
|
||||
imageView.setImageBitmap(bitmap);
|
||||
imageView.setVisibility(View.VISIBLE);
|
||||
mapView.setVisibility(View.GONE);
|
||||
mapView.onPause();
|
||||
mapView.onDestroy();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.textView.setText(place.getDescription());
|
||||
|
||||
return future;
|
||||
|
||||
@@ -7,8 +7,6 @@ import android.text.TextUtils;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.google.android.gms.location.places.Place;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.util.JsonUtils;
|
||||
@@ -17,6 +15,22 @@ import java.io.IOException;
|
||||
|
||||
public class SignalPlace {
|
||||
|
||||
/* Loki - Temporary Placeholders */
|
||||
class LatLng {
|
||||
double latitude;
|
||||
double longitude;
|
||||
LatLng(double latitude, double longitude) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
}
|
||||
}
|
||||
|
||||
class Place {
|
||||
public CharSequence getName() { return ""; }
|
||||
public CharSequence getAddress() { return ""; }
|
||||
LatLng getLatLng() { return new LatLng(0, 0); }
|
||||
}
|
||||
|
||||
private static final String URL = "https://maps.google.com/maps";
|
||||
private static final String TAG = SignalPlace.class.getSimpleName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user