mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Merge branch 'conversation-layout-tweaks' into 'master'
Layout tweaks for ConversationActivity. Centre the progress wheel and empty list message, hide the empty list message until the list has loaded. See merge request !26
This commit is contained in:
@@ -10,10 +10,10 @@
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/listLoadingProgressBar"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:indeterminate="true"/>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/margin_large"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
android:text="@string/no_private_messages"/>
|
||||
|
||||
@@ -64,6 +64,7 @@ import java.util.logging.Logger;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static java.util.logging.Level.INFO;
|
||||
import static java.util.logging.Level.WARNING;
|
||||
import static org.briarproject.android.contact.ReadPrivateMessageActivity.RESULT_PREV_NEXT;
|
||||
@@ -81,9 +82,9 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
||||
@Inject @CryptoExecutor private Executor cryptoExecutor;
|
||||
private Map<MessageId, byte[]> bodyCache = new HashMap<MessageId, byte[]>();
|
||||
private TextView empty = null;
|
||||
private ProgressBar loading = null;
|
||||
private ConversationAdapter adapter = null;
|
||||
private ListView list = null;
|
||||
private ProgressBar loading = null;
|
||||
private EditText content = null;
|
||||
private ImageButton sendButton = null;
|
||||
|
||||
@@ -114,6 +115,10 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
||||
setContentView(R.layout.activity_conversation);
|
||||
ViewGroup layout = (ViewGroup) findViewById(R.id.layout);
|
||||
empty = (TextView) findViewById(R.id.emptyView);
|
||||
empty.setVisibility(GONE);
|
||||
// Show a progress bar while the list is loading
|
||||
loading = (ProgressBar) findViewById(R.id.listLoadingProgressBar);
|
||||
loading.setVisibility(VISIBLE);
|
||||
|
||||
adapter = new ConversationAdapter(this);
|
||||
list = new ListView(this) {
|
||||
@@ -135,12 +140,9 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
||||
list.setDividerHeight(pad);
|
||||
list.setAdapter(adapter);
|
||||
list.setOnItemClickListener(this);
|
||||
list.setEmptyView(empty);
|
||||
list.setEmptyView(loading);
|
||||
layout.addView(list, 0);
|
||||
|
||||
// Show a progress bar while the list is loading
|
||||
loading = (ProgressBar) findViewById(R.id.listLoadingProgressBar);
|
||||
|
||||
content = (EditText) findViewById(R.id.contentView);
|
||||
sendButton = (ImageButton) findViewById(R.id.sendButton);
|
||||
sendButton.setEnabled(false); // Enabled after loading the group
|
||||
@@ -225,6 +227,8 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
loading.setVisibility(GONE);
|
||||
empty.setVisibility(VISIBLE);
|
||||
list.setEmptyView(empty);
|
||||
displayContactDetails();
|
||||
sendButton.setEnabled(true);
|
||||
adapter.clear();
|
||||
|
||||
Reference in New Issue
Block a user