mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -158,11 +158,11 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
{
|
||||
private static final String TAG = ConversationActivity.class.getSimpleName();
|
||||
|
||||
public static final String ACCOUNT_ID_EXTRA = TAG + ".account_id";
|
||||
public static final String CHAT_ID_EXTRA = TAG + ".chat_id";
|
||||
public static final String FROM_ARCHIVED_CHATS_EXTRA = TAG + ".from_archived";
|
||||
public static final String TEXT_EXTRA = TAG + ".draft_text";
|
||||
public static final String STARTING_POSITION_EXTRA = TAG + ".starting_position";
|
||||
public static final String ACCOUNT_ID_EXTRA = "account_id";
|
||||
public static final String CHAT_ID_EXTRA = "chat_id";
|
||||
public static final String FROM_ARCHIVED_CHATS_EXTRA = "from_archived";
|
||||
public static final String TEXT_EXTRA = "draft_text";
|
||||
public static final String STARTING_POSITION_EXTRA = "starting_position";
|
||||
|
||||
private static final int PICK_GALLERY = 1;
|
||||
private static final int PICK_DOCUMENT = 2;
|
||||
|
||||
@@ -409,13 +409,16 @@ public class ConversationFragment extends MessageSelectorFragment
|
||||
}
|
||||
|
||||
void setLastSeen(long lastSeen) {
|
||||
getListAdapter().setLastSeen(lastSeen);
|
||||
if (lastSeenDecoration != null) {
|
||||
list.removeItemDecoration(lastSeenDecoration);
|
||||
}
|
||||
if (lastSeen > 0) {
|
||||
lastSeenDecoration = new ConversationAdapter.LastSeenHeader(getListAdapter());
|
||||
list.addItemDecoration(lastSeenDecoration);
|
||||
ConversationAdapter adapter = getListAdapter();
|
||||
if (adapter != null) {
|
||||
adapter.setLastSeen(lastSeen);
|
||||
if (lastSeenDecoration != null) {
|
||||
list.removeItemDecoration(lastSeenDecoration);
|
||||
}
|
||||
if (lastSeen > 0) {
|
||||
lastSeenDecoration = new ConversationAdapter.LastSeenHeader(adapter);
|
||||
list.addItemDecoration(lastSeenDecoration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
|
||||
private static final String OPENPGP4FPR = "openpgp4fpr";
|
||||
private static final String NDK_ARCH_WARNED = "ndk_arch_warned";
|
||||
public static final String CLEAR_NOTIFICATIONS = "clear_notifications";
|
||||
public static final String ACCOUNT_ID_EXTRA = TAG + ".account_id";
|
||||
public static final String ACCOUNT_ID_EXTRA = "account_id";
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicNoActionBarTheme();
|
||||
private final DynamicLanguage dynamicLanguage = new DynamicLanguage();
|
||||
|
||||
@@ -261,7 +261,7 @@ public class ShareActivity extends PassphraseRequiredActionBarActivity implement
|
||||
Intent composeIntent;
|
||||
if (chatId != -1) {
|
||||
composeIntent = getBaseShareIntent(ConversationActivity.class);
|
||||
composeIntent.putExtra(EXTRA_CHAT_ID, chatId);
|
||||
composeIntent.putExtra(ConversationActivity.CHAT_ID_EXTRA, chatId);
|
||||
RelayUtil.setSharedUris(composeIntent, resolvedExtras);
|
||||
startActivity(composeIntent);
|
||||
} else {
|
||||
|
||||
@@ -10,11 +10,10 @@ import org.thoughtcrime.securesms.connect.DcHelper;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
public class MarkReadReceiver extends BroadcastReceiver {
|
||||
private static final String TAG = MarkReadReceiver.class.getSimpleName();
|
||||
public static final String MARK_NOTICED_ACTION = "org.thoughtcrime.securesms.notifications.MARK_NOTICED";
|
||||
public static final String CANCEL_ACTION = "org.thoughtcrime.securesms.notifications.CANCEL";
|
||||
public static final String ACCOUNT_ID_EXTRA = TAG + ".account_id";
|
||||
public static final String CHAT_ID_EXTRA = TAG + ".chat_id";
|
||||
public static final String ACCOUNT_ID_EXTRA = "account_id";
|
||||
public static final String CHAT_ID_EXTRA = "chat_id";
|
||||
|
||||
@Override
|
||||
public void onReceive(final Context context, Intent intent) {
|
||||
|
||||
@@ -37,8 +37,8 @@ public class RemoteReplyReceiver extends BroadcastReceiver {
|
||||
|
||||
public static final String TAG = RemoteReplyReceiver.class.getSimpleName();
|
||||
public static final String REPLY_ACTION = "org.thoughtcrime.securesms.notifications.WEAR_REPLY";
|
||||
public static final String ACCOUNT_ID_EXTRA = TAG + ".account_id";
|
||||
public static final String CHAT_ID_EXTRA = TAG + ".chat_id";
|
||||
public static final String ACCOUNT_ID_EXTRA = "account_id";
|
||||
public static final String CHAT_ID_EXTRA = "chat_id";
|
||||
public static final String EXTRA_REMOTE_REPLY = "extra_remote_reply";
|
||||
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
|
||||
@@ -90,7 +90,7 @@ public class BackupProviderFragment extends Fragment implements DcEventCenter.Dc
|
||||
});
|
||||
}).start();
|
||||
|
||||
getTransferActivity().appendSSID(view.findViewById(R.id.same_network_hint));
|
||||
BackupTransferActivity.appendSSID(getActivity(), view.findViewById(R.id.same_network_hint));
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BackupReceiverFragment extends Fragment implements DcEventCenter.Dc
|
||||
Log.i(TAG, "##### receiveBackup() done with result: "+res);
|
||||
}).start();
|
||||
|
||||
getTransferActivity().appendSSID(sameNetworkHint);
|
||||
BackupTransferActivity.appendSSID(getActivity(), sameNetworkHint);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.thoughtcrime.securesms.qr;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.wifi.WifiInfo;
|
||||
@@ -14,6 +15,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.ActionBar;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
|
||||
import org.thoughtcrime.securesms.ApplicationContext;
|
||||
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
|
||||
import org.thoughtcrime.securesms.BaseActionBarActivity;
|
||||
import org.thoughtcrime.securesms.ConversationListActivity;
|
||||
@@ -211,13 +213,13 @@ public class BackupTransferActivity extends BaseActionBarActivity {
|
||||
.show();
|
||||
}
|
||||
|
||||
public void appendSSID(final TextView textView) {
|
||||
public static void appendSSID(Activity activity, final TextView textView) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
// depending on the android version, getting the SSID requires none, all or one of
|
||||
// ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, ACCESS_WIFI_STATE, ACCESS_NETWORK_STATE and maybe even more.
|
||||
final WifiManager wifiManager = (WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
final WifiManager wifiManager = (WifiManager)activity.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
|
||||
if (wifiManager.isWifiEnabled()) {
|
||||
final WifiInfo info = wifiManager.getConnectionInfo();
|
||||
final String ssid = info.getSSID();
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -49,6 +50,11 @@ public class RegistrationQrActivity extends BaseActionBarActivity {
|
||||
barcodeScannerView = findViewById(R.id.zxing_barcode_scanner);
|
||||
barcodeScannerView.setStatusText(getString(R.string.qrscan_hint) + "\n ");
|
||||
|
||||
View sameNetworkHint = findViewById(R.id.same_network_hint);
|
||||
if (sameNetworkHint != null) {
|
||||
BackupTransferActivity.appendSSID(this, findViewById(R.id.same_network_hint));
|
||||
}
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
init(barcodeScannerView, getIntent(), savedInstanceState);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user