Browse Source

renamed getter method to be more java style like

Andy Scherzinger 8 years ago
parent
commit
e043dfbcb4

+ 1 - 1
src/com/owncloud/android/authentication/AccountUtils.java

@@ -117,7 +117,7 @@ public class AccountUtils {
      * @param accountName the account name
      * @return the user's name
      */
-    public static String getUsernameOfAccount(String accountName) {
+    public static String getAccountUsername(String accountName) {
         if (accountName != null) {
             return accountName.substring(0, accountName.lastIndexOf("@"));
         } else {

+ 1 - 1
src/com/owncloud/android/datamodel/ThumbnailsCacheManager.java

@@ -507,7 +507,7 @@ public class ThumbnailsCacheManager {
                         GetMethod get = null;
                         try {
                             String uri = mClient.getBaseUri() + "" +
-                                    "/index.php/avatar/" + AccountUtils.getUsernameOfAccount(username) + "/" + px;
+                                    "/index.php/avatar/" + AccountUtils.getAccountUsername(username) + "/" + px;
                             Log_OC.d("Avatar", "URI: " + uri);
                             get = new GetMethod(uri);
                             int status = mClient.executeMethod(get);

+ 1 - 3
src/com/owncloud/android/ui/activity/DrawerActivity.java

@@ -28,8 +28,6 @@ import android.graphics.Bitmap;
 import android.os.Build;
 import android.os.Bundle;
 import android.support.design.widget.NavigationView;
-import android.support.v4.graphics.drawable.RoundedBitmapDrawable;
-import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
 import android.support.v4.view.GravityCompat;
 import android.support.v4.widget.DrawerLayout;
 import android.support.v7.app.ActionBarDrawerToggle;
@@ -442,7 +440,7 @@ public abstract class DrawerActivity extends ToolbarActivity {
             TextView username = (TextView) findNavigationViewChildById(R.id.drawer_username);
             TextView usernameFull = (TextView) findNavigationViewChildById(R.id.drawer_username_full);
             usernameFull.setText(account.name);
-            username.setText(AccountUtils.getUsernameOfAccount(account.name));
+            username.setText(AccountUtils.getAccountUsername(account.name));
 
             DisplayUtils.setAvatar(account, (ImageView) findNavigationViewChildById(R.id.drawer_current_account),
                     mCurrentAccountAvatarRadiusDimension, getResources(), getStorageManager());

+ 1 - 1
src/com/owncloud/android/utils/BitmapUtils.java

@@ -285,7 +285,7 @@ public class BitmapUtils {
      */
     public static int[] calculateRGB(String accountName) throws UnsupportedEncodingException, NoSuchAlgorithmException {
         // using adapted algorithm from /core/js/placeholder.js:50
-        String username = AccountUtils.getUsernameOfAccount(accountName);
+        String username = AccountUtils.getAccountUsername(accountName);
         byte[] seed = username.getBytes("UTF-8");
         MessageDigest md = MessageDigest.getInstance("MD5");
 //      Integer seedMd5Int = Math.abs(new String(Hex.encodeHex(seedMd5)).hashCode());