|
@@ -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();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|