mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 23:29:52 +01:00
Compose button doesn't need to be disabled while headers are loading.
This commit is contained in:
@@ -58,7 +58,6 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
|||||||
private ConversationAdapter adapter = null;
|
private ConversationAdapter adapter = null;
|
||||||
private ListView list = null;
|
private ListView list = null;
|
||||||
private ListLoadingProgressBar loading = null;
|
private ListLoadingProgressBar loading = null;
|
||||||
private ImageButton composeButton = null;
|
|
||||||
|
|
||||||
// Fields that are accessed from background threads must be volatile
|
// Fields that are accessed from background threads must be volatile
|
||||||
@Inject private volatile DatabaseComponent db;
|
@Inject private volatile DatabaseComponent db;
|
||||||
@@ -106,10 +105,9 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
|||||||
|
|
||||||
layout.addView(new HorizontalBorder(this));
|
layout.addView(new HorizontalBorder(this));
|
||||||
|
|
||||||
composeButton = new ImageButton(this);
|
ImageButton composeButton = new ImageButton(this);
|
||||||
composeButton.setBackgroundResource(0);
|
composeButton.setBackgroundResource(0);
|
||||||
composeButton.setImageResource(R.drawable.content_new_email);
|
composeButton.setImageResource(R.drawable.content_new_email);
|
||||||
composeButton.setEnabled(false); // Enabled after loading the headers
|
|
||||||
composeButton.setOnClickListener(this);
|
composeButton.setOnClickListener(this);
|
||||||
layout.addView(composeButton);
|
layout.addView(composeButton);
|
||||||
|
|
||||||
@@ -155,7 +153,6 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
|||||||
public void run() {
|
public void run() {
|
||||||
list.setVisibility(VISIBLE);
|
list.setVisibility(VISIBLE);
|
||||||
loading.setVisibility(GONE);
|
loading.setVisibility(GONE);
|
||||||
composeButton.setEnabled(true);
|
|
||||||
adapter.clear();
|
adapter.clear();
|
||||||
for(MessageHeader h : headers)
|
for(MessageHeader h : headers)
|
||||||
adapter.add(new ConversationItem(h));
|
adapter.add(new ConversationItem(h));
|
||||||
@@ -179,8 +176,7 @@ implements EventListener, OnClickListener, OnItemClickListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Scroll to the first expanded message
|
// Scroll to the first expanded message
|
||||||
if(firstExpanded == -1) list.setSelection(count - 1);
|
list.setSelection(firstExpanded);
|
||||||
else list.setSelection(firstExpanded);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadMessage(final MessageHeader h) {
|
private void loadMessage(final MessageHeader h) {
|
||||||
|
|||||||
Reference in New Issue
Block a user