Added loading indicator for map updates in dashboard
This commit is contained in:
parent
4021f81d3f
commit
d5357be3b3
2 changed files with 11 additions and 6 deletions
|
@ -20,9 +20,16 @@
|
|||
android:textSize="14sp"
|
||||
android:textColor="@color/dashboard_black"/>
|
||||
<TextView android:id="@+id/update_count"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:textColor="@color/dashboard_blue"
|
||||
android:layout_height="wrap_content"/>
|
||||
<ProgressBar android:id="@+id/main_progress"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:indeterminate="true"
|
||||
android:indeterminateOnly="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<View android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
|
|
@ -73,15 +73,12 @@ public class DashUpdatesFragment extends DashBaseFragment {
|
|||
progressBars.clear();
|
||||
baseNames.clear();
|
||||
downloadButtons.clear();
|
||||
if (list.size() > 0) {
|
||||
mainView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mainView.setVisibility(View.GONE);
|
||||
mainView.findViewById(R.id.main_progress).setVisibility(View.GONE);
|
||||
((TextView)mainView.findViewById(R.id.update_count)).setText(String.valueOf(list.size()));
|
||||
if (list.size() < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
((TextView)mainView.findViewById(R.id.update_count)).setText(String.valueOf(list.size()));
|
||||
|
||||
LinearLayout updates = (LinearLayout) mainView.findViewById(R.id.updates_items);
|
||||
updates.removeAllViews();
|
||||
|
||||
|
@ -150,6 +147,7 @@ public class DashUpdatesFragment extends DashBaseFragment {
|
|||
});
|
||||
boolean intermediate = basicProgressAsyncTask.isIndeterminate();
|
||||
currentProgress.setVisibility(intermediate ? View.GONE : View.VISIBLE);
|
||||
getView().findViewById(R.id.main_progress).setVisibility(intermediate ? View.VISIBLE : View.GONE);
|
||||
if (!intermediate) {
|
||||
currentProgress.setProgress(basicProgressAsyncTask.getProgressPercentage());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue