Browse Source

格式化代码

liuyuqi-dellpc 6 years ago
parent
commit
158602893b

+ 2 - 1
app/src/main/java/me/yoqi/app/wxredpacket/services/HongbaoService.java

@@ -59,7 +59,8 @@ public class HongbaoService extends AccessibilityService implements SharedPrefer
 
         /* 检测通知消息 */
         if (!mMutex) {
-            if (sharedPreferences.getBoolean("pref_watch_notification", false) && watchNotifications(event)) return;
+            if (sharedPreferences.getBoolean("pref_watch_notification", false) && watchNotifications(event))
+                return;
             if (sharedPreferences.getBoolean("pref_watch_list", false) && watchList(event)) return;
             mListMutex = false;
         }

+ 0 - 3
app/src/main/java/me/yoqi/app/wxredpacket/utils/ConnectivityUtil.java

@@ -4,9 +4,6 @@ import android.content.Context;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 
-/**
- * Created by Zhongyi on 1/29/16.
- */
 public class ConnectivityUtil {
     public static boolean isWifi(Context context) {
         ConnectivityManager cm =

+ 4 - 2
app/src/main/java/me/yoqi/app/wxredpacket/utils/HongbaoSignature.java

@@ -36,7 +36,8 @@ public class HongbaoSignature {
 
             /* The sender and possible timestamp. Should mean something too. */
             String[] hongbaoInfo = getSenderContentDescriptionFromNode(messageNode);
-            if (this.getSignature(hongbaoInfo[0], hongbaoContent, hongbaoInfo[1]).equals(this.toString())) return false;
+            if (this.getSignature(hongbaoInfo[0], hongbaoContent, hongbaoInfo[1]).equals(this.toString()))
+                return false;
 
             /* So far we make sure it's a valid new coming hongbao. */
             this.sender = hongbaoInfo[0];
@@ -79,7 +80,8 @@ public class HongbaoSignature {
             AccessibilityNodeInfo thisNode = node.getChild(i);
             if ("android.widget.ImageView".equals(thisNode.getClassName()) && "unknownSender".equals(result[0])) {
                 CharSequence contentDescription = thisNode.getContentDescription();
-                if (contentDescription != null) result[0] = contentDescription.toString().replaceAll("头像$", "");
+                if (contentDescription != null)
+                    result[0] = contentDescription.toString().replaceAll("头像$", "");
             } else if ("android.widget.TextView".equals(thisNode.getClassName()) && "unknownTime".equals(result[1])) {
                 CharSequence thisNodeText = thisNode.getText();
                 if (thisNodeText != null) result[1] = thisNodeText.toString();

+ 4 - 2
app/src/main/java/me/yoqi/app/wxredpacket/utils/UpdateTask.java

@@ -28,7 +28,8 @@ public class UpdateTask extends AsyncTask<String, String, String> {
     public UpdateTask(Context context, boolean needUpdate) {
         this.context = context;
         this.isUpdateOnRelease = needUpdate;
-        if (this.isUpdateOnRelease) Toast.makeText(context, context.getString(R.string.checking_new_version), Toast.LENGTH_SHORT).show();
+        if (this.isUpdateOnRelease)
+            Toast.makeText(context, context.getString(R.string.checking_new_version), Toast.LENGTH_SHORT).show();
     }
 
     @Override
@@ -88,7 +89,8 @@ public class UpdateTask extends AsyncTask<String, String, String> {
             }
         } catch (Exception e) {
             e.printStackTrace();
-            if (this.isUpdateOnRelease) Toast.makeText(context, R.string.update_error, Toast.LENGTH_LONG).show();
+            if (this.isUpdateOnRelease)
+                Toast.makeText(context, R.string.update_error, Toast.LENGTH_LONG).show();
         }
     }