mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-02 14:35:21 +00:00
enable cancelling editing nickname with simple UI
This commit is contained in:
parent
b94597a1f6
commit
162b597d4d
@ -274,6 +274,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
private ImageView muteIndicatorImageView;
|
private ImageView muteIndicatorImageView;
|
||||||
private TextView subtitleTextView;
|
private TextView subtitleTextView;
|
||||||
private View homeButtonContainer;
|
private View homeButtonContainer;
|
||||||
|
private View cancelButtonContainer;
|
||||||
|
|
||||||
private AttachmentTypeSelector attachmentTypeSelector;
|
private AttachmentTypeSelector attachmentTypeSelector;
|
||||||
private AttachmentManager attachmentManager;
|
private AttachmentManager attachmentManager;
|
||||||
@ -398,10 +399,12 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
textView.setText(getRecipient().getName());
|
textView.setText(getRecipient().getName());
|
||||||
}
|
}
|
||||||
imm.hideSoftInputFromWindow(v.getWindowToken(),0);
|
imm.hideSoftInputFromWindow(v.getWindowToken(),0);
|
||||||
|
cancelButtonContainer.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
String nickname = DatabaseFactory.getStorage(this).getDisplayName(getRecipient().getAddress().serialize());
|
String nickname = DatabaseFactory.getStorage(this).getDisplayName(getRecipient().getAddress().serialize());
|
||||||
titleTextView.setText(nickname);
|
titleTextView.setText(nickname);
|
||||||
imm.showSoftInput(v, 0);
|
imm.showSoftInput(v, 0);
|
||||||
|
cancelButtonContainer.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1293,6 +1296,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
muteIndicatorImageView = ViewUtil.findById(this, R.id.muteIndicatorImageView);
|
muteIndicatorImageView = ViewUtil.findById(this, R.id.muteIndicatorImageView);
|
||||||
subtitleTextView = ViewUtil.findById(this, R.id.subtitleTextView);
|
subtitleTextView = ViewUtil.findById(this, R.id.subtitleTextView);
|
||||||
homeButtonContainer = ViewUtil.findById(this, R.id.homeButtonContainer);
|
homeButtonContainer = ViewUtil.findById(this, R.id.homeButtonContainer);
|
||||||
|
cancelButtonContainer = ViewUtil.findById(this, R.id.cancelButtonContainer);
|
||||||
|
|
||||||
ImageButton quickCameraToggle = ViewUtil.findById(this, R.id.quick_camera_toggle);
|
ImageButton quickCameraToggle = ViewUtil.findById(this, R.id.quick_camera_toggle);
|
||||||
ImageButton inlineAttachmentButton = ViewUtil.findById(this, R.id.inline_attachment_button);
|
ImageButton inlineAttachmentButton = ViewUtil.findById(this, R.id.inline_attachment_button);
|
||||||
@ -1338,6 +1342,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||||||
inlineAttachmentButton.setOnClickListener(v -> handleAddAttachment());
|
inlineAttachmentButton.setOnClickListener(v -> handleAddAttachment());
|
||||||
|
|
||||||
homeButtonContainer.setOnClickListener(v -> onSupportNavigateUp());
|
homeButtonContainer.setOnClickListener(v -> onSupportNavigateUp());
|
||||||
|
|
||||||
|
cancelButtonContainer.setOnClickListener(v -> {
|
||||||
|
titleTextView.clearFocus();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void initializeActionBar() {
|
protected void initializeActionBar() {
|
||||||
|
@ -99,6 +99,26 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1" />
|
android:layout_weight="1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/cancelButtonContainer"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="18dp"
|
||||||
|
android:layout_height="18dp"
|
||||||
|
android:src="@drawable/ic_baseline_clear_24"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:layout_marginLeft="8dp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.appcompat.widget.Toolbar>
|
</androidx.appcompat.widget.Toolbar>
|
||||||
|
Loading…
Reference in New Issue
Block a user