Previously, we were always rendering images as squares. Instead of doing that, we now render them as close to true-to-size as possible (within reasonable min/max width/height boundaries).
37 lines
791 B
Java
37 lines
791 B
Java
package org.thoughtcrime.securesms.mms;
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
import android.support.annotation.NonNull;
|
|
|
|
import org.thoughtcrime.securesms.components.location.SignalPlace;
|
|
import org.whispersystems.libsignal.util.guava.Optional;
|
|
|
|
public class LocationSlide extends ImageSlide {
|
|
|
|
@NonNull
|
|
private final SignalPlace place;
|
|
|
|
public LocationSlide(@NonNull Context context, @NonNull Uri uri, long size, @NonNull SignalPlace place)
|
|
{
|
|
super(context, uri, size, 0, 0);
|
|
this.place = place;
|
|
}
|
|
|
|
@Override
|
|
@NonNull
|
|
public Optional<String> getBody() {
|
|
return Optional.of(place.getDescription());
|
|
}
|
|
|
|
@NonNull
|
|
public SignalPlace getPlace() {
|
|
return place;
|
|
}
|
|
|
|
@Override
|
|
public boolean hasLocation() {
|
|
return true;
|
|
}
|
|
|
|
}
|