|
@@ -4,17 +4,17 @@
|
|
* @author Mario Danic
|
|
* @author Mario Danic
|
|
* Copyright (C) 2017 Mario Danic
|
|
* Copyright (C) 2017 Mario Danic
|
|
* Copyright (C) 2017 Nextcloud GmbH.
|
|
* Copyright (C) 2017 Nextcloud GmbH.
|
|
- *
|
|
|
|
|
|
+ * <p>
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* at your option) any later version.
|
|
* at your option) any later version.
|
|
- *
|
|
|
|
|
|
+ * <p>
|
|
* This program is distributed in the hope that it will be useful,
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Affero General Public License for more details.
|
|
* GNU Affero General Public License for more details.
|
|
- *
|
|
|
|
|
|
+ * <p>
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
*/
|
|
@@ -100,9 +100,9 @@ public class UserInfoAdapter extends RecyclerView.Adapter<UserInfoAdapter.ViewHo
|
|
|
|
|
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
|
@BindView(R.id.attribute_headline_tv)
|
|
@BindView(R.id.attribute_headline_tv)
|
|
- TextView attributeHeadlineTextView;
|
|
|
|
|
|
+ public TextView attributeHeadlineTextView;
|
|
@BindView(R.id.attribute_value_tv)
|
|
@BindView(R.id.attribute_value_tv)
|
|
- TextView attributeValueTextView;
|
|
|
|
|
|
+ public TextView attributeValueTextView;
|
|
|
|
|
|
public ViewHolder(View itemView) {
|
|
public ViewHolder(View itemView) {
|
|
super(itemView);
|
|
super(itemView);
|
|
@@ -111,46 +111,34 @@ public class UserInfoAdapter extends RecyclerView.Adapter<UserInfoAdapter.ViewHo
|
|
}
|
|
}
|
|
|
|
|
|
private void getRelevantInformation() {
|
|
private void getRelevantInformation() {
|
|
- if (!TextUtils.isEmpty(userInfo.getDisplayName())) {
|
|
|
|
- if (context != null) {
|
|
|
|
- stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_full_name),
|
|
|
|
- userInfo.getDisplayName()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (!TextUtils.isEmpty(userInfo.getDisplayName()) && context != null) {
|
|
|
|
+ stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_full_name),
|
|
|
|
+ userInfo.getDisplayName()));
|
|
}
|
|
}
|
|
|
|
|
|
- if (!TextUtils.isEmpty((userInfo.getEmail()))) {
|
|
|
|
- if (context != null) {
|
|
|
|
- stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_email),
|
|
|
|
- userInfo.getEmail()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (!TextUtils.isEmpty((userInfo.getEmail())) && context != null) {
|
|
|
|
+ stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_email),
|
|
|
|
+ userInfo.getEmail()));
|
|
}
|
|
}
|
|
|
|
|
|
- if (!TextUtils.isEmpty(userInfo.getPhone())) {
|
|
|
|
- if (context != null) {
|
|
|
|
- stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_phone),
|
|
|
|
- userInfo.getPhone()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (!TextUtils.isEmpty(userInfo.getPhone()) && context != null) {
|
|
|
|
+ stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_phone),
|
|
|
|
+ userInfo.getPhone()));
|
|
}
|
|
}
|
|
|
|
|
|
- if (!TextUtils.isEmpty(userInfo.getAddress())) {
|
|
|
|
- if (context != null) {
|
|
|
|
- stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_address),
|
|
|
|
- userInfo.getAddress()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (!TextUtils.isEmpty(userInfo.getAddress()) && context != null) {
|
|
|
|
+ stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_address),
|
|
|
|
+ userInfo.getAddress()));
|
|
}
|
|
}
|
|
|
|
|
|
- if (!TextUtils.isEmpty(userInfo.getWebpage())) {
|
|
|
|
- if (context != null) {
|
|
|
|
- stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_website),
|
|
|
|
- userInfo.getWebpage()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (!TextUtils.isEmpty(userInfo.getWebpage()) && context != null) {
|
|
|
|
+ stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_website),
|
|
|
|
+ userInfo.getWebpage()));
|
|
}
|
|
}
|
|
|
|
|
|
- if (!TextUtils.isEmpty(userInfo.getTwitter())) {
|
|
|
|
- if (context != null) {
|
|
|
|
- stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_twitter),
|
|
|
|
- userInfo.getTwitter()));
|
|
|
|
- }
|
|
|
|
|
|
+ if (!TextUtils.isEmpty(userInfo.getTwitter()) && context != null) {
|
|
|
|
+ stringPairs.add(new StringPair(context.getResources().getString(R.string.user_info_twitter),
|
|
|
|
+ userInfo.getTwitter()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|