Skip to content

Commit

Permalink
improve first app start
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Development committed Jan 4, 2019
1 parent e755400 commit f02b2e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ public void loginSucceeded() {
}

private void resetUiAndStartSync() {
getSlidingListFragment().loadOwncloudOrNextcloudBanner();
getSlidingListFragment().reloadAdapter();
updateCurrentRssView();
startSync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

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);
Expand Down Expand Up @@ -203,7 +200,14 @@ public void onDetach() {
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) {
Expand Down

0 comments on commit f02b2e7

Please sign in to comment.