Message is displayed when shopping list is empty

This commit is contained in:
Aaron Sun 2020-11-25 18:02:30 -08:00
parent a68ff731bb
commit f573f9ff2c
2 changed files with 8 additions and 4 deletions

View File

@ -234,7 +234,12 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver {
if(list != null) { if(list != null) {
for (ListEntry entry : list.getEntries()) { for (ListEntry entry : list.getEntries()) {
//emptyMessage.setVisibility(View.GONE); this.runOnUiThread(new Runnable() {
@Override
public void run() {
emptyMessage.setVisibility(View.GONE);
}
});
int product = entry.getProductID(); int product = entry.getProductID();
SynchronousReceiver<Item> pr = new SynchronousReceiver<>(); SynchronousReceiver<Item> pr = new SynchronousReceiver<>();
requestor.getObject(Integer.toString(product), Item.class, pr, pr); requestor.getObject(Integer.toString(product), Item.class, pr, pr);
@ -465,7 +470,7 @@ public class ListPage extends AppCompatActivity implements Requestor.Receiver {
} }
if(pNames.isEmpty()) { if(pNames.isEmpty()) {
//emptyMessage.setVisibility(View.VISIBLE); emptyMessage.setVisibility(View.VISIBLE);
} }
myAdapter.notifyDataSetChanged(); myAdapter.notifyDataSetChanged();

View File

@ -58,8 +58,7 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:textSize="20sp" android:textSize="20sp"
android:text="This list is empty." android:text="This list is empty."/>
android:visibility="gone"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"