Merge branch 'location-streaming' of https://github.com/deltachat/deltachat-android into location-streaming

This commit is contained in:
cyBerta
2019-03-08 02:01:37 +01:00
6 changed files with 26 additions and 0 deletions
+1
View File
@@ -96,6 +96,7 @@
app:circleColor="@color/location_icon"/>
<TextView android:layout_marginTop="10dp"
android:id="@+id/location_button_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
+5
View File
@@ -63,6 +63,11 @@
android:entryValues="@array/pref_compression_values"
android:defaultValue="0" />
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:defaultValue="false"
android:key="pref_location_streaming_enabled"
android:title="On-demand location streaming"/>
</PreferenceCategory>
<PreferenceCategory android:layout="@layout/preference_divider" />
@@ -415,6 +415,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
inflater.inflate(R.menu.conversation, menu);
if (!Prefs.isLocationStreamingEnabled(this)) {
menu.findItem(R.id.menu_show_map).setVisible(false);
}
if (isGroupConversation()) {
if (isActiveGroup()) {
inflater.inflate(R.menu.conversation_push_group_options, menu);
@@ -30,6 +30,7 @@ import android.widget.PopupWindow;
import org.thoughtcrime.securesms.ApplicationContext;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.permissions.Permissions;
import org.thoughtcrime.securesms.util.Prefs;
import org.thoughtcrime.securesms.util.ViewUtil;
public class AttachmentTypeSelector extends PopupWindow {
@@ -87,6 +88,11 @@ public class AttachmentTypeSelector extends PopupWindow {
this.closeButton.setOnClickListener(new CloseClickListener());
this.recentRail.setListener(new RecentPhotoSelectedListener());
if (!Prefs.isLocationStreamingEnabled(context)) {
this.locationButton.setVisibility(View.GONE);
ViewUtil.findById(layout, R.id.location_button_label).setVisibility(View.GONE);
}
setLocationButtonImage(context);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
@@ -238,6 +238,15 @@ public class Prefs {
}
}
public static boolean isLocationStreamingEnabled(Context context) {
try {
return getBooleanPreference(context, "pref_location_streaming_enabled", false);
}
catch(Exception e) {
return false;
}
}
// ringtone
public static @NonNull Uri getNotificationRingtone(Context context) {
+1
View File
@@ -15,4 +15,5 @@ Messenger functions | [Email-chat](https://github.com/deltachat/spe
Detect mailing list | List-Id ([RFC 2919](https://tools.ietf.org/html/rfc2919)) and Precedence ([RFC 3834](https://tools.ietf.org/html/rfc3834))
Send and receive system messages | Multipart/Report Media Type ([RFC 6522](https://tools.ietf.org/html/rfc6522))
Return receipts | Message Disposition Notification (MDN, [RFC 8098](https://tools.ietf.org/html/rfc8098), [RFC 3503](https://tools.ietf.org/html/rfc3503)) using the Chat-Disposition-Notification-To header
Locations | KML ([Open Geospatial Consortium](http://www.opengeospatial.org/standards/kml/), [Google Dev](https://developers.google.com/kml/))