mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-08 17:25:18 +00:00
Merge branch 'dev' of https://github.com/loki-project/session-android into backup-restore
This commit is contained in:
commit
3311cd0958
@ -192,7 +192,7 @@ dependencies {
|
|||||||
testImplementation 'org.robolectric:shadows-multidex:4.2'
|
testImplementation 'org.robolectric:shadows-multidex:4.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
def canonicalVersionCode = 116
|
def canonicalVersionCode = 118
|
||||||
def canonicalVersionName = "1.6.3"
|
def canonicalVersionName = "1.6.3"
|
||||||
|
|
||||||
def postFixSize = 10
|
def postFixSize = 10
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
android:background="?android:dividerHorizontal"
|
android:background="?android:dividerHorizontal"
|
||||||
android:elevation="1dp" />
|
android:elevation="1dp" />
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.loki.views.TapJackingProofEditText
|
<EditText
|
||||||
style="@style/SessionEditText"
|
style="@style/SessionEditText"
|
||||||
android:id="@+id/publicKeyEditText"
|
android:id="@+id/publicKeyEditText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -176,6 +176,22 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="@string/activity_settings_devices_button_title" />
|
android:text="@string/activity_settings_devices_button_title" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:background="?android:dividerHorizontal" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sendInvitationButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/setting_button_height"
|
||||||
|
android:background="@drawable/setting_button_background"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="@dimen/medium_font_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="Invite" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/seedButtonTopSeparator"
|
android:id="@+id/seedButtonTopSeparator"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
android:background="?android:dividerHorizontal"
|
android:background="?android:dividerHorizontal"
|
||||||
android:elevation="1dp" />
|
android:elevation="1dp" />
|
||||||
|
|
||||||
<org.thoughtcrime.securesms.loki.views.TapJackingProofEditText
|
<EditText
|
||||||
style="@style/SmallSessionEditText"
|
style="@style/SmallSessionEditText"
|
||||||
android:id="@+id/publicKeyEditText"
|
android:id="@+id/publicKeyEditText"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -330,6 +330,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private AttachmentTypeSelector attachmentTypeSelector;
|
private AttachmentTypeSelector attachmentTypeSelector;
|
||||||
private AttachmentManager attachmentManager;
|
private AttachmentManager attachmentManager;
|
||||||
private AudioRecorder audioRecorder;
|
private AudioRecorder audioRecorder;
|
||||||
|
private Handler audioHandler;
|
||||||
|
private Runnable stopRecordingTask;
|
||||||
private BroadcastReceiver securityUpdateReceiver;
|
private BroadcastReceiver securityUpdateReceiver;
|
||||||
private Stub<MediaKeyboard> emojiDrawerStub;
|
private Stub<MediaKeyboard> emojiDrawerStub;
|
||||||
protected HidingLinearLayout quickAttachmentToggle;
|
protected HidingLinearLayout quickAttachmentToggle;
|
||||||
@ -2579,6 +2581,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||||
|
|
||||||
audioRecorder.startRecording();
|
audioRecorder.startRecording();
|
||||||
|
|
||||||
|
audioHandler = new Handler();
|
||||||
|
stopRecordingTask = () -> inputPanel.onRecordReleased();
|
||||||
|
audioHandler.postDelayed(stopRecordingTask, 60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -2588,6 +2594,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecorderFinished() {
|
public void onRecorderFinished() {
|
||||||
|
if (audioHandler != null && stopRecordingTask != null) {
|
||||||
|
audioHandler.removeCallbacks(stopRecordingTask);
|
||||||
|
}
|
||||||
updateToggleButtonState();
|
updateToggleButtonState();
|
||||||
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
||||||
vibrator.vibrate(20);
|
vibrator.vibrate(20);
|
||||||
@ -2629,6 +2638,9 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecorderCanceled() {
|
public void onRecorderCanceled() {
|
||||||
|
if (audioHandler != null && stopRecordingTask != null) {
|
||||||
|
audioHandler.removeCallbacks(stopRecordingTask);
|
||||||
|
}
|
||||||
updateToggleButtonState();
|
updateToggleButtonState();
|
||||||
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
Vibrator vibrator = ServiceUtil.getVibrator(this);
|
||||||
vibrator.vibrate(50);
|
vibrator.vibrate(50);
|
||||||
|
@ -96,6 +96,7 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
notificationsButton.setOnClickListener { showNotificationSettings() }
|
notificationsButton.setOnClickListener { showNotificationSettings() }
|
||||||
chatsButton.setOnClickListener { showChatSettings() }
|
chatsButton.setOnClickListener { showChatSettings() }
|
||||||
// linkedDevicesButton.setOnClickListener { showLinkedDevices() }
|
// linkedDevicesButton.setOnClickListener { showLinkedDevices() }
|
||||||
|
sendInvitationButton.setOnClickListener { sendInvitation() }
|
||||||
seedButton.setOnClickListener { showSeed() }
|
seedButton.setOnClickListener { showSeed() }
|
||||||
clearAllDataButton.setOnClickListener { clearAllData() }
|
clearAllDataButton.setOnClickListener { clearAllData() }
|
||||||
versionTextView.text = String.format(getString(R.string.version_s), "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})")
|
versionTextView.text = String.format(getString(R.string.version_s), "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})")
|
||||||
@ -292,6 +293,15 @@ class SettingsActivity : PassphraseRequiredActionBarActivity() {
|
|||||||
push(intent)
|
push(intent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun sendInvitation() {
|
||||||
|
val intent = Intent()
|
||||||
|
intent.action = Intent.ACTION_SEND
|
||||||
|
val invitation = "Hey, I've been using Session to chat with complete privacy and security. Come join me! Download it at https://getsession.org/. My Session ID is $hexEncodedPublicKey!"
|
||||||
|
intent.putExtra(Intent.EXTRA_TEXT, invitation)
|
||||||
|
intent.type = "text/plain"
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
|
||||||
private fun showSeed() {
|
private fun showSeed() {
|
||||||
SeedDialog().show(supportFragmentManager, "Recovery Phrase Dialog")
|
SeedDialog().show(supportFragmentManager, "Recovery Phrase Dialog")
|
||||||
}
|
}
|
||||||
|
@ -66,33 +66,9 @@ class UserView : LinearLayout {
|
|||||||
val threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(user)
|
val threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(user)
|
||||||
MentionManagerUtilities.populateUserPublicKeyCacheIfNeeded(threadID, context) // FIXME: This is a bad place to do this
|
MentionManagerUtilities.populateUserPublicKeyCacheIfNeeded(threadID, context) // FIXME: This is a bad place to do this
|
||||||
val address = user.address.serialize()
|
val address = user.address.serialize()
|
||||||
if (user.isGroupRecipient) {
|
|
||||||
if ("Session Public Chat" == user.name || user.address.isRSSFeed) {
|
|
||||||
profilePictureView.publicKey = ""
|
|
||||||
profilePictureView.displayName = null
|
|
||||||
profilePictureView.additionalPublicKey = null
|
|
||||||
profilePictureView.isRSSFeed = true
|
|
||||||
} else {
|
|
||||||
val threadID = GroupManager.getThreadIDFromGroupID(address, context)
|
|
||||||
val users = MentionsManager.shared.userPublicKeyCache[threadID]?.toList() ?: listOf()
|
|
||||||
val randomUsers = users.sorted() // Sort to provide a level of stability
|
|
||||||
val pk = randomUsers.getOrNull(0) ?: ""
|
|
||||||
profilePictureView.publicKey = pk
|
|
||||||
profilePictureView.displayName = getUserDisplayName(pk)
|
|
||||||
val apk = randomUsers.getOrNull(1) ?: ""
|
|
||||||
profilePictureView.additionalPublicKey = apk
|
|
||||||
profilePictureView.additionalDisplayName = getUserDisplayName(apk)
|
|
||||||
profilePictureView.isRSSFeed = false
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
profilePictureView.publicKey = address
|
|
||||||
profilePictureView.displayName = getUserDisplayName(address)
|
|
||||||
profilePictureView.additionalPublicKey = null
|
|
||||||
profilePictureView.isRSSFeed = false
|
|
||||||
}
|
|
||||||
actionIndicatorImageView.setImageResource(R.drawable.ic_baseline_edit_24)
|
|
||||||
profilePictureView.glide = glide
|
profilePictureView.glide = glide
|
||||||
profilePictureView.update()
|
profilePictureView.update(user, threadID)
|
||||||
|
actionIndicatorImageView.setImageResource(R.drawable.ic_baseline_edit_24)
|
||||||
nameTextView.text = if (user.isGroupRecipient) user.name else getUserDisplayName(address)
|
nameTextView.text = if (user.isGroupRecipient) user.name else getUserDisplayName(address)
|
||||||
when (actionIndicator) {
|
when (actionIndicator) {
|
||||||
ActionIndicator.None -> {
|
ActionIndicator.None -> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user