|
@@ -132,8 +132,10 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
// setup toolbar
|
|
// setup toolbar
|
|
setupToolbar();
|
|
setupToolbar();
|
|
|
|
|
|
- swipeEmptyListRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_containing_empty);
|
|
|
|
- swipeListRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_containing_list);
|
|
|
|
|
|
+ swipeEmptyListRefreshLayout = findViewById(R.id.swipe_containing_empty);
|
|
|
|
+ swipeListRefreshLayout = findViewById(R.id.swipe_containing_list);
|
|
|
|
+ onCreateSwipeToRefresh(swipeEmptyListRefreshLayout);
|
|
|
|
+ onCreateSwipeToRefresh(swipeListRefreshLayout);
|
|
|
|
|
|
// setup drawer
|
|
// setup drawer
|
|
setupDrawer(R.id.nav_activity);
|
|
setupDrawer(R.id.nav_activity);
|
|
@@ -146,6 +148,9 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
@Override
|
|
@Override
|
|
public void onRefresh() {
|
|
public void onRefresh() {
|
|
setLoadingMessage();
|
|
setLoadingMessage();
|
|
|
|
+ if (swipeListRefreshLayout.isRefreshing()) {
|
|
|
|
+ swipeListRefreshLayout.setRefreshing(false);
|
|
|
|
+ }
|
|
fetchAndSetData(null);
|
|
fetchAndSetData(null);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -154,11 +159,23 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
@Override
|
|
@Override
|
|
public void onRefresh() {
|
|
public void onRefresh() {
|
|
setLoadingMessage();
|
|
setLoadingMessage();
|
|
|
|
+ if (swipeEmptyListRefreshLayout.isRefreshing()) {
|
|
|
|
+ swipeEmptyListRefreshLayout.setRefreshing(false);
|
|
|
|
+ }
|
|
fetchAndSetData(null);
|
|
fetchAndSetData(null);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ protected void onCreateSwipeToRefresh(SwipeRefreshLayout refreshLayout) {
|
|
|
|
+ int primaryColor = ThemeUtils.primaryColor();
|
|
|
|
+ int darkColor = ThemeUtils.primaryDarkColor();
|
|
|
|
+ int accentColor = ThemeUtils.primaryAccentColor();
|
|
|
|
+
|
|
|
|
+ // Colors in animations
|
|
|
|
+ refreshLayout.setColorSchemeColors(accentColor, primaryColor, darkColor);
|
|
|
|
+ }
|
|
|
|
+
|
|
public void onDestroy() {
|
|
public void onDestroy() {
|
|
super.onDestroy();
|
|
super.onDestroy();
|
|
unbinder.unbind();
|
|
unbinder.unbind();
|
|
@@ -225,7 +242,6 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
|
|
|
|
Thread t = new Thread(new Runnable() {
|
|
Thread t = new Thread(new Runnable() {
|
|
|
|
|
|
-
|
|
|
|
public void run() {
|
|
public void run() {
|
|
OwnCloudAccount ocAccount;
|
|
OwnCloudAccount ocAccount;
|
|
try {
|
|
try {
|
|
@@ -234,6 +250,7 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
getClientFor(ocAccount, MainApp.getAppContext());
|
|
getClientFor(ocAccount, MainApp.getAppContext());
|
|
ownCloudClient.setOwnCloudVersion(AccountUtils.getServerVersion(currentAccount));
|
|
ownCloudClient.setOwnCloudVersion(AccountUtils.getServerVersion(currentAccount));
|
|
isLoadingActivities = true;
|
|
isLoadingActivities = true;
|
|
|
|
+ setIndeterminate(isLoadingActivities);
|
|
|
|
|
|
GetRemoteActivitiesOperation getRemoteNotificationOperation = new GetRemoteActivitiesOperation();
|
|
GetRemoteActivitiesOperation getRemoteNotificationOperation = new GetRemoteActivitiesOperation();
|
|
if (pageUrl != null) {
|
|
if (pageUrl != null) {
|
|
@@ -262,6 +279,7 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
swipeEmptyListRefreshLayout.setVisibility(View.VISIBLE);
|
|
swipeEmptyListRefreshLayout.setVisibility(View.VISIBLE);
|
|
}
|
|
}
|
|
isLoadingActivities = false;
|
|
isLoadingActivities = false;
|
|
|
|
+ setIndeterminate(isLoadingActivities);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
@@ -277,6 +295,7 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
public void run() {
|
|
public void run() {
|
|
setEmptyContent(noResultsHeadline, finalLogMessage);
|
|
setEmptyContent(noResultsHeadline, finalLogMessage);
|
|
isLoadingActivities = false;
|
|
isLoadingActivities = false;
|
|
|
|
+ setIndeterminate(isLoadingActivities);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -304,6 +323,7 @@ public class ActivitiesListActivity extends FileActivity implements ActivityList
|
|
swipeListRefreshLayout.setRefreshing(false);
|
|
swipeListRefreshLayout.setRefreshing(false);
|
|
swipeEmptyListRefreshLayout.setRefreshing(false);
|
|
swipeEmptyListRefreshLayout.setRefreshing(false);
|
|
isLoadingActivities = false;
|
|
isLoadingActivities = false;
|
|
|
|
+ setIndeterminate(isLoadingActivities);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|