Revert "精化方法,去耦合"

This reverts commit 3bd30f91bc.
zhenghaoyuan_branch
CYZ 2 years ago
parent 4e22c58661
commit 9b70e2df78

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="C:\Users\zqy04\.android\avd\Pixel_XL_API_31.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-06-19T07:23:56.534032200Z" />
</component>
</project>

@ -0,0 +1,84 @@
l java:S117Û"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÓÔÒÞùÿÿÿÿ
p
java:S1104D"[Make mLocationClient a static final constant or non-public and provide accessors if needed.(òó•L
q
java:S1104F"[Make mLocationOption a static final constant or non-public and provide accessors if needed.(ÈÀ‚§
d
java:S2259<18>"MA "NullPointerException" could be thrown; "mLocationClient" is nullable here.(Ô¹¤<C2B9>
c
java:S2095ó"LUse try-with-resources or close this "DatagramSocket" in a "finally" clause.(ù<>Èö
o java:S115d"ZRename this constant name to match the regular expression '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.(ë¿§Ï
s java:S116I"YRename this field "Current_latlng" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(æàÁÆÿÿÿÿÿ
o java:S116["ZRename this field "ClearMarker_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ëþ¥È
r java:S116]"XRename this field "ChangeAct_btn" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÂîœÃúÿÿÿÿ
d java:S116i"PRename this field "Angle" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÒáÒD
q java:S116j"WRename this field "MonitorAngle" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(þ‰Ô€ûÿÿÿÿ
o java:S116l"ZRename this field "MonitorDistance" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ƒæ¬Ê
˜
java:S1186ã"€Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.(±€¿ë
i
java:S1450i"TRemove the "Angle" field and declare it as a local variable in the relevant methods.(ÒáÒD
w
java:S1450]"\Remove the "ChangeAct_btn" field and declare it as a local variable in the relevant methods.(ÂîœÃúÿÿÿÿ
i
java:S1450H"SRemove the "city" field and declare it as a local variable in the relevant methods.(“øÌà
m
java:S1450W"WRemove the "cityCode" field and declare it as a local variable in the relevant methods.(êýð†
r
java:S1450k"WRemove the "distance" field and declare it as a local variable in the relevant methods.(×¾¶Ðøÿÿÿÿ
G
java:S1874S"1Remove this use of "PoiSearch"; it is deprecated.(–ƒëÖ
L
java:S1874U"1Remove this use of "PoiSearch"; it is deprecated.(²¹·‘ÿÿÿÿÿ
[
java:S1124d"EReorder the modifiers to comply with the Java Language Specification.(ë¿§Ï
`
java:S1124e"EReorder the modifiers to comply with the Java Language Specification.(<28>”µÆüÿÿÿÿ
Q java:S125h"<This block of commented-out lines of code should be removed.(‡µÍ”
V java:S125x"<This block of commented-out lines of code should be removed.(¤¯¿Îúÿÿÿÿ
f
java:S1874·"JDon't override a deprecated method or explicitly mark it as "@Deprecated".(Ó»×¶þÿÿÿÿ
R java:S125í"<This block of commented-out lines of code should be removed.(©áèè
Y
java:S1854 "=Remove this useless assignment to local variable "longitude".(ËàÅ€ûÿÿÿÿ
X
java:S1854ž"<Remove this useless assignment to local variable "latitude".(û‘áäùÿÿÿÿ
I
java:S1481ž"-Remove this unused "latitude" local variable.(û‘áäùÿÿÿÿ
J
java:S1481 ".Remove this unused "longitude" local variable.(ËàÅ€ûÿÿÿÿ
R java:S125ß"<This block of commented-out lines of code should be removed.(É–Ö­
G
java:S1172"+Remove this unused method parameter "view".(çÑ¢‰ýÿÿÿÿ
U
java:S1155">Use isEmpty() to check whether the collection is empty or not.(”ó±’
G
java:S1172<18>"+Remove this unused method parameter "view".(•É‘Îûÿÿÿÿ
Q java:S125 "<This block of commented-out lines of code should be removed.(Ÿ…¦Q
U
java:S1117Ï"9Rename "query" which hides the field declared at line 83.(˜Ž“áûÿÿÿÿ
\
java:S2147Š"ECombine this catch with the one at line 520, which has the same body.(<28>”ý¾
n
java:S3776š"RRefactor this method to reduce its Cognitive Complexity from 20 to the 15 allowed.(—´¸…øÿÿÿÿ
O java:S106·"9Replace this use of System.out or System.err by a logger.(éÃÇâ
W java:S125¹"<This block of commented-out lines of code should be removed.(×ûÂÚÿÿÿÿÿ
>
java:S1068H"(Remove this unused "city" private field.(“øÌà
?
java:S1068S")Remove this unused "query" private field.(–ƒëÖ
H
java:S1068U"-Remove this unused "poiSearch" private field.(²¹·‘ÿÿÿÿÿ
B
java:S1068W",Remove this unused "cityCode" private field.(êýð†
I
java:S1068c".Remove this unused "reveSocket" private field.(éÛþ§ýÿÿÿÿ
K
java:S1068e"0Remove this unused "RECEIVE_PORT" private field.(<28>”µÆüÿÿÿÿ
K
java:S1068f"0Remove this unused "listenStatus" private field.(ì㋸ûÿÿÿÿ
I
java:S1068g".Remove this unused "serverAddr" private field.(<28>§±ùÿÿÿÿ
E
java:S1068ë".Remove this unused "mReceiveIp" private field.(úúÛò

@ -19,5 +19,11 @@ k
;app/src/main/java/com/example/sixaunyi/ControlActivity.java,c\9\c99a584c2117ed2df42496451bb97ac1147f5ea0
j
:app/src/main/java/com/example/sixaunyi/SecondFragment.java,1\2\12963d86ac5c2888cc2a9ae459de5665bc06b01f
k
;app/src/main/java/com/example/sixaunyi/SettingActivity.java,2\a\2ab0711d9aa5839cecbb6cf0ed96f5a3f6470de5
i
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
9app/src/main/java/com/example/sixaunyi/VideoActivity.java,7\1\71fd1993763df2214bbdad8cfee650733993fe44
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
h
8app/src/main/java/com/example/sixaunyi/MainActivity.java,7\c\7c120b7216f76ce98d1573d90803ab36f481640c

@ -36,8 +36,8 @@ public class LoginActivity extends AppCompatActivity {
private void attemptLogin() {
String username = mUsername.getText().toString();
String password = mPassword.getText().toString();
boolean if_correct = verifyUser(username,password);
if (if_correct) {
if (mUsers.containsKey(username) && mUsers.get(username).equals(password)) {
Toast.makeText(this, "登录成功", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(LoginActivity.this, MainActivity.class);
startActivity(intent);
@ -46,12 +46,4 @@ public class LoginActivity extends AppCompatActivity {
Toast.makeText(this, "用户名或密码错误", Toast.LENGTH_SHORT).show();
}
}
private boolean verifyUser(String username, String password){
if (mUsers.containsKey(username) && mUsers.get(username).equals(password)) {
return true;
} else {
return false;
}
}
}

Loading…
Cancel
Save