improve first app start

This commit is contained in:
David Luhmer 2019-01-04 15:03:18 +01:00
parent e755400781
commit f02b2e7cf3
3 changed files with 14 additions and 8 deletions

View file

@ -21,10 +21,11 @@ public class Constants {
protected static boolean isNextCloud(Context context) {
SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(context);
int[] version = extractVersionNumberFromString(mPrefs.getString(Constants.NEWS_WEB_VERSION_NUMBER_STRING, ""));
if(version[0] >= 9) {
return true;
if(version[0] == 0) {
// not initialized yet..
return true; // let's assume that it is nextcloud..
}
return false;
return version[0] >= 9;
}
private static int[] extractVersionNumberFromString(String appVersion) {

View file

@ -965,6 +965,7 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements
}
private void resetUiAndStartSync() {
getSlidingListFragment().loadOwncloudOrNextcloudBanner();
getSlidingListFragment().reloadAdapter();
updateCurrentRssView();
startSync();

View file

@ -153,10 +153,7 @@ public class NewsReaderListFragment extends Fragment implements OnCreateContextM
ButterKnife.bind(this, view);
if(!Constants.isNextCloud(getContext())) {
// Set ownCloud view
headerView.setBackgroundResource(R.drawable.left_drawer_header_background);
}
loadOwncloudOrNextcloudBanner();
lvAdapter = new SubscriptionExpandableListAdapter(getActivity(), new DatabaseConnectionOrm(getActivity()), eListView);
lvAdapter.setHandlerListener(expListTextClickedListener);
@ -203,7 +200,14 @@ public class NewsReaderListFragment extends Fragment implements OnCreateContextM
mCallbacks = null;
}
ExpListTextClicked expListTextClickedListener = new ExpListTextClicked() {
protected void loadOwncloudOrNextcloudBanner() {
if(!Constants.isNextCloud(getContext())) {
// Set ownCloud view
headerView.setBackgroundResource(R.drawable.left_drawer_header_background);
}
}
private ExpListTextClicked expListTextClickedListener = new ExpListTextClicked() {
@Override
public void onTextClicked(long idFeed, boolean isFolder, Long optional_folder_id) {