소스 검색

Removed the Drawer profiles part + removed unused code

Signed-off-by: Kilian Périsset <kilian.perisset@infomaniak.com>
Kilian Périsset 4 년 전
부모
커밋
138aec8855

+ 14 - 473
src/main/java/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -31,27 +31,21 @@ import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
 import android.content.res.Configuration;
-import android.graphics.drawable.ColorDrawable;
+import android.graphics.Color;
 import android.graphics.drawable.Drawable;
-import android.graphics.drawable.LayerDrawable;
 import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
-import android.os.Handler;
 import android.os.SystemClock;
 import android.text.Html;
-import android.text.TextUtils;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.URLUtil;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
-import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.animation.GlideAnimation;
 import com.bumptech.glide.request.target.SimpleTarget;
 import com.google.android.material.button.MaterialButton;
@@ -80,12 +74,9 @@ import com.owncloud.android.lib.common.operations.RemoteOperation;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.lib.common.utils.Log_OC;
 import com.owncloud.android.lib.resources.files.SearchRemoteOperation;
-import com.owncloud.android.lib.resources.status.CapabilityBooleanType;
 import com.owncloud.android.lib.resources.status.OCCapability;
-import com.owncloud.android.lib.resources.status.OwnCloudVersion;
 import com.owncloud.android.lib.resources.users.GetUserInfoRemoteOperation;
 import com.owncloud.android.operations.GetCapabilitiesOperation;
-import com.owncloud.android.ui.TextDrawable;
 import com.owncloud.android.ui.activities.ActivitiesActivity;
 import com.owncloud.android.ui.events.AccountRemovedEvent;
 import com.owncloud.android.ui.events.ChangeMenuEvent;
@@ -106,7 +97,6 @@ import org.greenrobot.eventbus.ThreadMode;
 import org.parceler.Parcels;
 
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import javax.inject.Inject;
@@ -117,7 +107,6 @@ import androidx.appcompat.app.AppCompatDelegate;
 import androidx.core.content.ContextCompat;
 import androidx.core.view.GravityCompat;
 import androidx.drawerlayout.widget.DrawerLayout;
-import kotlin.collections.CollectionsKt;
 
 /**
  * Base class to handle setup of the drawer implementation including user switching and avatar fetching and fallback
@@ -127,27 +116,10 @@ public abstract class DrawerActivity extends ToolbarActivity
     implements DisplayUtils.AvatarGenerationListener, Injectable {
 
     private static final String TAG = DrawerActivity.class.getSimpleName();
-    private static final String KEY_IS_ACCOUNT_CHOOSER_ACTIVE = "IS_ACCOUNT_CHOOSER_ACTIVE";
     private static final String KEY_CHECKED_MENU_ITEM = "CHECKED_MENU_ITEM";
     private static final int ACTION_MANAGE_ACCOUNTS = 101;
-    private static final int MENU_ORDER_ACCOUNT = 1;
-    private static final int MENU_ORDER_ACCOUNT_FUNCTION = 2;
     private static final int MENU_ORDER_EXTERNAL_LINKS = 3;
     private static final int MENU_ITEM_EXTERNAL_LINK = 111;
-    /**
-     * menu account avatar radius.
-     */
-    private float mMenuAccountAvatarRadiusDimension;
-
-    /**
-     * current account avatar radius.
-     */
-    private float mCurrentAccountAvatarRadiusDimension;
-
-    /**
-     * other accounts avatar radius.
-     */
-    private float mOtherAccountAvatarRadiusDimension;
 
     /**
      * Reference to the drawer layout.
@@ -164,36 +136,11 @@ public abstract class DrawerActivity extends ToolbarActivity
      */
     private NavigationView mNavigationView;
 
-    /**
-     * Reference to the account chooser toggle.
-     */
-    private ImageView mAccountChooserToggle;
-
-    /**
-     * Reference to the middle account avatar.
-     */
-    private ImageView mAccountMiddleAccountAvatar;
-
-    /**
-     * Reference to the end account avatar.
-     */
-    private ImageView mAccountEndAccountAvatar;
-
-    /**
-     * Flag to signal if the account chooser is active.
-     */
-    private boolean mIsAccountChooserActive;
-
     /**
      * Id of the checked menu item.
      */
     private int mCheckedMenuItem = Menu.NONE;
 
-    /**
-     * accounts for the (max) three displayed accounts in the drawer header.
-     */
-    private List<User> mAvatars = Collections.emptyList();
-
     /**
      * container layout of the quota view.
      */
@@ -244,88 +191,19 @@ public abstract class DrawerActivity extends ToolbarActivity
 
         mNavigationView = findViewById(R.id.nav_view);
         if (mNavigationView != null) {
-            setupDrawerHeader();
-
             setupDrawerMenu(mNavigationView);
-
             setupQuotaElement();
         }
 
-        setupDrawerToggle();
-
         if (getSupportActionBar() != null) {
             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
         }
     }
 
-    /**
-     * initializes and sets up the drawer toggle.
-     */
-    private void setupDrawerToggle() {
-        mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.drawer_open, R.string.drawer_close) {
-
-            /** Called when a drawer has settled in a completely closed state. */
-            public void onDrawerClosed(View view) {
-                super.onDrawerClosed(view);
-                // standard behavior of drawer is to switch to the standard menu on closing
-                if (mIsAccountChooserActive) {
-                    toggleAccountList();
-                }
-                supportInvalidateOptionsMenu();
-                mDrawerToggle.setDrawerIndicatorEnabled(isDrawerIndicatorAvailable());
-
-                if (pendingRunnable != null) {
-                    new Handler().post(pendingRunnable);
-                    pendingRunnable = null;
-                }
-
-                closeDrawer();
-            }
-
-            /** Called when a drawer has settled in a completely open state. */
-            public void onDrawerOpened(View drawerView) {
-                super.onDrawerOpened(drawerView);
-                mDrawerToggle.setDrawerIndicatorEnabled(true);
-                supportInvalidateOptionsMenu();
-            }
-        };
-
-        // Set the drawer toggle as the DrawerListener
-        mDrawerLayout.addDrawerListener(mDrawerToggle);
-        mDrawerToggle.setDrawerIndicatorEnabled(true);
-        mDrawerToggle.setDrawerSlideAnimationEnabled(true);
-        Drawable backArrow = getResources().getDrawable(R.drawable.ic_arrow_back);
-        mDrawerToggle.setHomeAsUpIndicator(ThemeUtils.tintDrawable(backArrow, ThemeUtils.appBarPrimaryFontColor(this)));
-        mDrawerToggle.getDrawerArrowDrawable().setColor(ThemeUtils.appBarPrimaryFontColor(this));
-    }
-
-    /**
-     * initializes and sets up the drawer header.
-     */
-    private void setupDrawerHeader() {
-        mAccountMiddleAccountAvatar = (ImageView) findNavigationViewChildById(R.id.drawer_account_middle);
-        mAccountEndAccountAvatar = (ImageView) findNavigationViewChildById(R.id.drawer_account_end);
-
-        mAccountChooserToggle = (ImageView) findNavigationViewChildById(R.id.drawer_account_chooser_toggle);
-
-        if (getResources().getBoolean(R.bool.allow_profile_click)) {
-            mAccountChooserToggle.setImageResource(R.drawable.ic_down);
-
-            findNavigationViewChildById(R.id.drawer_active_user)
-                    .setOnClickListener(new View.OnClickListener() {
-                        @Override
-                        public void onClick(View v) {
-                            toggleAccountList();
-                        }
-                    });
-        } else {
-            mAccountChooserToggle.setVisibility(View.GONE);
-        }
-    }
-
     /**
      * setup quota elements of the drawer.
      */
+
     private void setupQuotaElement() {
         mQuotaView = (LinearLayout) findQuotaViewById(R.id.drawer_quota);
         mQuotaProgressBar = (ProgressBar) findQuotaViewById(R.id.drawer_quota_ProgressBar);
@@ -334,6 +212,15 @@ public abstract class DrawerActivity extends ToolbarActivity
         ThemeUtils.colorProgressBar(mQuotaProgressBar, ThemeUtils.primaryColor(this));
     }
 
+    /**
+     * setup drawer header, basically the logo color
+     *
+     */
+    protected void setupDrawerHeader() {
+       ImageView drawerLogo = findViewById(R.id.drawer_header_logo);
+       drawerLogo.setColorFilter(Color.parseColor(getCapabilities().getServerColor()));
+    }
+
     /**
      * setup drawer content, basically setting the item selected listener.
      *
@@ -359,13 +246,6 @@ public abstract class DrawerActivity extends ToolbarActivity
                     }
                 });
 
-        // handle correct state
-        if (mIsAccountChooserActive) {
-            navigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, true);
-        } else {
-            navigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, false);
-        }
-
         User account = accountManager.getUser();
         filterDrawerMenu(navigationView.getMenu(), account);
     }
@@ -401,11 +281,6 @@ public abstract class DrawerActivity extends ToolbarActivity
     private void onNavigationItemClicked(final MenuItem menuItem) {
         setDrawerMenuItemChecked(menuItem.getItemId());
 
-        if (menuItem.getGroupId() == R.id.drawer_menu_accounts) {
-            handleAccountItemClick(menuItem);
-            return;
-        }
-
         switch (menuItem.getItemId()) {
             case R.id.nav_all_files:
                 showFiles(false);
@@ -494,22 +369,6 @@ public abstract class DrawerActivity extends ToolbarActivity
         startActivity(intent);
     }
 
-    private void handleAccountItemClick(MenuItem menuItem) {
-        switch (menuItem.getItemId()) {
-            case R.id.drawer_menu_account_add:
-                openAddAccount();
-                break;
-
-            case R.id.drawer_menu_account_manage:
-                openManageAccounts();
-                break;
-
-            default:
-                accountClicked(menuItem.getItemId());
-                break;
-        }
-    }
-
     public void showManageAccountsDialog() {
         ChooseAccountDialogFragment choseAccountDialog = ChooseAccountDialogFragment.newInstance(accountManager.getUser());
         choseAccountDialog.show(getSupportFragmentManager(), "fragment_chose_account");
@@ -606,15 +465,6 @@ public abstract class DrawerActivity extends ToolbarActivity
         }
     }
 
-    /**
-     * click method for mini avatars in drawer header.
-     *
-     * @param view the clicked ImageView
-     */
-    public void onAccountDrawerClick(View view) {
-        accountClicked((int) view.getTag());
-    }
-
     /**
      * checks if the drawer exists and is opened.
      *
@@ -638,8 +488,10 @@ public abstract class DrawerActivity extends ToolbarActivity
      */
     public void openDrawer() {
         if (mDrawerLayout != null) {
-            mDrawerLayout.openDrawer(GravityCompat.START);
+            ImageView drawerLogo = mDrawerLayout.findViewById(R.id.drawer_header_logo);
+            drawerLogo.setColorFilter(Color.parseColor(getCapabilities().getServerColor()));
 
+            mDrawerLayout.openDrawer(GravityCompat.START);
             updateExternalLinksInDrawer();
             updateQuotaLink();
         }
@@ -668,112 +520,6 @@ public abstract class DrawerActivity extends ToolbarActivity
         }
     }
 
-    /**
-     * updates the account list in the drawer.
-     */
-    public void updateAccountList() {
-        List<User> users = accountManager.getAllUsers();
-        ArrayList<User> persistingAccounts = new ArrayList<>();
-
-        for (User user: users) {
-            boolean pendingForRemoval = arbitraryDataProvider.getBooleanValue(user.toPlatformAccount(),
-                    ManageAccountsActivity.PENDING_FOR_REMOVAL);
-
-            if (!pendingForRemoval) {
-                persistingAccounts.add(user);
-            }
-        }
-
-        if (mNavigationView != null && mDrawerLayout != null) {
-            if (persistingAccounts.size() > 0) {
-                repopulateAccountList(persistingAccounts);
-                setAccountInDrawer(accountManager.getUser());
-                mAvatars = getUserAvatars();
-
-                // activate second/end account avatar
-                final User secondUser = mAvatars.size() > 1 ? mAvatars.get(1) : null;
-                if (secondUser != null) {
-                    mAccountEndAccountAvatar.setTag(secondUser.hashCode());
-                    DisplayUtils.setAvatar(secondUser,
-                                           this,
-                                           mOtherAccountAvatarRadiusDimension,
-                                           getResources(),
-                                           mAccountEndAccountAvatar,
-                                           this);
-                    mAccountEndAccountAvatar.setVisibility(View.VISIBLE);
-                } else {
-                    mAccountEndAccountAvatar.setVisibility(View.GONE);
-                }
-
-                // activate third/middle account avatar
-                final User thirdUser = mAvatars.size() > 2 ? mAvatars.get(2) : null;
-                if (thirdUser != null) {
-                    mAccountMiddleAccountAvatar.setTag(thirdUser.hashCode());
-                    DisplayUtils.setAvatar(thirdUser,
-                                           this,
-                                           mOtherAccountAvatarRadiusDimension,
-                                           getResources(),
-                                           mAccountMiddleAccountAvatar,
-                                           this);
-                    mAccountMiddleAccountAvatar.setVisibility(View.VISIBLE);
-                } else {
-                    mAccountMiddleAccountAvatar.setVisibility(View.GONE);
-                }
-            } else {
-                mAccountEndAccountAvatar.setVisibility(View.GONE);
-                mAccountMiddleAccountAvatar.setVisibility(View.GONE);
-            }
-        }
-    }
-
-    /**
-     * re-populates the account list.
-     *
-     * @param users list of users
-     */
-    private void repopulateAccountList(List<User> users) {
-        // remove all accounts from list
-        mNavigationView.getMenu().removeGroup(R.id.drawer_menu_accounts);
-
-        // add all accounts to list
-        for (User user: users) {
-            try {
-                // show all accounts except the currently active one and those pending for removal
-
-                if (!getAccount().name.equals(user.getAccountName())) {
-                    MenuItem accountMenuItem = mNavigationView.getMenu().add(
-                        R.id.drawer_menu_accounts,
-                        user.hashCode(),
-                        MENU_ORDER_ACCOUNT,
-                        DisplayUtils.getAccountNameDisplayText(user))
-                        .setIcon(TextDrawable.createAvatar(user.toPlatformAccount(),
-                                                           mMenuAccountAvatarRadiusDimension));
-                    DisplayUtils.setAvatar(user, this, mMenuAccountAvatarRadiusDimension, getResources(),
-                                           accountMenuItem, this);
-                }
-            } catch (Exception e) {
-                Log_OC.e(TAG, "Error calculating RGB value for account menu item.", e);
-                mNavigationView.getMenu().add(
-                    R.id.drawer_menu_accounts,
-                    user.hashCode(),
-                    MENU_ORDER_ACCOUNT,
-                    DisplayUtils.getAccountNameDisplayText(user))
-                    .setIcon(R.drawable.ic_user);
-            }
-        }
-
-        // re-add add-account and manage-accounts
-        mNavigationView.getMenu().add(R.id.drawer_menu_accounts, R.id.drawer_menu_account_add,
-                MENU_ORDER_ACCOUNT_FUNCTION,
-                getResources().getString(R.string.prefs_add_account)).setIcon(R.drawable.ic_account_plus);
-        mNavigationView.getMenu().add(R.id.drawer_menu_accounts, R.id.drawer_menu_account_manage,
-                MENU_ORDER_ACCOUNT_FUNCTION,
-                getResources().getString(R.string.drawer_manage_accounts)).setIcon(R.drawable.nav_settings);
-
-        // adding sets menu group back to visible, so safety check and setting invisible
-        showMenu();
-    }
-
     /**
      * Updates title bar and home buttons (state and icon).
      * Assumes that navigation drawer is NOT visible.
@@ -791,75 +537,6 @@ public abstract class DrawerActivity extends ToolbarActivity
         }
     }
 
-    /**
-     * sets the given account name in the drawer in case the drawer is available. The account name is shortened
-     * beginning from the @-sign in the username.
-     *
-     * @param user the account to be set in the drawer
-     */
-    protected void setAccountInDrawer(User user) {
-        if (mDrawerLayout != null && user != null) {
-            TextView username = (TextView) findNavigationViewChildById(R.id.drawer_username);
-            TextView usernameFull = (TextView) findNavigationViewChildById(R.id.drawer_username_full);
-
-            String name = user.getAccountName();
-            usernameFull.setText(DisplayUtils.convertIdn(name.substring(name.lastIndexOf('@') + 1),
-                                                         false));
-            usernameFull.setTextColor(ThemeUtils.fontColor(this));
-
-            username.setText(user.toOwnCloudAccount().getDisplayName());
-            username.setTextColor(ThemeUtils.fontColor(this));
-
-            View currentAccountView = findNavigationViewChildById(R.id.drawer_current_account);
-            currentAccountView.setTag(name);
-
-            DisplayUtils.setAvatar(user, this, mCurrentAccountAvatarRadiusDimension, getResources(),
-                    currentAccountView, this);
-
-            // check and show quota info if available
-            getAndDisplayUserQuota();
-        }
-    }
-
-    /**
-     * Toggle between standard menu and account list including saving the state.
-     */
-    private void toggleAccountList() {
-        mIsAccountChooserActive = !mIsAccountChooserActive;
-        showMenu();
-    }
-
-    /**
-     * depending on the #mIsAccountChooserActive flag shows the account chooser or the standard menu.
-     */
-    private void showMenu() {
-        if (mNavigationView != null) {
-            if (mIsAccountChooserActive) {
-                if (mAccountChooserToggle != null) {
-                    mAccountChooserToggle.setImageResource(R.drawable.ic_up);
-                }
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, true);
-
-                if (!getResources().getBoolean(R.bool.multiaccount_support) &&
-                        mNavigationView.getMenu().findItem(R.id.drawer_menu_account_add) != null) {
-                    mNavigationView.getMenu().removeItem(R.id.drawer_menu_account_add);
-                }
-
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, false);
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_external_links, false);
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, false);
-            } else {
-                if (mAccountChooserToggle != null) {
-                    mAccountChooserToggle.setImageResource(R.drawable.ic_down);
-                }
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_accounts, false);
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_standard, true);
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_external_links, true);
-                mNavigationView.getMenu().setGroupVisible(R.id.drawer_menu_bottom, true);
-            }
-        }
-    }
-
     /**
      * shows or hides the quota UI elements.
      *
@@ -991,12 +668,6 @@ public abstract class DrawerActivity extends ToolbarActivity
                 MenuItem menuItem = mNavigationView.getMenu().getItem(i);
                 if (menuItem.getIcon() != null) {
                     menuItem.getIcon().clearColorFilter();
-                    if (menuItem.getGroupId() != R.id.drawer_menu_accounts
-                        || menuItem.getItemId() == R.id.drawer_menu_account_add
-                        || menuItem.getItemId() == R.id.drawer_menu_account_manage) {
-                        ThemeUtils.tintDrawable(
-                            menuItem.getIcon(), ContextCompat.getColor(this, R.color.drawer_menu_icon));
-                    }
                     menuItem.setTitle(Html.fromHtml(
                         "<font color='"
                             + ThemeUtils.colorToHexString(ContextCompat.getColor(this, R.color.drawer_text_color))
@@ -1126,92 +797,10 @@ public abstract class DrawerActivity extends ToolbarActivity
         }
     }
 
-    public void updateHeaderBackground() {
-        if (getAccount() != null &&
-                getStorageManager().getCapability(getAccount().name).getServerBackground() != null) {
-            final ViewGroup navigationHeader = (ViewGroup) findNavigationViewChildById(R.id.drawer_header_view);
-
-            if (navigationHeader != null) {
-                OCCapability capability = getStorageManager().getCapability(getAccount().name);
-                String background = capability.getServerBackground();
-                CapabilityBooleanType backgroundDefault = capability.getServerBackgroundDefault();
-                CapabilityBooleanType backgroundPlain = capability.getServerBackgroundPlain();
-                int primaryColor = ThemeUtils.primaryColor(getAccount(), false, this);
-
-                if (backgroundDefault.isTrue() && backgroundPlain.isTrue()) {
-                    // use only solid color
-                    setNavigationHeaderBackground(new ColorDrawable(primaryColor), navigationHeader);
-                } else if (backgroundDefault.isTrue() && backgroundPlain.isFalse()) {
-                    // use nc13 background image with themed color
-                    Drawable[] drawables = {new ColorDrawable(primaryColor),
-                        getResources().getDrawable(R.drawable.background)};
-                    LayerDrawable layerDrawable = new LayerDrawable(drawables);
-                    setNavigationHeaderBackground(layerDrawable, navigationHeader);
-                } else {
-                    // use url
-                    if (URLUtil.isValidUrl(background) || background.isEmpty()) {
-                        // background image
-                        SimpleTarget target = new SimpleTarget<Drawable>() {
-                            @Override
-                            public void onResourceReady(Drawable resource, GlideAnimation glideAnimation) {
-                                Drawable[] drawables = {new ColorDrawable(primaryColor), resource};
-                                LayerDrawable layerDrawable = new LayerDrawable(drawables);
-                                setNavigationHeaderBackground(layerDrawable, navigationHeader);
-                            }
-
-                            @Override
-                            public void onLoadFailed(Exception e, Drawable errorDrawable) {
-                                Drawable[] drawables = {new ColorDrawable(primaryColor), errorDrawable};
-                                LayerDrawable layerDrawable = new LayerDrawable(drawables);
-                                setNavigationHeaderBackground(layerDrawable, navigationHeader);
-                            }
-                        };
-
-                        int backgroundResource;
-                        OwnCloudVersion ownCloudVersion = accountManager.getServerVersion(getAccount());
-                        if (ownCloudVersion.compareTo(OwnCloudVersion.nextcloud_18) >= 0) {
-                            backgroundResource = R.drawable.background_nc18;
-                        } else {
-                            backgroundResource = R.drawable.background;
-                        }
-
-                        Glide.with(this)
-                                .load(background)
-                                .centerCrop()
-                                .placeholder(backgroundResource)
-                                .error(backgroundResource)
-                                .crossFade()
-                                .into(target);
-                    } else {
-                        // plain color
-                        setNavigationHeaderBackground(new ColorDrawable(primaryColor), navigationHeader);
-                    }
-                }
-            }
-        }
-    }
-
-    private void setNavigationHeaderBackground(Drawable drawable, ViewGroup navigationHeader) {
-        final ImageView background = navigationHeader.findViewById(R.id.drawer_header_background);
-        background.setImageDrawable(drawable);
-    }
-
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
-        if (savedInstanceState != null) {
-            mIsAccountChooserActive = savedInstanceState.getBoolean(KEY_IS_ACCOUNT_CHOOSER_ACTIVE, false);
-            mCheckedMenuItem = savedInstanceState.getInt(KEY_CHECKED_MENU_ITEM, Menu.NONE);
-        }
-
-        mCurrentAccountAvatarRadiusDimension = getResources()
-                .getDimension(R.dimen.nav_drawer_header_avatar_radius);
-        mOtherAccountAvatarRadiusDimension = getResources()
-                .getDimension(R.dimen.nav_drawer_header_avatar_other_accounts_radius);
-        mMenuAccountAvatarRadiusDimension = getResources()
-                .getDimension(R.dimen.nav_drawer_menu_avatar_radius);
-
         externalLinksProvider = new ExternalLinksProvider(getContentResolver());
         arbitraryDataProvider = new ArbitraryDataProvider(getContentResolver());
     }
@@ -1219,8 +808,6 @@ public abstract class DrawerActivity extends ToolbarActivity
     @Override
     protected void onSaveInstanceState(@NonNull Bundle outState) {
         super.onSaveInstanceState(outState);
-
-        outState.putBoolean(KEY_IS_ACCOUNT_CHOOSER_ACTIVE, mIsAccountChooserActive);
         outState.putInt(KEY_CHECKED_MENU_ITEM, mCheckedMenuItem);
     }
 
@@ -1228,12 +815,8 @@ public abstract class DrawerActivity extends ToolbarActivity
     public void onRestoreInstanceState(@NonNull Bundle savedInstanceState) {
         super.onRestoreInstanceState(savedInstanceState);
 
-        mIsAccountChooserActive = savedInstanceState.getBoolean(KEY_IS_ACCOUNT_CHOOSER_ACTIVE, false);
         mCheckedMenuItem = savedInstanceState.getInt(KEY_CHECKED_MENU_ITEM, Menu.NONE);
 
-        // (re-)setup drawer state
-        showMenu();
-
         // check/highlight the menu item if present
         if (mCheckedMenuItem > Menu.NONE || mCheckedMenuItem < Menu.NONE) {
             setDrawerMenuItemChecked(mCheckedMenuItem);
@@ -1250,10 +833,8 @@ public abstract class DrawerActivity extends ToolbarActivity
                 mDrawerToggle.setDrawerIndicatorEnabled(true);
             }
         }
-        updateAccountList();
         updateExternalLinksInDrawer();
         updateQuotaLink();
-        updateHeaderBackground();
     }
 
     @Override
@@ -1298,10 +879,7 @@ public abstract class DrawerActivity extends ToolbarActivity
             // current account has changed
             if (data.getBooleanExtra(ManageAccountsActivity.KEY_CURRENT_ACCOUNT_CHANGED, false)) {
                 setAccount(accountManager.getCurrentAccount(), false);
-                updateAccountList();
                 restart();
-            } else {
-                updateAccountList();
             }
         } else if (requestCode == PassCodeManager.PASSCODE_ACTIVITY &&
                 Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && data != null) {
@@ -1316,22 +894,6 @@ public abstract class DrawerActivity extends ToolbarActivity
         }
     }
 
-    /**
-     * Finds a view that was identified by the id attribute from the drawer header.
-     *
-     * @param id the view's id
-     * @return The view if found or <code>null</code> otherwise.
-     */
-    private View findNavigationViewChildById(int id) {
-        NavigationView view = findViewById(R.id.nav_view);
-
-        if (view != null) {
-            return view.getHeaderView(0).findViewById(id);
-        } else {
-            return null;
-        }
-    }
-
     /**
      * Quota view can be either at navigation bottom or header
      *
@@ -1353,25 +915,6 @@ public abstract class DrawerActivity extends ToolbarActivity
      */
     protected abstract void restart();
 
-    /**
-     * Get list of users suitable for displaying in navigation drawer header.
-     * First item is always current {@link User}. Remaining items are other
-     * users possible to switch to.
-     *
-     * @return List of available users
-     */
-    @NonNull
-    private List<User> getUserAvatars() {
-        User currentUser = accountManager.getUser();
-        List<User> availableUsers = CollectionsKt.filter(accountManager.getAllUsers(), user ->
-            !TextUtils.equals(user.getAccountName(), currentUser.getAccountName()) &&
-            !arbitraryDataProvider.getBooleanValue(user.toPlatformAccount(),
-                                                   ManageAccountsActivity.PENDING_FOR_REMOVAL)
-        );
-        availableUsers.add(0, currentUser);
-        return availableUsers;
-    }
-
     @Override
     public void avatarGenerated(Drawable avatarDrawable, Object callContext) {
         if (callContext instanceof MenuItem) {
@@ -1435,8 +978,6 @@ public abstract class DrawerActivity extends ToolbarActivity
 
     @Subscribe(threadMode = ThreadMode.MAIN)
     public void onAccountRemovedEvent(AccountRemovedEvent event) {
-        updateAccountList();
-
         restart();
     }
 

+ 0 - 2
src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.java

@@ -2578,7 +2578,6 @@ public class FileDisplayActivity extends FileActivity
             setFile(file);
 
             User user = optionalUser.get();
-            setAccountInDrawer(user);
             setupDrawer();
 
             mSwitchAccountButton.setTag(user.getAccountName());
@@ -2660,7 +2659,6 @@ public class FileDisplayActivity extends FileActivity
         if (optionalNewUser.isPresent()) {
             user = optionalNewUser.get();
             setUser(user);
-            updateAccountList();
         } else {
             dismissLoadingDialog();
             DisplayUtils.showSnackMessage(this, getString(R.string.associated_account_not_found));

+ 0 - 3
src/main/java/com/owncloud/android/ui/activity/UploadListActivity.java

@@ -199,9 +199,6 @@ public class UploadListActivity extends FileActivity {
     protected void onStart() {
         super.onStart();
         final Optional<User> optionalUser = getUser();
-        if (optionalUser.isPresent()) {
-            setAccountInDrawer(optionalUser.get());
-        }
     }
 
     @Override

+ 0 - 23
src/main/res/drawable/ic_down.xml

@@ -1,23 +0,0 @@
-<!--
-    @author Google LLC
-    Copyright (C) 2018 Google LLC
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="24dp"
-    android:width="24dp"
-    android:viewportWidth="24"
-    android:viewportHeight="24">
-    <path android:fillColor="#FFFFFF" android:pathData="M7,10L12,15L17,10H7Z" />
-</vector>

+ 0 - 23
src/main/res/drawable/ic_up.xml

@@ -1,23 +0,0 @@
-<!--
-    @author Google LLC
-    Copyright (C) 2018 Google LLC
-
-    Licensed under the Apache License, Version 2.0 (the "License");
-    you may not use this file except in compliance with the License.
-    You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:height="24dp"
-    android:width="24dp"
-    android:viewportWidth="24"
-    android:viewportHeight="24">
-    <path android:fillColor="#FFFFFF" android:pathData="M7,15L12,10L17,15H7Z" />
-</vector>

+ 106 - 0
src/main/res/drawable/nextcloud_logo.xml

@@ -0,0 +1,106 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="170.97dp"
+    android:height="31.21dp"
+    android:viewportWidth="200"
+    android:viewportHeight="37">
+  <path
+      android:pathData="m22.163,14.12c-1.62,-3.46 -5.15,-5.88 -9.21,-5.88 -5.58,0 -10.17,4.57 -10.17,10.14s4.59,10.15 10.17,10.15c4.06,0 7.59,-2.43 9.21,-5.89 1.87,6.53 7.91,11.35 15.04,11.35 7.07,0 13.08,-4.75 15,-11.2 1.65,3.38 5.13,5.74 9.14,5.74 5.58,0 10.17,-4.58 10.17,-10.15s-4.59,-10.14 -10.17,-10.14c-4.01,0 -7.49,2.35 -9.14,5.74 -1.92,-6.46 -7.93,-11.2 -15,-11.2 -7.13,0 -13.17,4.82 -15.04,11.34zM46.873,18.38c0,5.36 -4.29,9.65 -9.67,9.65s-9.67,-4.29 -9.67,-9.65 4.29,-9.64 9.67,-9.64 9.67,4.28 9.67,9.64zM17.163,18.38c0,2.35 -1.85,4.19 -4.21,4.19 -2.35,0 -4.2,-1.84 -4.2,-4.19s1.85,-4.19 4.2,-4.19c2.36,0 4.21,1.84 4.21,4.19zM65.543,18.38c0,2.35 -1.85,4.19 -4.2,4.19 -2.36,0 -4.21,-1.84 -4.21,-4.19s1.85,-4.19 4.21,-4.19c2.35,0 4.2,1.84 4.2,4.19z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:pathData="m22.163,14.12c-1.62,-3.46 -5.15,-5.88 -9.21,-5.88 -5.58,0 -10.17,4.57 -10.17,10.14s4.59,10.15 10.17,10.15c4.06,0 7.59,-2.43 9.21,-5.89 1.87,6.53 7.91,11.35 15.04,11.35 7.07,0 13.08,-4.75 15,-11.2 1.65,3.38 5.13,5.74 9.14,5.74 5.58,0 10.17,-4.58 10.17,-10.15s-4.59,-10.14 -10.17,-10.14c-4.01,0 -7.49,2.35 -9.14,5.74 -1.92,-6.46 -7.93,-11.2 -15,-11.2 -7.13,0 -13.17,4.82 -15.04,11.34zM46.873,18.38c0,5.36 -4.29,9.65 -9.67,9.65s-9.67,-4.29 -9.67,-9.65 4.29,-9.64 9.67,-9.64 9.67,4.28 9.67,9.64zM17.163,18.38c0,2.35 -1.85,4.19 -4.21,4.19 -2.35,0 -4.2,-1.84 -4.2,-4.19s1.85,-4.19 4.2,-4.19c2.36,0 4.21,1.84 4.21,4.19zM65.543,18.38c0,2.35 -1.85,4.19 -4.2,4.19 -2.36,0 -4.21,-1.84 -4.21,-4.19s1.85,-4.19 4.21,-4.19c2.35,0 4.2,1.84 4.2,4.19z"
+      android:strokeAlpha="0"
+      android:strokeWidth="5.57"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m105.143,19.31c0,0.28 -0.23,0.51 -0.51,0.51h-7.43c0.05,2.62 1.87,4.11 3.97,4.11 1.31,0 2.24,-0.56 2.71,-0.93 0.28,-0.19 0.51,-0.14 0.65,0.14 0.02,0.02 0.13,0.21 0.14,0.23 0.14,0.24 0.1,0.47 -0.14,0.66 -0.56,0.42 -1.77,1.12 -3.41,1.12 -3.03,0 -5.37,-2.2 -5.37,-5.37 0.05,-3.37 2.29,-5.38 5.09,-5.38 2.76,0 4.3,1.97 4.3,4.91zM100.803,15.57c-1.73,0 -3.23,1.12 -3.55,3.22h6.44c-0.93,-2.14 -1.9,-3.22 -2.89,-3.22z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m105.143,19.31c0,0.28 -0.23,0.51 -0.51,0.51h-7.43c0.05,2.62 1.87,4.11 3.97,4.11 1.31,0 2.24,-0.56 2.71,-0.93 0.28,-0.19 0.51,-0.14 0.65,0.14 0.02,0.02 0.13,0.21 0.14,0.23 0.14,0.24 0.1,0.47 -0.14,0.66 -0.56,0.42 -1.77,1.12 -3.41,1.12 -3.03,0 -5.37,-2.2 -5.37,-5.37 0.05,-3.37 2.29,-5.38 5.09,-5.38 2.76,0 4.3,1.97 4.3,4.91zM100.803,15.57c-1.73,0 -3.23,1.12 -3.55,3.22h6.44c-0.93,-2.14 -1.9,-3.22 -2.89,-3.22z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m119.173,14.73v-2.43c0,-0.33 0.19,-0.51 0.52,-0.51h0.37c0.33,0 0.47,0.18 0.47,0.51v2.43h2.1c0.33,0 0.52,0.19 0.52,0.51v0.14c0,0.33 -0.19,0.47 -0.52,0.47h-2.1v5.14c0,2.38 1.45,2.66 2.24,2.71 0.42,0.05 0.56,0.14 0.56,0.51v0.29c0,0.32 -0.14,0.46 -0.56,0.46 -2.24,0 -3.6,-1.35 -3.6,-3.78v-5.28,-1.17z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m119.173,14.73v-2.43c0,-0.33 0.19,-0.51 0.52,-0.51h0.37c0.33,0 0.47,0.18 0.47,0.51v2.43h2.1c0.33,0 0.52,0.19 0.52,0.51v0.14c0,0.33 -0.19,0.47 -0.52,0.47h-2.1v5.14c0,2.38 1.45,2.66 2.24,2.71 0.42,0.05 0.56,0.14 0.56,0.51v0.29c0,0.32 -0.14,0.46 -0.56,0.46 -2.24,0 -3.6,-1.35 -3.6,-3.78v-5.28,-1.17z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m133.283,15.57c0.24,0.19 0.28,0.42 0.05,0.7 -0.01,0.02 -0.13,0.21 -0.14,0.24 -0.19,0.28 -0.42,0.28 -0.7,0.09 -0.47,-0.33 -1.35,-0.94 -2.57,-0.94 -2.24,0 -4.02,1.69 -4.02,4.16 0,2.43 1.78,4.11 4.02,4.11 1.45,0 2.43,-0.65 2.9,-1.07 0.28,-0.19 0.46,-0.14 0.65,0.14 0.02,0.02 0.13,0.17 0.14,0.19 0.14,0.28 0.09,0.46 -0.14,0.7 -0.51,0.42 -1.77,1.31 -3.64,1.31 -3.04,0 -5.38,-2.2 -5.38,-5.38 0.05,-3.17 2.39,-5.42 5.42,-5.42 1.78,0 2.9,0.75 3.41,1.17z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m133.283,15.57c0.24,0.19 0.28,0.42 0.05,0.7 -0.01,0.02 -0.13,0.21 -0.14,0.24 -0.19,0.28 -0.42,0.28 -0.7,0.09 -0.47,-0.33 -1.35,-0.94 -2.57,-0.94 -2.24,0 -4.02,1.69 -4.02,4.16 0,2.43 1.78,4.11 4.02,4.11 1.45,0 2.43,-0.65 2.9,-1.07 0.28,-0.19 0.46,-0.14 0.65,0.14 0.02,0.02 0.13,0.17 0.14,0.19 0.14,0.28 0.09,0.46 -0.14,0.7 -0.51,0.42 -1.77,1.31 -3.64,1.31 -3.04,0 -5.38,-2.2 -5.38,-5.38 0.05,-3.17 2.39,-5.42 5.42,-5.42 1.78,0 2.9,0.75 3.41,1.17z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m136.233,10.57h0.37c0.33,0 0.84,0.19 0.84,0.52v11.16c0,1.31 0.61,1.45 1.08,1.5 0.23,0 0.42,0.14 0.42,0.46v0.33c0,0.33 -0.14,0.52 -0.52,0.52 -0.84,0 -2.33,-0.28 -2.33,-2.53v-11.44c-0.13,-0.35 -0.08,-0.52 0.14,-0.52z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m136.233,10.57h0.37c0.33,0 0.84,0.19 0.84,0.52v11.16c0,1.31 0.61,1.45 1.08,1.5 0.23,0 0.42,0.14 0.42,0.46v0.33c0,0.33 -0.14,0.52 -0.52,0.52 -0.84,0 -2.33,-0.28 -2.33,-2.53v-11.44c-0.13,-0.35 -0.08,-0.52 0.14,-0.52z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m151.093,19.73c0,3.08 -2.43,5.42 -5.42,5.42s-5.42,-2.34 -5.42,-5.42c0,-3.04 2.43,-5.33 5.42,-5.33s5.42,2.29 5.42,5.33zM149.643,19.73c0,-2.34 -1.78,-4.07 -3.97,-4.07 -2.2,0 -4.02,1.78 -4.02,4.07 0.04,2.38 1.82,4.2 4.02,4.2 2.19,0 3.97,-1.77 3.97,-4.2z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m151.093,19.73c0,3.08 -2.43,5.42 -5.42,5.42s-5.42,-2.34 -5.42,-5.42c0,-3.04 2.43,-5.33 5.42,-5.33s5.42,2.29 5.42,5.33zM149.643,19.73c0,-2.34 -1.78,-4.07 -3.97,-4.07 -2.2,0 -4.02,1.78 -4.02,4.07 0.04,2.38 1.82,4.2 4.02,4.2 2.19,0 3.97,-1.77 3.97,-4.2z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m172.353,16.27h0.04s-0.04,-0.33 -0.04,-0.79v-4.63c0,-0.33 -0.14,-0.51 0.18,-0.51h0.38c0.32,0 0.84,0.18 0.84,0.51v13.32c0,0.33 -0.14,0.51 -0.47,0.51h-0.33c-0.32,0 -0.51,-0.14 -0.51,-0.47v-0.79c0,-0.37 0.09,-0.65 0.09,-0.65h-0.04s-0.89,2.15 -3.55,2.15c-2.76,0 -4.49,-2.2 -4.49,-5.38 -0.09,-3.17 1.82,-5.32 4.53,-5.32 2.48,0 2.69,1.64 3.37,2.05zM172.353,19.59c0,-2.1 -1.08,-4.11 -3.27,-4.11 -1.83,0 -3.32,1.49 -3.32,4.11 0.05,2.52 1.35,4.16 3.27,4.16 1.73,0 3.32,-1.22 3.32,-4.16z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m172.353,16.27h0.04s-0.04,-0.33 -0.04,-0.79v-4.63c0,-0.33 -0.14,-0.51 0.18,-0.51h0.38c0.32,0 0.84,0.18 0.84,0.51v13.32c0,0.33 -0.14,0.51 -0.47,0.51h-0.33c-0.32,0 -0.51,-0.14 -0.51,-0.47v-0.79c0,-0.37 0.09,-0.65 0.09,-0.65h-0.04s-0.89,2.15 -3.55,2.15c-2.76,0 -4.49,-2.2 -4.49,-5.38 -0.09,-3.17 1.82,-5.32 4.53,-5.32 2.48,0 2.69,1.64 3.37,2.05zM172.353,19.59c0,-2.1 -1.08,-4.11 -3.27,-4.11 -1.83,0 -3.32,1.49 -3.32,4.11 0.05,2.52 1.35,4.16 3.27,4.16 1.73,0 3.32,-1.22 3.32,-4.16z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m84.083,24.92c0.33,0 0.52,-0.19 0.52,-0.52v-10.03c0,-1.59 1.73,-2.72 3.69,-2.72s3.69,1.13 3.69,2.72v10.03c0,0.33 0.19,0.52 0.51,0.52h0.38c0.32,0 0.46,-0.19 0.46,-0.52v-10.09c0,-2.66 -2.66,-3.97 -5.09,-3.97 -2.33,0 -5,1.31 -5,3.97v10.09c0,0.33 0.14,0.52 0.47,0.52h0.37z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m84.083,24.92c0.33,0 0.52,-0.19 0.52,-0.52v-10.03c0,-1.59 1.73,-2.72 3.69,-2.72s3.69,1.13 3.69,2.72v10.03c0,0.33 0.19,0.52 0.51,0.52h0.38c0.32,0 0.46,-0.19 0.46,-0.52v-10.09c0,-2.66 -2.66,-3.97 -5.09,-3.97 -2.33,0 -5,1.31 -5,3.97v10.09c0,0.33 0.14,0.52 0.47,0.52h0.37z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m161.323,14.64c-0.33,0 -0.51,0.18 -0.51,0.51v5.65c0,1.59 -1.03,3.04 -3.04,3.04 -1.96,0 -3.04,-1.45 -3.04,-3.04v-5.65c0,-0.33 -0.19,-0.51 -0.51,-0.51h-0.38c-0.32,0 -0.46,0.18 -0.46,0.51v6.03c0,2.66 1.96,3.97 4.39,3.97s4.39,-1.31 4.39,-3.97v-6.03c0.05,-0.33 -0.14,-0.51 -0.47,-0.51h-0.37z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m161.323,14.64c-0.33,0 -0.51,0.18 -0.51,0.51v5.65c0,1.59 -1.03,3.04 -3.04,3.04 -1.96,0 -3.04,-1.45 -3.04,-3.04v-5.65c0,-0.33 -0.19,-0.51 -0.51,-0.51h-0.38c-0.32,0 -0.46,0.18 -0.46,0.51v6.03c0,2.66 1.96,3.97 4.39,3.97s4.39,-1.31 4.39,-3.97v-6.03c0.05,-0.33 -0.14,-0.51 -0.47,-0.51h-0.37z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+  <path
+      android:pathData="m115.113,14.78c-0.13,0.15 -0.76,0.9 -1.89,2.25l-1.42,1.69 -2.14,-2.55c-0.7,-0.84 -1.08,-1.3 -1.16,-1.39 -0.11,-0.13 -0.23,-0.19 -0.35,-0.2 -0.12,-0.02 -0.25,0.03 -0.38,0.14 -0.03,0.02 -0.25,0.21 -0.28,0.24 -0.25,0.21 -0.24,0.44 -0.03,0.69 0.13,0.15 0.76,0.9 1.89,2.25l1.57,1.87c-1.38,1.65 -2.14,2.56 -2.3,2.74v0.01c-0.12,0.13 -1.04,1.24 -1.16,1.38 -0.21,0.25 -0.19,0.51 0.06,0.72 0.03,0.03 0.26,0.22 0.29,0.24 0.25,0.21 0.48,0.16 0.69,-0.09 0.12,-0.15 0.75,-0.9 1.89,-2.26l1.41,-1.68c1.29,1.53 2,2.38 2.15,2.55v0.01c0.12,0.13 1.04,1.24 1.16,1.38 0.21,0.25 0.47,0.27 0.72,0.06 0.03,-0.02 0.26,-0.22 0.29,-0.24 0.25,-0.21 0.24,-0.44 0.03,-0.69 -0.13,-0.15 -0.76,-0.9 -1.89,-2.26l-1.57,-1.87c1.38,-1.64 2.14,-2.55 2.29,-2.73 0.01,0 0.01,-0.01 0.01,-0.01 0.12,-0.14 1.04,-1.24 1.16,-1.38 0.21,-0.25 0.19,-0.51 -0.07,-0.72 -0.02,-0.03 -0.25,-0.22 -0.28,-0.24 -0.13,-0.11 -0.25,-0.15 -0.36,-0.13 -0.12,0.02 -0.23,0.09 -0.33,0.22z"
+      android:fillColor="#0082c9"/>
+  <path
+      android:fillColor="#FF000000"
+      android:strokeWidth="1"
+      android:pathData="m115.113,14.78c-0.13,0.15 -0.76,0.9 -1.89,2.25l-1.42,1.69 -2.14,-2.55c-0.7,-0.84 -1.08,-1.3 -1.16,-1.39 -0.11,-0.13 -0.23,-0.19 -0.35,-0.2 -0.12,-0.02 -0.25,0.03 -0.38,0.14 -0.03,0.02 -0.25,0.21 -0.28,0.24 -0.25,0.21 -0.24,0.44 -0.03,0.69 0.13,0.15 0.76,0.9 1.89,2.25l1.57,1.87c-1.38,1.65 -2.14,2.56 -2.3,2.74v0.01c-0.12,0.13 -1.04,1.24 -1.16,1.38 -0.21,0.25 -0.19,0.51 0.06,0.72 0.03,0.03 0.26,0.22 0.29,0.24 0.25,0.21 0.48,0.16 0.69,-0.09 0.12,-0.15 0.75,-0.9 1.89,-2.26l1.41,-1.68c1.29,1.53 2,2.38 2.15,2.55v0.01c0.12,0.13 1.04,1.24 1.16,1.38 0.21,0.25 0.47,0.27 0.72,0.06 0.03,-0.02 0.26,-0.22 0.29,-0.24 0.25,-0.21 0.24,-0.44 0.03,-0.69 -0.13,-0.15 -0.76,-0.9 -1.89,-2.26l-1.57,-1.87c1.38,-1.64 2.14,-2.55 2.29,-2.73 0.01,0 0.01,-0.01 0.01,-0.01 0.12,-0.14 1.04,-1.24 1.16,-1.38 0.21,-0.25 0.19,-0.51 -0.07,-0.72 -0.02,-0.03 -0.25,-0.22 -0.28,-0.24 -0.13,-0.11 -0.25,-0.15 -0.36,-0.13 -0.12,0.02 -0.23,0.09 -0.33,0.22z"
+      android:strokeAlpha="0"
+      android:fillAlpha="0"
+      android:strokeColor="#000000"/>
+</vector>

+ 6 - 111
src/main/res/layout/drawer_header.xml

@@ -21,120 +21,15 @@
 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:id="@+id/drawer_header_view"
               android:layout_width="match_parent"
-              android:layout_height="@dimen/nav_drawer_header_height"
+              android:layout_height="@dimen/drawer_header_height"
               android:fitsSystemWindows="true">
 
     <ImageView
-        android:id="@+id/drawer_header_background"
-        android:layout_width="match_parent"
+        android:id="@+id/drawer_header_logo"
+        android:layout_width="@dimen/drawer_header_logo_width"
         android:layout_height="match_parent"
-        android:contentDescription="@string/drawer_header_background"
-        android:src="@drawable/background"
-        android:scaleType="centerCrop"/>
-
-    <RelativeLayout
-        android:id="@+id/drawer_active_user"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_gravity="bottom"
-        android:paddingTop="@dimen/standard_padding"
-        android:paddingRight="@dimen/standard_padding"
-        android:paddingLeft="@dimen/standard_padding"
-        android:paddingBottom="@dimen/zero">
-
-        <FrameLayout
-            android:id="@+id/drawer_user_avatars"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="top"
-            android:layout_marginBottom="@dimen/standard_half_margin">
-
-            <ImageView
-                android:id="@+id/drawer_current_account"
-                android:layout_width="@dimen/nav_drawer_header_avatar"
-                android:layout_height="@dimen/nav_drawer_header_avatar"
-                android:src="@drawable/account_circle_white"
-                android:contentDescription="@string/drawer_current_account"/>
-
-            <ImageView
-                android:id="@+id/drawer_account_middle"
-                android:layout_width="@dimen/nav_drawer_header_avatar_other_accounts_size"
-                android:layout_height="@dimen/nav_drawer_header_avatar_other_accounts_size"
-                android:layout_gravity="end"
-                android:layout_marginEnd="@dimen/nav_drawer_header_avatar_second_account_margin"
-                android:src="@drawable/account_circle_white"
-                android:onClick="onAccountDrawerClick"
-                android:contentDescription="@string/drawer_middle_account"/>
-
-            <ImageView
-                android:id="@+id/drawer_account_end"
-                android:layout_width="@dimen/nav_drawer_header_avatar_other_accounts_size"
-                android:layout_height="@dimen/nav_drawer_header_avatar_other_accounts_size"
-                android:layout_gravity="end"
-                android:src="@drawable/account_circle_white"
-                android:onClick="onAccountDrawerClick"
-                android:contentDescription="@string/drawer_end_account"/>
-
-        </FrameLayout>
-
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_below="@+id/drawer_user_avatars"
-            >
-
-            <LinearLayout
-                android:layout_width="0dp"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"
-                android:layout_weight="1"
-                android:orientation="vertical"
-                android:paddingEnd="@dimen/standard_half_padding"
-                android:paddingStart="@dimen/zero">
-
-                <TextView
-                    android:id="@+id/drawer_username"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:ellipsize="end"
-                    android:shadowColor="@color/drawer_shadow"
-                    android:shadowDx="0.5"
-                    android:shadowDy="0"
-                    android:shadowRadius="2"
-                    android:maxLines="1"
-                    android:text="@string/app_name"
-                    android:textColor="@color/text_color"
-                    android:textSize="@dimen/drawer_header_text"
-                    android:textStyle="bold"/>
-
-                <TextView
-                    android:id="@+id/drawer_username_full"
-                    android:layout_width="match_parent"
-                    android:layout_height="28dp"
-                    android:ellipsize="end"
-                    android:lines="1"
-                    android:maxLines="1"
-                    android:shadowColor="@color/drawer_shadow"
-                    android:shadowDx="0.5"
-                    android:shadowDy="0"
-                    android:shadowRadius="2"
-                    android:text="@string/app_name"
-                    android:textColor="@color/text_color"
-                    android:textSize="@dimen/drawer_header_subtext"/>
-
-            </LinearLayout>
-
-            <ImageView
-                android:id="@+id/drawer_account_chooser_toggle"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center_vertical"
-                android:layout_marginBottom="8dp"
-                android:contentDescription="@string/drawer_manage_accounts"
-                android:src="@drawable/ic_down"/>
-
-        </LinearLayout>
-
-    </RelativeLayout>
+        android:layout_margin="@dimen/standard_margin"
+        android:src="@drawable/nextcloud_logo"
+        android:scaleType="fitCenter"/>
 
 </FrameLayout>

+ 0 - 18
src/main/res/menu/partial_drawer_entries.xml

@@ -95,24 +95,6 @@
             android:title="@string/drawer_item_trashbin"/>
     </group>
 
-    <!--
-      account list placeholder
-      all items in this group MUST have orderInCategory="2" set
-      all accounts are dynamically added with orderInCategory="1" set
-    -->
-    <group android:id="@+id/drawer_menu_accounts">
-        <item
-            android:id="@+id/drawer_menu_account_add"
-            android:icon="@drawable/ic_account_plus"
-            android:orderInCategory="2"
-            android:title="@string/prefs_add_account"/>
-        <item
-            android:id="@+id/drawer_menu_account_manage"
-            android:icon="@drawable/nav_settings"
-            android:orderInCategory="2"
-            android:title="@string/drawer_manage_accounts"/>
-    </group>
-
     <!--
      all items in this group MUST have orderInCategory="3" set
    -->

+ 2 - 7
src/main/res/values/dims.xml

@@ -19,12 +19,6 @@
     <!-- Default screen margins, per the Android Design guidelines. -->
     <dimen name="nav_drawer_header_height">140dp</dimen>
     <dimen name="nav_drawer_header_avatar">56dp</dimen>
-    <!-- avatar radius needs to 1/2 of the avatar dp value -->
-    <dimen name="nav_drawer_header_avatar_radius">28dp</dimen>
-    <dimen name="nav_drawer_header_avatar_other_accounts_size">40dp</dimen>
-    <dimen name="nav_drawer_header_avatar_other_accounts_radius">20dp</dimen>
-    <!-- margin must be nav_drawer_header_avatar_other_accounts_size+16dp -->
-    <dimen name="nav_drawer_header_avatar_second_account_margin">56dp</dimen>
     <dimen name="nav_drawer_menu_avatar_radius">12sp</dimen>
     <dimen name="list_item_avatar_icon_radius">20dp</dimen>
     <dimen name="bottom_sheet_menu_item_divider_standard_margin">56dp</dimen>
@@ -66,7 +60,6 @@
     <dimen name="alternate_padding_independent">10dip</dimen>
     <dimen name="activity_row_layout_min_width_independent">196dip</dimen>
     <dimen name="user_icon_size_independent">40dip</dimen>
-    <dimen name="drawer_header_text">14sp</dimen>
     <dimen name="drawer_header_subtext">12sp</dimen>
     <dimen name="edit_share_layout_view_height">2dp</dimen>
     <dimen name="fragment_margin">12dp</dimen>
@@ -143,6 +136,8 @@
     <dimen name="button_corner_radius">24dp</dimen>
     <integer name="media_grid_width">4</integer>
     <dimen name="copy_internal_link_padding">10dp</dimen>
+    <dimen name="drawer_header_height">130dp</dimen>
+    <dimen name="drawer_header_logo_width">170dp</dimen>
     <dimen name="account_action_button_margin">12dp</dimen>
     <dimen name="account_action_button_height">50dp</dimen>
     <dimen name="account_action_button_vertical_margin">10dp</dimen>

+ 0 - 3
src/main/res/values/setup.xml

@@ -61,9 +61,6 @@
     <bool name="show_drawer_logout">false</bool>
     <bool name="show_drawer_contacts_backup">false</bool> <!-- if false it will shown in settings -->
 
-    <!-- Various other options -->
-    <bool name="allow_profile_click">true</bool>
-
     <!-- Help, imprint and feedback, and other things -->
     <bool name="passcode_enabled">true</bool>
     <bool name="device_credentials_enabled">true</bool>

+ 0 - 3
src/main/res/values/strings.xml

@@ -668,9 +668,6 @@
     <string name="store_short_desc">The self-hosted productivity platform that keeps you in control</string>
     <string name="store_full_desc">The self-hosted productivity platform that keeps you in control.\n\nFeatures:\n* Easy, modern interface, suited to the theme of your server\n* Upload files to your Nextcloud server\n* Share them with others\n* Keep your favorite files and folders synced\n* Search across all folders on your server\n* Auto Upload for photos and videos taken by your device\n* Keep up to date with notifications\n* Multi-account support\n* Secure access to your data with fingerprint or PIN\n* Integration with DAVx5 (formerly known as DAVdroid) for easy setup of calendar &amp; Contacts synchronization\n\nPlease report all issues at https://github.com/nextcloud/android/issues and discuss this app at https://help.nextcloud.com/c/clients/android\n\nNew to Nextcloud? Nextcloud is a private file sync &amp; share and communication server. It is libre software, and you can host it yourself or pay a company to do it for you. That way, you are in control of your photos, your calendar and contact data, your documents and everything else.\n\nCheck out Nextcloud at https://nextcloud.com</string>
 
-    <string name="drawer_current_account">Current account</string>
-    <string name="drawer_middle_account">Middle account</string>
-    <string name="drawer_end_account">Last account</string>
     <string name="contactlist_item_icon">User icon for contact list</string>
     <string name="activity_icon">Activity</string>
     <string name="file_icon">File</string>