mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-23 23:31:20 +01:00
Added loading screen to OrganizeQueueActivity
This commit is contained in:
parent
1871817f71
commit
79cb4b35a8
@ -30,6 +30,13 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/no_items_label" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progLoading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:indeterminateOnly="true" />
|
||||
|
||||
<LinearLayout android:id="@+id/undobar" style="@style/UndoBar">
|
||||
<TextView android:id="@+id/undobar_message" style="@style/UndoBarMessage" />
|
||||
<Button android:id="@+id/undobar_button" style="@style/UndoBarButton" />
|
||||
|
@ -14,6 +14,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.mobeta.android.dslv.DragSortListView;
|
||||
@ -41,6 +42,8 @@ public class OrganizeQueueActivity extends ActionBarActivity implements
|
||||
private UndoBarController undoBarController;
|
||||
|
||||
private DragSortListView listView;
|
||||
private TextView emptyView;
|
||||
private ProgressBar progLoading;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@ -50,6 +53,9 @@ public class OrganizeQueueActivity extends ActionBarActivity implements
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
listView = (DragSortListView) findViewById(android.R.id.list);
|
||||
emptyView = (TextView) findViewById(android.R.id.empty);
|
||||
progLoading = (ProgressBar) findViewById(R.id.progLoading);
|
||||
|
||||
listView.setDropListener(dropListener);
|
||||
listView.setRemoveListener(removeListener);
|
||||
listView.setEmptyView(findViewById(android.R.id.empty));
|
||||
@ -67,6 +73,17 @@ public class OrganizeQueueActivity extends ActionBarActivity implements
|
||||
return DBReader.getQueue(OrganizeQueueActivity.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
// do not show loading animation if queue is already loaded
|
||||
if (queue == null) {
|
||||
progLoading.setVisibility(View.VISIBLE);
|
||||
listView.setVisibility(View.GONE);
|
||||
emptyView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(List<FeedItem> feedItems) {
|
||||
super.onPostExecute(feedItems);
|
||||
@ -80,9 +97,15 @@ public class OrganizeQueueActivity extends ActionBarActivity implements
|
||||
} else {
|
||||
Log.e(TAG, "Queue was null");
|
||||
}
|
||||
progLoading.setVisibility(View.GONE);
|
||||
listView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
};
|
||||
loadTask.execute();
|
||||
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.GINGERBREAD_MR1) {
|
||||
loadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
} else {
|
||||
loadTask.execute();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user