Mario Danic 8 жил өмнө
parent
commit
a4138da5d0

+ 11 - 10
src/com/owncloud/android/ui/activity/UserInfoActivity.java

@@ -73,27 +73,27 @@ public class UserInfoActivity extends FileActivity {
     private static final int KEY_DELETE_CODE = 101;
     private static final int KEY_DELETE_CODE = 101;
 
 
     @BindView(R.id.generic_rv)
     @BindView(R.id.generic_rv)
-    RecyclerView genericRecyclerView;
+    public RecyclerView genericRecyclerView;
 
 
     @BindView(R.id.multi_view)
     @BindView(R.id.multi_view)
-    RelativeLayout multiView;
+    public RelativeLayout multiView;
     @BindView(R.id.empty_list_view)
     @BindView(R.id.empty_list_view)
-    LinearLayout multiListContainer;
+    public LinearLayout multiListContainer;
     @BindView(R.id.empty_list_view_text)
     @BindView(R.id.empty_list_view_text)
-    TextView multiListMessage;
+    public TextView multiListMessage;
     @BindView(R.id.empty_list_view_headline)
     @BindView(R.id.empty_list_view_headline)
-    TextView multiListHeadline;
+    public TextView multiListHeadline;
     @BindView(R.id.empty_list_icon)
     @BindView(R.id.empty_list_icon)
-    ImageView multiListIcon;
+    public ImageView multiListIcon;
     @BindView(R.id.empty_list_progress)
     @BindView(R.id.empty_list_progress)
-    ProgressBar multiListProgressBar;
+    public ProgressBar multiListProgressBar;
 
 
     @BindString(R.string.preview_sorry)
     @BindString(R.string.preview_sorry)
-    String sorryMessage;
+    public String sorryMessage;
 
 
-    RecyclerView.LayoutManager layoutManager;
+    private RecyclerView.LayoutManager layoutManager;
 
 
-    RecyclerView.Adapter adapter;
+    private RecyclerView.Adapter adapter;
 
 
     private RecyclerView.Adapter adapter;
     private RecyclerView.Adapter adapter;
 
 
@@ -176,6 +176,7 @@ public class UserInfoActivity extends FileActivity {
                 break;
                 break;
             default:
             default:
                 retval = super.onOptionsItemSelected(item);
                 retval = super.onOptionsItemSelected(item);
+                break;
         }
         }
         return retval;
         return retval;
     }
     }

+ 23 - 35
src/com/owncloud/android/ui/adapter/UserInfoAdapter.java

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

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

@@ -34,7 +34,6 @@ import android.os.Handler;
 import android.os.IBinder;
 import android.os.IBinder;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.graphics.drawable.DrawableCompat;
 import android.support.v4.graphics.drawable.DrawableCompat;
-import android.util.Log;
 import android.view.MenuItem;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.View;
 import android.widget.AdapterView;
 import android.widget.AdapterView;
@@ -56,7 +55,6 @@ import com.owncloud.android.utils.DisplayUtils;
 
 
 import org.parceler.Parcels;
 import org.parceler.Parcels;
 
 
-import java.lang.reflect.Array;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Set;
 import java.util.Set;
 
 
@@ -147,6 +145,8 @@ public class ManageAccountsActivity extends FileActivity
                     }
                     }
                 }
                 }
                 break;
                 break;
+            default:
+                break;
         }
         }
     }
     }