mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Add "Tap to learn more" to message bubbles for timer changes
This commit is contained in:
@@ -400,10 +400,7 @@ public class ConversationActivity extends BriarActivity
|
|||||||
return true;
|
return true;
|
||||||
case R.id.action_conversation_settings:
|
case R.id.action_conversation_settings:
|
||||||
if (contactId == null) return false;
|
if (contactId == null) return false;
|
||||||
ConversationSettingsDialog dialog =
|
onAutoDeleteTimerNoticeClicked();
|
||||||
ConversationSettingsDialog.newInstance(contactId);
|
|
||||||
dialog.show(getSupportFragmentManager(),
|
|
||||||
ConversationSettingsDialog.TAG);
|
|
||||||
return true;
|
return true;
|
||||||
case R.id.action_delete_all_messages:
|
case R.id.action_delete_all_messages:
|
||||||
askToDeleteAllMessages();
|
askToDeleteAllMessages();
|
||||||
@@ -1043,6 +1040,14 @@ public class ConversationActivity extends BriarActivity
|
|||||||
ActivityCompat.startActivity(this, i, options.toBundle());
|
ActivityCompat.startActivity(this, i, options.toBundle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAutoDeleteTimerNoticeClicked() {
|
||||||
|
ConversationSettingsDialog dialog =
|
||||||
|
ConversationSettingsDialog.newInstance(contactId);
|
||||||
|
dialog.show(getSupportFragmentManager(),
|
||||||
|
ConversationSettingsDialog.TAG);
|
||||||
|
}
|
||||||
|
|
||||||
@DatabaseExecutor
|
@DatabaseExecutor
|
||||||
private void respondToIntroductionRequest(SessionId sessionId,
|
private void respondToIntroductionRequest(SessionId sessionId,
|
||||||
boolean accept) throws DbException {
|
boolean accept) throws DbException {
|
||||||
|
|||||||
@@ -81,20 +81,23 @@ abstract class ConversationItemViewHolder extends ViewHolder {
|
|||||||
Context ctx = itemView.getContext();
|
Context ctx = itemView.getContext();
|
||||||
topNotice.setVisibility(VISIBLE);
|
topNotice.setVisibility(VISIBLE);
|
||||||
boolean enabled = item.getAutoDeleteTimer() != NO_AUTO_DELETE_TIMER;
|
boolean enabled = item.getAutoDeleteTimer() != NO_AUTO_DELETE_TIMER;
|
||||||
|
String tapToLearnMore = ctx.getString(R.string.tap_to_learn_more);
|
||||||
String text;
|
String text;
|
||||||
if (item.isIncoming()) {
|
if (item.isIncoming()) {
|
||||||
String name = item.getContactName().getValue();
|
String name = item.getContactName().getValue();
|
||||||
int strRes = enabled ?
|
int strRes = enabled ?
|
||||||
R.string.auto_delete_msg_contact_enabled :
|
R.string.auto_delete_msg_contact_enabled :
|
||||||
R.string.auto_delete_msg_contact_disabled;
|
R.string.auto_delete_msg_contact_disabled;
|
||||||
text = ctx.getString(strRes, name);
|
text = ctx.getString(strRes, name, tapToLearnMore);
|
||||||
} else {
|
} else {
|
||||||
int strRes = enabled ?
|
int strRes = enabled ?
|
||||||
R.string.auto_delete_msg_you_enabled :
|
R.string.auto_delete_msg_you_enabled :
|
||||||
R.string.auto_delete_msg_you_disabled;
|
R.string.auto_delete_msg_you_disabled;
|
||||||
text = ctx.getString(strRes);
|
text = ctx.getString(strRes, tapToLearnMore);
|
||||||
}
|
}
|
||||||
topNotice.setText(text);
|
topNotice.setText(text);
|
||||||
|
topNotice.setOnClickListener(
|
||||||
|
v -> listener.onAutoDeleteTimerNoticeClicked());
|
||||||
} else {
|
} else {
|
||||||
topNotice.setVisibility(GONE);
|
topNotice.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,4 +18,6 @@ interface ConversationListener {
|
|||||||
void onAttachmentClicked(View view, ConversationMessageItem messageItem,
|
void onAttachmentClicked(View view, ConversationMessageItem messageItem,
|
||||||
AttachmentItem attachmentItem);
|
AttachmentItem attachmentItem);
|
||||||
|
|
||||||
|
void onAutoDeleteTimerNoticeClicked();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
android:background="@drawable/notice_in"
|
android:background="@drawable/notice_in"
|
||||||
android:elevation="@dimen/message_bubble_elevation"
|
android:elevation="@dimen/message_bubble_elevation"
|
||||||
android:paddingBottom="@dimen/message_bubble_padding_top"
|
android:paddingBottom="@dimen/message_bubble_padding_top"
|
||||||
|
android:textIsSelectable="false"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:text="@string/auto_delete_msg_contact_enabled"
|
tools:text="@string/auto_delete_msg_contact_enabled"
|
||||||
tools:visibility="visible" />
|
tools:visibility="visible" />
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
android:elevation="@dimen/message_bubble_elevation"
|
android:elevation="@dimen/message_bubble_elevation"
|
||||||
android:paddingBottom="@dimen/message_bubble_padding_top"
|
android:paddingBottom="@dimen/message_bubble_padding_top"
|
||||||
android:textColor="@color/private_message_date_inverse"
|
android:textColor="@color/private_message_date_inverse"
|
||||||
|
android:textIsSelectable="false"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
tools:showIn="@layout/list_item_conversation_msg_out"
|
tools:showIn="@layout/list_item_conversation_msg_out"
|
||||||
tools:text="@string/auto_delete_msg_you_enabled"
|
tools:text="@string/auto_delete_msg_you_enabled"
|
||||||
|
|||||||
@@ -167,10 +167,15 @@
|
|||||||
<string name="set_contact_alias">Change contact name</string>
|
<string name="set_contact_alias">Change contact name</string>
|
||||||
<string name="set_contact_alias_hint">Contact name</string>
|
<string name="set_contact_alias_hint">Contact name</string>
|
||||||
<string name="menu_item_disappearing_messages">Disappearing messages</string>
|
<string name="menu_item_disappearing_messages">Disappearing messages</string>
|
||||||
<string name="auto_delete_msg_you_enabled">Your messages will disappear after 7 days.</string>
|
<!-- The placeholder at the end will add "Tap to learn more." -->
|
||||||
<string name="auto_delete_msg_you_disabled">Your messages will not disappear.</string>
|
<string name="auto_delete_msg_you_enabled">Your messages will disappear after 7 days. %1$s</string>
|
||||||
<string name="auto_delete_msg_contact_enabled">%1$s\'s messages will disappear after 7 days.</string>
|
<!-- The placeholder at the end will add "Tap to learn more." -->
|
||||||
<string name="auto_delete_msg_contact_disabled">%1$s\'s messages will not disappear.</string>
|
<string name="auto_delete_msg_you_disabled">Your messages will not disappear. %1$s</string>
|
||||||
|
<!-- The second placeholder at the end will add "Tap to learn more." -->
|
||||||
|
<string name="auto_delete_msg_contact_enabled">%1$s\'s messages will disappear after 7 days. %2$s</string>
|
||||||
|
<!-- The second placeholder at the end will add "Tap to learn more." -->
|
||||||
|
<string name="auto_delete_msg_contact_disabled">%1$s\'s messages will not disappear. %2$s</string>
|
||||||
|
<string name="tap_to_learn_more">Tap to learn more.</string>
|
||||||
<string name="delete_all_messages">Delete all messages</string>
|
<string name="delete_all_messages">Delete all messages</string>
|
||||||
<string name="dialog_title_delete_all_messages">Confirm Message Deletion</string>
|
<string name="dialog_title_delete_all_messages">Confirm Message Deletion</string>
|
||||||
<string name="dialog_message_delete_all_messages">Are you sure that you want to delete all messages?</string>
|
<string name="dialog_message_delete_all_messages">Are you sure that you want to delete all messages?</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user