Browse Source

Merge pull request #1919 from nextcloud/infoIfNoUserInfo

show info if no userinfo is available
Tobias Kaminsky 7 years ago
parent
commit
7541e41634

+ 1 - 1
scripts/lint/lint-results.txt

@@ -1,2 +1,2 @@
 DO NOT TOUCH; GENERATED BY DRONE
-      <span class="mdl-layout-title">Lint Report: 131 warnings</span>
+      <span class="mdl-layout-title">Lint Report: 129 warnings</span>

+ 181 - 191
src/main/java/com/owncloud/android/ui/activity/UserInfoActivity.java

@@ -1,4 +1,4 @@
-/**
+/*
  * Nextcloud Android client application
  *
  * @author Mario Danic
@@ -30,20 +30,22 @@ import android.app.Dialog;
 import android.app.DialogFragment;
 import android.app.FragmentManager;
 import android.content.ContentResolver;
-import android.content.DialogInterface;
 import android.content.Intent;
 import android.graphics.PorterDuff;
 import android.graphics.drawable.ColorDrawable;
 import android.graphics.drawable.Drawable;
 import android.graphics.drawable.LayerDrawable;
-import android.os.Build;
 import android.os.Bundle;
 import android.support.annotation.ColorInt;
+import android.support.annotation.DrawableRes;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
-import android.support.design.widget.AppBarLayout;
+import android.support.annotation.StringRes;
 import android.support.v4.graphics.drawable.DrawableCompat;
+import android.support.v7.widget.DividerItemDecoration;
+import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
+import android.view.LayoutInflater;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -54,7 +56,10 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.ProgressBar;
 import android.widget.TextView;
-
+import butterknife.BindString;
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
 import com.bumptech.glide.Glide;
 import com.bumptech.glide.request.animation.GlideAnimation;
 import com.bumptech.glide.request.target.SimpleTarget;
@@ -73,16 +78,13 @@ import com.owncloud.android.ui.events.TokenPushEvent;
 import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.PushUtils;
 import com.owncloud.android.utils.ThemeUtils;
-
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
 import org.parceler.Parcels;
 
-import butterknife.BindString;
-import butterknife.BindView;
-import butterknife.ButterKnife;
-import butterknife.Unbinder;
+import java.util.LinkedList;
+import java.util.List;
 
 /**
  * This Activity presents the user information.
@@ -96,80 +98,18 @@ public class UserInfoActivity extends FileActivity {
 
     private static final int KEY_DELETE_CODE = 101;
 
-    @BindView(R.id.empty_list_view)
-    public LinearLayout emptyContentContainer;
-
-    @BindView(R.id.empty_list_view_text)
-    public TextView emptyContentMessage;
-
-    @BindView(R.id.empty_list_view_headline)
-    public TextView emptyContentHeadline;
-
-    @BindView(R.id.empty_list_icon)
-    public ImageView emptyContentIcon;
-
-    @BindView(R.id.user_info_view)
-    public LinearLayout userInfoView;
-
-    @BindView(R.id.user_icon)
-    public ImageView avatar;
-
-    @BindView(R.id.userinfo_username)
-    public TextView userName;
-
-    @BindView(R.id.userinfo_username_full)
-    public TextView fullName;
-
-    @BindView(R.id.phone_container)
-    public View mPhoneNumberContainer;
-
-    @BindView(R.id.phone_number)
-    public TextView mPhoneNumberTextView;
-
-    @BindView(R.id.phone_icon)
-    public ImageView mPhoneNumberIcon;
-
-    @BindView(R.id.email_container)
-    public View mEmailContainer;
-
-    @BindView(R.id.email_address)
-    public TextView mEmailAddressTextView;
-
-    @BindView(R.id.email_icon)
-    public ImageView mEmailIcon;
-
-    @BindView(R.id.address_container)
-    public View mAddressContainer;
-
-    @BindView(R.id.address)
-    public TextView mAddressTextView;
-
-    @BindView(R.id.address_icon)
-    public ImageView mAddressIcon;
-
-    @BindView(R.id.website_container)
-    public View mWebsiteContainer;
-
-    @BindView(R.id.website_address)
-    public TextView mWebsiteTextView;
-
-    @BindView(R.id.website_icon)
-    public ImageView mWebsiteIcon;
-
-    @BindView(R.id.twitter_container)
-    public View mTwitterContainer;
-
-    @BindView(R.id.twitter_handle)
-    public TextView mTwitterHandleTextView;
-
-    @BindView(R.id.twitter_icon)
-    public ImageView mTwitterIcon;
-
-    @BindView(R.id.empty_list_progress)
-    public ProgressBar multiListProgressBar;
-
-    @BindString(R.string.user_information_retrieval_error)
-    public String sorryMessage;
+    @BindView(R.id.empty_list_view) protected LinearLayout emptyContentContainer;
+    @BindView(R.id.empty_list_view_text) protected TextView emptyContentMessage;
+    @BindView(R.id.empty_list_view_headline) protected TextView emptyContentHeadline;
+    @BindView(R.id.empty_list_icon) protected ImageView emptyContentIcon;
+    @BindView(R.id.user_info_view) protected LinearLayout userInfoView;
+    @BindView(R.id.user_icon) protected ImageView avatar;
+    @BindView(R.id.userinfo_username) protected TextView userName;
+    @BindView(R.id.userinfo_username_full) protected TextView fullName;
+    @BindView(R.id.user_info_list) protected RecyclerView mUserInfoList;
+    @BindView(R.id.empty_list_progress) protected ProgressBar multiListProgressBar;
+    
+    @BindString(R.string.user_information_retrieval_error) protected String sorryMessage;
 
     private float mCurrentAccountAvatarRadiusDimension;
 
@@ -205,11 +145,11 @@ public class UserInfoActivity extends FileActivity {
         setupToolbar(useBackgroundImage);
         updateActionBarTitleAndHomeButtonByString("");
 
+        mUserInfoList.setAdapter(new UserInfoAdapter(null, ThemeUtils.primaryColor(getAccount())));
+        mUserInfoList.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
 
         if (userInfo != null) {
             populateUserInfoUi(userInfo);
-            emptyContentContainer.setVisibility(View.GONE);
-            userInfoView.setVisibility(View.VISIBLE);
         } else {
             setMultiListLoadingMessage();
             fetchAndSetData();
@@ -264,11 +204,11 @@ public class UserInfoActivity extends FileActivity {
         }
     }
 
-    private void setErrorMessageForMultiList(String headline, String message) {
+    private void setErrorMessageForMultiList(String headline, String message, @DrawableRes int errorResource) {
         if (emptyContentContainer != null && emptyContentMessage != null) {
             emptyContentHeadline.setText(headline);
             emptyContentMessage.setText(message);
-            emptyContentIcon.setImageResource(R.drawable.ic_list_empty_error);
+            emptyContentIcon.setImageResource(errorResource);
 
             multiListProgressBar.setVisibility(View.GONE);
             emptyContentIcon.setVisibility(View.VISIBLE);
@@ -327,41 +267,47 @@ public class UserInfoActivity extends FileActivity {
 
         int tint = ThemeUtils.primaryColor(account);
 
-        if (userInfo != null) {
-            if (!TextUtils.isEmpty(userInfo.getDisplayName())) {
-                fullName.setText(userInfo.getDisplayName());
-            }
-
-            populateUserInfoElement(mPhoneNumberContainer, mPhoneNumberTextView, userInfo.getPhone(),
-                    mPhoneNumberIcon, tint);
-            populateUserInfoElement(mEmailContainer, mEmailAddressTextView, userInfo.getEmail(), mEmailIcon, tint);
-            populateUserInfoElement(mAddressContainer, mAddressTextView, userInfo.getAddress(), mAddressIcon, tint);
-
-            populateUserInfoElement(
-                    mWebsiteContainer,
-                    mWebsiteTextView,
-                    DisplayUtils.beautifyURL(userInfo.getWebpage()),
-                    mWebsiteIcon,
-                    tint);
-            populateUserInfoElement(
-                    mTwitterContainer,
-                    mTwitterHandleTextView,
-                    DisplayUtils.beautifyTwitterHandle(userInfo.getTwitter()),
-                    mTwitterIcon,
-                    tint);
+        if (!TextUtils.isEmpty(userInfo.getDisplayName())) {
+            fullName.setText(userInfo.getDisplayName());
         }
-    }
+        
+        if (userInfo.getPhone() == null && userInfo.getEmail() == null && userInfo.getAddress() == null
+                && userInfo.getTwitter() == null & userInfo.getWebpage() == null) {
 
-    private void populateUserInfoElement(View container, TextView textView, String text, ImageView icon, @ColorInt int
-            tint) {
-        if (!TextUtils.isEmpty(text)) {
-            textView.setText(text);
-            DrawableCompat.setTint(icon.getDrawable(), tint);
+            setErrorMessageForMultiList(getString(R.string.userinfo_no_info_headline),
+                    getString(R.string.userinfo_no_info_text), R.drawable.ic_user);
         } else {
-            container.setVisibility(View.GONE);
+            emptyContentContainer.setVisibility(View.GONE);
+            userInfoView.setVisibility(View.VISIBLE);
+
+            if (mUserInfoList.getAdapter() instanceof UserInfoAdapter) {
+                mUserInfoList.setAdapter(new UserInfoAdapter(createUserInfoDetails(userInfo), tint));
+            }
         }
     }
 
+    private List<UserInfoDetailsItem> createUserInfoDetails(UserInfo userInfo) {
+        List<UserInfoDetailsItem> result = new LinkedList<>();
+
+        addToListIfNeeded(result, R.drawable.ic_phone, userInfo.getPhone(), R.string.user_info_phone);
+        addToListIfNeeded(result, R.drawable.ic_email, userInfo.getEmail(), R.string.user_info_email);
+        addToListIfNeeded(result, R.drawable.ic_map_marker, userInfo.getAddress(), R.string.user_info_address);
+        addToListIfNeeded(result, R.drawable.ic_web, DisplayUtils.beautifyURL(userInfo.getWebpage()),
+                    R.string.user_info_website);
+        addToListIfNeeded(result, R.drawable.ic_twitter, DisplayUtils.beautifyTwitterHandle(userInfo.getTwitter()),
+                    R.string.user_info_twitter);
+
+        return result;
+    }
+
+    private void addToListIfNeeded(List<UserInfoDetailsItem> info,
+                                   @DrawableRes int icon,
+                                   String text,
+                                   @StringRes int contentDescriptionInt) {
+        if (!TextUtils.isEmpty(text))
+            info.add(new UserInfoDetailsItem(icon, text, getResources().getString(contentDescriptionInt)));
+    }
+
     private void changeAccountPassword(Account account) {
         // let the user update credentials with one click
         Intent updateAccountCredentials = new Intent(this, AuthenticatorActivity.class);
@@ -410,57 +356,54 @@ public class UserInfoActivity extends FileActivity {
                     .setMessage(getResources().getString(R.string.delete_account_warning, account.name))
                     .setIcon(R.drawable.ic_warning)
                     .setPositiveButton(R.string.common_ok,
-                            new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialogInterface, int i) {
-                                    // remove contact backup job
-                                    ContactsPreferenceActivity.cancelContactBackupJobForAccount(getActivity(), account);
-
-                                    ContentResolver contentResolver = getActivity().getContentResolver();
-
-                                    // disable daily backup
-                                    ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(
-                                            contentResolver);
-
-                                    arbitraryDataProvider.storeOrUpdateKeyValue(account.name,
-                                            ContactsPreferenceActivity.PREFERENCE_CONTACTS_AUTOMATIC_BACKUP,
-                                            "false");
-
-                                    String arbitraryDataPushString;
-
-                                    if (!TextUtils.isEmpty(arbitraryDataPushString = arbitraryDataProvider.getValue(
-                                            account, PushUtils.KEY_PUSH)) &&
-                                            !TextUtils.isEmpty(getResources().getString(R.string.push_server_url))) {
-                                        Gson gson = new Gson();
-                                        PushConfigurationState pushArbitraryData = gson.fromJson(arbitraryDataPushString,
-                                                PushConfigurationState.class);
-                                        pushArbitraryData.setShouldBeDeleted(true);
-                                        arbitraryDataProvider.storeOrUpdateKeyValue(account.name, PushUtils.KEY_PUSH,
-                                                gson.toJson(pushArbitraryData));
-                                        EventBus.getDefault().post(new TokenPushEvent());
-                                    }
-
-
-                                    if (getActivity() != null && !removeDirectly) {
-                                        Bundle bundle = new Bundle();
-                                        bundle.putParcelable(KEY_ACCOUNT, Parcels.wrap(account));
-                                        Intent intent = new Intent();
-                                        intent.putExtras(bundle);
-                                        getActivity().setResult(KEY_DELETE_CODE, intent);
-                                        getActivity().finish();
-                                    } else {
-                                        AccountManager am = (AccountManager) getActivity()
-                                                .getSystemService(ACCOUNT_SERVICE);
-
-                                        am.removeAccount(account, null, null);
-
-                                        Intent start = new Intent(getActivity(), FileDisplayActivity.class);
-                                        start.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                                        startActivity(start);
-
-                                    }
+                            (dialogInterface, i) -> {
+                                // remove contact backup job
+                                ContactsPreferenceActivity.cancelContactBackupJobForAccount(getActivity(), account);
+
+                                ContentResolver contentResolver = getActivity().getContentResolver();
+
+                                // disable daily backup
+                                ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProvider(
+                                        contentResolver);
+
+                                arbitraryDataProvider.storeOrUpdateKeyValue(account.name,
+                                        ContactsPreferenceActivity.PREFERENCE_CONTACTS_AUTOMATIC_BACKUP,
+                                        "false");
+
+                                String arbitraryDataPushString;
+
+                                if (!TextUtils.isEmpty(arbitraryDataPushString = arbitraryDataProvider.getValue(
+                                        account, PushUtils.KEY_PUSH)) &&
+                                        !TextUtils.isEmpty(getResources().getString(R.string.push_server_url))) {
+                                    Gson gson = new Gson();
+                                    PushConfigurationState pushArbitraryData = gson.fromJson(arbitraryDataPushString,
+                                            PushConfigurationState.class);
+                                    pushArbitraryData.setShouldBeDeleted(true);
+                                    arbitraryDataProvider.storeOrUpdateKeyValue(account.name, PushUtils.KEY_PUSH,
+                                            gson.toJson(pushArbitraryData));
+                                    EventBus.getDefault().post(new TokenPushEvent());
+                                }
+
+
+                                if (getActivity() != null && !removeDirectly) {
+                                    Bundle bundle = new Bundle();
+                                    bundle.putParcelable(KEY_ACCOUNT, Parcels.wrap(account));
+                                    Intent intent = new Intent();
+                                    intent.putExtras(bundle);
+                                    getActivity().setResult(KEY_DELETE_CODE, intent);
+                                    getActivity().finish();
+                                } else {
+                                    AccountManager am = (AccountManager) getActivity()
+                                            .getSystemService(ACCOUNT_SERVICE);
+
+                                    am.removeAccount(account, null, null);
+
+                                    Intent start = new Intent(getActivity(), FileDisplayActivity.class);
+                                    start.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+                                    startActivity(start);
 
                                 }
+
                             })
                     .setNegativeButton(R.string.common_cancel, null)
                     .create();
@@ -468,34 +411,20 @@ public class UserInfoActivity extends FileActivity {
     }
 
     private void fetchAndSetData() {
-        Thread t = new Thread(new Runnable() {
-            public void run() {
-
-                RemoteOperation getRemoteUserInfoOperation = new GetRemoteUserInfoOperation();
-                RemoteOperationResult result = getRemoteUserInfoOperation.execute(account, UserInfoActivity.this);
+        Thread t = new Thread(() -> {
+            RemoteOperation getRemoteUserInfoOperation = new GetRemoteUserInfoOperation();
+            RemoteOperationResult result = getRemoteUserInfoOperation.execute(account, UserInfoActivity.this);
 
-                if (result.isSuccess() && result.getData() != null) {
-                    userInfo = (UserInfo) result.getData().get(0);
+            if (result.isSuccess() && result.getData() != null) {
+                userInfo = (UserInfo) result.getData().get(0);
 
-                    runOnUiThread(new Runnable() {
-                        @Override
-                        public void run() {
-                            populateUserInfoUi(userInfo);
+                runOnUiThread(() -> populateUserInfoUi(userInfo));
 
-                            emptyContentContainer.setVisibility(View.GONE);
-                            userInfoView.setVisibility(View.VISIBLE);
-                        }
-                    });
-                } else {
-                    // show error
-                    runOnUiThread(new Runnable() {
-                        @Override
-                        public void run() {
-                            setErrorMessageForMultiList(sorryMessage, result.getLogMessage());
-                        }
-                    });
-                    Log_OC.d(TAG, result.getLogMessage());
-                }
+            } else {
+                // show error
+                runOnUiThread(() -> setErrorMessageForMultiList(sorryMessage, result.getLogMessage(),
+                        R.drawable.ic_list_empty_error));
+                Log_OC.d(TAG, result.getLogMessage());
             }
         });
 
@@ -514,4 +443,65 @@ public class UserInfoActivity extends FileActivity {
     public void onMessageEvent(TokenPushEvent event) {
         PushUtils.pushRegistrationToServer();
     }
+
+
+    protected class UserInfoDetailsItem {
+        @DrawableRes public int icon;
+        public String text;
+        public String iconContentDescription;
+
+        public UserInfoDetailsItem(@DrawableRes int icon, String text, String iconContentDescription) {
+            this.icon = icon;
+            this.text = text;
+            this.iconContentDescription = iconContentDescription;
+        }
+    }
+
+    protected class UserInfoAdapter extends RecyclerView.Adapter<UserInfoAdapter.ViewHolder> {
+        protected List<UserInfoDetailsItem> mDisplayList;
+        @ColorInt protected int mTintColor;
+
+        public class ViewHolder extends RecyclerView.ViewHolder {
+
+            @BindView(R.id.icon) protected ImageView icon = null;
+            @BindView(R.id.text) protected TextView text = null;
+
+            public ViewHolder(View itemView) {
+                super(itemView);
+                ButterKnife.bind(this, itemView);
+            }
+        }
+
+        public UserInfoAdapter(List<UserInfoDetailsItem> displayList, @ColorInt int tintColor) {
+            mDisplayList = displayList == null ? new LinkedList<>() : displayList;
+            mTintColor = tintColor;
+        }
+
+        public void setData(List<UserInfoDetailsItem> displayList) {
+            mDisplayList = displayList == null ? new LinkedList<>() : displayList;
+            notifyDataSetChanged();
+        }
+
+        @Override
+        public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+            LayoutInflater inflater = LayoutInflater.from(parent.getContext());
+            View view = inflater.inflate(R.layout.user_info_details_table_item, parent, false);
+            ViewHolder holder = new ViewHolder(view);
+            return holder;
+        }
+
+        @Override
+        public void onBindViewHolder(ViewHolder holder, int position) {
+            UserInfoDetailsItem item = mDisplayList.get(position);
+            holder.icon.setImageResource(item.icon);
+            holder.text.setText(item.text);
+            holder.icon.setContentDescription(item.iconContentDescription);
+            DrawableCompat.setTint(holder.icon.getDrawable(), mTintColor);
+        }
+
+        @Override
+        public int getItemCount() {
+            return mDisplayList.size();
+        }
+    }
 }

+ 1 - 0
src/main/res/layout/drawer_header.xml

@@ -28,6 +28,7 @@
         android:id="@+id/drawer_header_background"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:contentDescription="@string/drawer_header_background"
         android:src="@drawable/background"
         android:scaleType="centerCrop"/>
 

+ 1 - 0
src/main/res/layout/toolbar_user_information.xml

@@ -34,6 +34,7 @@
             android:id="@+id/drawer_header_background"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
+            android:contentDescription="@string/drawer_header_background"
             android:scaleType="centerCrop"/>
 
         <android.support.v7.widget.Toolbar

+ 28 - 0
src/main/res/layout/user_info_details_table_item.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:id="@+id/icon"
+        android:contentDescription="@string/account_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/standard_margin"
+        android:layout_marginLeft="@dimen/standard_icon_list_horizontal_margin"
+        android:layout_marginRight="@dimen/standard_icon_list_horizontal_margin"
+        android:layout_marginTop="@dimen/standard_margin"/>
+
+    <TextView
+        android:id="@+id/text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_centerInParent="true"
+        android:layout_margin="@dimen/standard_margin"
+        android:layout_toEndOf="@id/icon"
+        android:layout_toRightOf="@id/icon"
+        android:maxLines="3"
+        android:textAppearance="?android:attr/textAppearanceListItem"/>
+
+</RelativeLayout>

+ 7 - 194
src/main/res/layout/user_info_layout.xml

@@ -19,8 +19,8 @@
   License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                                                 xmlns:card_view="http://schemas.android.com/apk/res-auto"
                                                  xmlns:app="http://schemas.android.com/apk/res-auto"
+                                                 xmlns:card_view="http://schemas.android.com/apk/res-auto"
                                                  android:layout_width="match_parent"
                                                  android:layout_height="match_parent">
 
@@ -53,199 +53,13 @@
                 card_view:cardCornerRadius="3dp"
                 card_view:cardUseCompatPadding="true">
 
-                <LinearLayout
-                    android:layout_width="match_parent"
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/user_info_list"
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:orientation="vertical">
-
-                    <RelativeLayout
-                        android:id="@+id/phone_container"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content">
-
-                        <ImageView
-                            android:id="@+id/phone_icon"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginLeft="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginRight="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:contentDescription="@string/user_info_phone"
-                            android:src="@drawable/ic_phone"/>
-
-                        <TextView
-                            android:id="@+id/phone_number"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_centerInParent="true"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginEnd="@dimen/standard_padding"
-                            android:layout_marginRight="@dimen/standard_padding"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:layout_toEndOf="@id/phone_icon"
-                            android:layout_toRightOf="@id/phone_icon"
-                            android:maxLines="3"
-                            android:text="@string/placeholder_filename"
-                            android:textAppearance="?android:attr/textAppearanceListItem"/>
-
-                    </RelativeLayout>
-
-                    <RelativeLayout
-                        android:id="@+id/email_container"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content">
-
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="@color/list_divider_background"/>
-
-                        <ImageView
-                            android:id="@+id/email_icon"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginLeft="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginRight="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:contentDescription="@string/user_info_email"
-                            android:src="@drawable/ic_email"/>
-
-                        <TextView
-                            android:id="@+id/email_address"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_centerInParent="true"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginEnd="@dimen/standard_padding"
-                            android:layout_marginRight="@dimen/standard_padding"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:layout_toEndOf="@id/email_icon"
-                            android:layout_toRightOf="@id/email_icon"
-                            android:maxLines="3"
-                            android:text="@string/placeholder_filename"
-                            android:textAppearance="?android:attr/textAppearanceListItem"/>
-
-                    </RelativeLayout>
-
-                    <RelativeLayout
-                        android:id="@+id/address_container"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content">
-
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="@color/list_divider_background"/>
-
-                        <ImageView
-                            android:id="@+id/address_icon"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginLeft="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginRight="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:contentDescription="@string/user_info_address"
-                            android:src="@drawable/ic_map_marker"/>
-
-                        <TextView
-                            android:id="@+id/address"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_centerInParent="true"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginEnd="@dimen/standard_padding"
-                            android:layout_marginRight="@dimen/standard_padding"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:layout_toEndOf="@+id/address_icon"
-                            android:layout_toRightOf="@+id/address_icon"
-                            android:maxLines="3"
-                            android:text="@string/placeholder_filename"
-                            android:textAppearance="?android:attr/textAppearanceListItem"/>
-
-                    </RelativeLayout>
-
-                    <RelativeLayout
-                        android:id="@+id/website_container"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content">
-
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="@color/list_divider_background"/>
-
-                        <ImageView
-                            android:id="@+id/website_icon"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginLeft="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginRight="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:contentDescription="@string/user_info_website"
-                            android:src="@drawable/ic_web"/>
-
-                        <TextView
-                            android:id="@+id/website_address"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_centerInParent="true"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginEnd="@dimen/standard_padding"
-                            android:layout_marginRight="@dimen/standard_padding"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:layout_toEndOf="@id/website_icon"
-                            android:layout_toRightOf="@id/website_icon"
-                            android:maxLines="3"
-                            android:text="@string/placeholder_filename"
-                            android:textAppearance="?android:attr/textAppearanceListItem"
-                            android:textColor="?android:attr/textColorSecondary"/>
-
-                    </RelativeLayout>
-
-                    <RelativeLayout
-                        android:id="@+id/twitter_container"
-                        android:layout_width="match_parent"
-                        android:layout_height="wrap_content">
-
-                        <View
-                            android:layout_width="match_parent"
-                            android:layout_height="1dp"
-                            android:background="@color/list_divider_background"/>
-
-                        <ImageView
-                            android:id="@+id/twitter_icon"
-                            android:layout_width="wrap_content"
-                            android:layout_height="wrap_content"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginLeft="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginRight="@dimen/standard_icon_list_horizontal_margin"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:contentDescription="@string/user_info_twitter"
-                            android:src="@drawable/ic_twitter"/>
-
-                        <TextView
-                            android:id="@+id/twitter_handle"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:layout_centerInParent="true"
-                            android:layout_marginBottom="@dimen/standard_margin"
-                            android:layout_marginEnd="@dimen/standard_padding"
-                            android:layout_marginRight="@dimen/standard_padding"
-                            android:layout_marginTop="@dimen/standard_margin"
-                            android:layout_toEndOf="@id/twitter_icon"
-                            android:layout_toRightOf="@id/twitter_icon"
-                            android:maxLines="3"
-                            android:text="@string/placeholder_filename"
-                            android:textAppearance="?android:attr/textAppearanceListItem"
-                            android:textColor="?android:attr/textColorSecondary"/>
-
-                    </RelativeLayout>
-
-                </LinearLayout>
+                    android:orientation="vertical"
+                    card_view:layoutManager="android.support.v7.widget.LinearLayoutManager">
+                </android.support.v7.widget.RecyclerView>
 
             </android.support.v7.widget.CardView>
 
@@ -253,5 +67,4 @@
 
     </android.support.v4.widget.NestedScrollView>
 
-
 </android.support.design.widget.CoordinatorLayout>

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

@@ -747,4 +747,9 @@
     <string name="screenshot_04_accounts">Connect to different accounts</string>
     <string name="screenshot_05_autoUpload">Automatically upload your photos &amp; videos</string>
     <string name="screenshot_06_davdroid">Sync Calendar &amp; Contacts with DAVdroid</string>
+    
+    <string name="userinfo_no_info_headline">No personal info set</string>
+    <string name="userinfo_no_info_text">Add name, picture and contact details on your profile page.</string>
+    <string name="drawer_header_background">Background image of drawer header</string>
+    <string name="account_icon">Account icon</string>
 </resources>