Add contact info on session info pop-up

This commit is contained in:
Matéo Duparc 2021-05-21 19:40:21 +02:00
parent 2f01c86359
commit f5ca518713
Signed by: hardcoresushi
GPG Key ID: 007F84120107191E
4 changed files with 111 additions and 36 deletions

View File

@ -235,6 +235,17 @@ class ChatActivity : ServiceBoundActivity() {
R.string.incoming
})
}
dialogBinding.textIsContact.text = getString(if (contact == null) {
dialogBinding.fieldIsVerified.visibility = View.GONE
R.string.no
} else {
dialogBinding.textIsVerified.text = getString(if (contact.verified) {
R.string.yes
} else {
R.string.no
})
R.string.yes
})
AlertDialog.Builder(this)
.setTitle(sessionName)
.setView(dialogBinding.root)

View File

@ -11,7 +11,101 @@
android:layout_width="100dp"
android:layout_height="100dp"
app:textSize="20sp"
android:layout_gravity="center_horizontal"/>
android:layout_gravity="center_horizontal"
android:layout_marginBottom="10dp"/>
<LinearLayout
android:id="@+id/online_fields"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/peer_ip"
style="@style/Label"
android:textStyle="bold"/>
<TextView
android:id="@+id/text_ip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/field_value_margin_start"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connection"
style="@style/Label"
android:textStyle="bold"/>
<TextView
android:id="@+id/text_outgoing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/field_value_margin_start"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/is_contact"
style="@style/Label"
android:textStyle="bold"/>
<TextView
android:id="@+id/text_is_contact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/field_value_margin_start"/>
</LinearLayout>
<LinearLayout
android:id="@+id/field_is_verified"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/is_verified"
style="@style/Label"
android:textStyle="bold"/>
<TextView
android:id="@+id/text_is_verified"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/field_value_margin_start"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
@ -26,38 +120,4 @@
android:layout_height="wrap_content"
android:textAlignment="center"/>
<LinearLayout
android:id="@+id/online_fields"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/ip"
style="@style/Label"
android:textStyle="bold"/>
<TextView
android:id="@+id/text_ip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/connection"
style="@style/Label"
android:textStyle="bold"/>
<TextView
android:id="@+id/text_outgoing"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"/>
</LinearLayout>
</LinearLayout>

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="image_button_size">30dp</dimen>
<dimen name="field_value_margin_start">5sp</dimen>
</resources>

View File

@ -17,6 +17,7 @@
<string name="file_saved">File saved !</string>
<string name="enter_password">Enter your password:</string>
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="warning">Warning !</string>
<string name="ask_log_out">Do you really want to log out ? (You will no longer receive messages until you login again)</string>
<string name="cancel">Cancel</string>
@ -62,7 +63,7 @@
<string name="share_label">Send with AIRA</string>
<string name="identity_fingerprint">Your identity\'s fingerprint:</string>
<string name="fingerprint">Fingerprint:</string>
<string name="ip">IP:</string>
<string name="peer_ip">Peer IP:</string>
<string name="connection">Connection:</string>
<string name="outgoing">Outgoing</string>
<string name="incoming">Incoming</string>
@ -84,4 +85,6 @@
<string name="security">Security</string>
<string name="use_psec_padding">Use PSEC padding</string>
<string name="psec_padding_summary">PSEC padding obfuscates the length of your messages but uses more network bandwidth.</string>
<string name="is_contact">Is contact:</string>
<string name="is_verified">Is verified:</string>
</resources>