Commit cee93dce by SC.Jang

#27524 Analyzeの結果一部反映

parent be853ac0
...@@ -7,3 +7,6 @@ ...@@ -7,3 +7,6 @@
/build /build
/captures /captures
.externalNativeBuild .externalNativeBuild
.idea/modules.xml
.idea/misc.xml
.idea/vcs.xml
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AndroidLintContentDescription" enabled="false" level="WARNING" enabled_by_default="false" />
<inspection_tool class="CanBeFinal" enabled="false" level="WARNING" enabled_by_default="false">
<option name="REPORT_CLASSES" value="false" />
<option name="REPORT_METHODS" value="false" />
<option name="REPORT_FIELDS" value="true" />
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/ToiletSignage.iml" filepath="$PROJECT_DIR$/ToiletSignage.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<application <application
android:name=".application.ToiletApplication" android:name=".application.ToiletApplication"
android:allowBackup="true" android:allowBackup="false"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:label="トイレ空室管理サイネージアプリ" android:label="トイレ空室管理サイネージアプリ"
......
...@@ -76,7 +76,7 @@ public class MainActivity extends ParentActivity { ...@@ -76,7 +76,7 @@ public class MainActivity extends ParentActivity {
} }
// permissionの確認 // permissionの確認
public boolean checkPermission() { private boolean checkPermission() {
// 既に許可している // 既に許可している
if (ActivityCompat.checkSelfPermission(this, if (ActivityCompat.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE) == Manifest.permission.WRITE_EXTERNAL_STORAGE) ==
...@@ -148,7 +148,7 @@ public class MainActivity extends ParentActivity { ...@@ -148,7 +148,7 @@ public class MainActivity extends ParentActivity {
} }
@Override @Override
public void reloadDisplayView() { protected void reloadDisplayView() {
Log.d(TAG, "reloadDisplayView"); Log.d(TAG, "reloadDisplayView");
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
@Override @Override
......
...@@ -20,12 +20,12 @@ import jp.odakyu.toiletsignage.info.ToiletInfo; ...@@ -20,12 +20,12 @@ import jp.odakyu.toiletsignage.info.ToiletInfo;
*/ */
public class ParentActivity extends AppCompatActivity { public class ParentActivity extends AppCompatActivity {
private final String TAG = "ParentActivity"; private static final String TAG = "ParentActivity";
Handler mHandler; Handler mHandler;
ToiletInfo toiletInfo; ToiletInfo toiletInfo;
BroadcastReceiver broadcastReceiver; private BroadcastReceiver broadcastReceiver;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
...@@ -96,5 +96,5 @@ public class ParentActivity extends AppCompatActivity { ...@@ -96,5 +96,5 @@ public class ParentActivity extends AppCompatActivity {
} }
//Child Classから実装 //Child Classから実装
public void reloadDisplayView() {} protected void reloadDisplayView() {}
} }
...@@ -22,7 +22,7 @@ import static java.lang.Boolean.TRUE; ...@@ -22,7 +22,7 @@ import static java.lang.Boolean.TRUE;
*/ */
public class SignageActivity extends ParentActivity { public class SignageActivity extends ParentActivity {
private final String TAG = "SignageActivity"; private static final String TAG = "SignageActivity";
private ImageView sexualityIconImageView; private ImageView sexualityIconImageView;
private ImageView statusIconImageView; private ImageView statusIconImageView;
private ImageView leftStatusIconImageView; private ImageView leftStatusIconImageView;
...@@ -162,7 +162,7 @@ public class SignageActivity extends ParentActivity { ...@@ -162,7 +162,7 @@ public class SignageActivity extends ParentActivity {
} }
@Override @Override
public void reloadDisplayView() { protected void reloadDisplayView() {
Log.i(TAG, "reloadDisplayView"); Log.i(TAG, "reloadDisplayView");
//バックグラウンドスレッドからメーイン //バックグラウンドスレッドからメーイン
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
...@@ -198,7 +198,7 @@ public class SignageActivity extends ParentActivity { ...@@ -198,7 +198,7 @@ public class SignageActivity extends ParentActivity {
ArrayList<ResultToiletJson> resultToiletJson = toiletInfo.getResultToiletJsonMap(toiletDefaultJson.getToiletId()); ArrayList<ResultToiletJson> resultToiletJson = toiletInfo.getResultToiletJsonMap(toiletDefaultJson.getToiletId());
int vacantCount = toiletInfo.getVacantCount(toiletDefaultJson.getToiletId()); int vacantCount = toiletInfo.getVacantCount(toiletDefaultJson.getToiletId());
int totalCount = toiletInfo.getTotalCount(toiletDefaultJson.getToiletId()); int totalCount = toiletInfo.getTotalCount(toiletDefaultJson.getToiletId());
if (toiletDefaultJson.getPriority() == toiletInfo.VALUE_PRIORITY_MAIN) { //開設トイレ if (toiletDefaultJson.getPriority() == ToiletInfo.VALUE_PRIORITY_MAIN) { //開設トイレ
if (vacantCount == -1) { if (vacantCount == -1) {
...@@ -221,13 +221,13 @@ public class SignageActivity extends ParentActivity { ...@@ -221,13 +221,13 @@ public class SignageActivity extends ParentActivity {
} }
} }
} else if (toiletDefaultJson.getPriority() == toiletInfo.VALUE_PRIORITY_SUB_LEFT) { //お近くトイレ(左側) } else if (toiletDefaultJson.getPriority() == ToiletInfo.VALUE_PRIORITY_SUB_LEFT) { //お近くトイレ(左側)
if (vacantCount == 0) { if (vacantCount == 0) {
leftStatusIconImageView.setImageResource(R.drawable.icon_full_sub); leftStatusIconImageView.setImageResource(R.drawable.icon_full_sub);
} else { } else {
leftStatusIconImageView.setImageResource(R.drawable.icon_empty_sub); leftStatusIconImageView.setImageResource(R.drawable.icon_empty_sub);
} }
} else if (toiletDefaultJson.getPriority() == toiletInfo.VALUE_PRIORITY_SUB_RIGHT) { //お近くトイレ(左側) } else if (toiletDefaultJson.getPriority() == ToiletInfo.VALUE_PRIORITY_SUB_RIGHT) { //お近くトイレ(左側)
if (vacantCount == 0) { if (vacantCount == 0) {
rightStatusIconImageView.setImageResource(R.drawable.icon_full_sub); rightStatusIconImageView.setImageResource(R.drawable.icon_full_sub);
} else { } else {
......
...@@ -13,11 +13,11 @@ import java.net.URL; ...@@ -13,11 +13,11 @@ import java.net.URL;
*/ */
public class ToiletServerConnection { public class ToiletServerConnection {
private final String TOILET_INFO_URL = "https://odakyu.api.toilet.mono-connect.jp/1/placements/%d/box_summaries_search "; private static final String TOILET_INFO_URL = "https://odakyu.api.toilet.mono-connect.jp/1/placements/%d/box_summaries_search";
private final String LOGIN_ID = "nh2h2KntNPpgXcqEAtcJxwJd49jNcJ4J"; private static final String LOGIN_ID = "nh2h2KntNPpgXcqEAtcJxwJd49jNcJ4J";
private final String PASSWORD = "jm2kCd6ZK2EZTzcMgxtge3AC4EeJ4ZqW"; private static final String PASSWORD = "jm2kCd6ZK2EZTzcMgxtge3AC4EeJ4ZqW";
private final int CONNECTION_TIMEOUT = 30 * 1000; private static final int CONNECTION_TIMEOUT = 30 * 1000;
private final int READ_TIMEOUT = 30 * 1000; private static final int READ_TIMEOUT = 30 * 1000;
public String connectionToiletServer(int toiletId) throws Exception { public String connectionToiletServer(int toiletId) throws Exception {
URL url = new URL(String.format(TOILET_INFO_URL, toiletId)); URL url = new URL(String.format(TOILET_INFO_URL, toiletId));
......
...@@ -14,7 +14,7 @@ import java.io.InputStreamReader; ...@@ -14,7 +14,7 @@ import java.io.InputStreamReader;
public class FileUtil { public class FileUtil {
public static String convertStreamToString(InputStream is) throws Exception { private static String convertStreamToString(InputStream is) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(is)); BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
String line = null; String line = null;
......
...@@ -12,7 +12,7 @@ import jp.odakyu.toiletsignage.json.ToiletDefaultJson; ...@@ -12,7 +12,7 @@ import jp.odakyu.toiletsignage.json.ToiletDefaultJson;
*/ */
public class ToiletInfo { public class ToiletInfo {
static ToiletInfo instance = null; private static ToiletInfo instance = null;
public static final String NAME_CONNTENT_FINISH = "jp.odakyu.toiletsignage.CONNECT_FINISH"; public static final String NAME_CONNTENT_FINISH = "jp.odakyu.toiletsignage.CONNECT_FINISH";
public static final int VALUE_SEX_MAN = 0; public static final int VALUE_SEX_MAN = 0;
...@@ -31,10 +31,10 @@ public class ToiletInfo { ...@@ -31,10 +31,10 @@ public class ToiletInfo {
private ArrayList<ToiletDefaultJson> mToiletDefaultJsonArray; private ArrayList<ToiletDefaultJson> mToiletDefaultJsonArray;
private Map<Integer, ArrayList<ResultToiletJson>> mResultToiletJsonMap = new HashMap<Integer, ArrayList<ResultToiletJson>>(); private Map<Integer, ArrayList<ResultToiletJson>> mResultToiletJsonMap = new HashMap<Integer, ArrayList<ResultToiletJson>>();
private boolean isValidation; private boolean isValidation = false;
private boolean isUsbFileCopyComplete; private boolean isUsbFileCopyComplete = false;
private int mConnectErrorCount; private int mConnectErrorCount = 0;
private boolean isNetworkConnect; private boolean isNetworkConnect = false;
public static synchronized ToiletInfo getInstance() { public static synchronized ToiletInfo getInstance() {
......
...@@ -15,11 +15,11 @@ public class ResultToiletJson { ...@@ -15,11 +15,11 @@ public class ResultToiletJson {
public static final String KEY_RESULT = "result"; public static final String KEY_RESULT = "result";
public static final String VALUE_STATUS_OPEN = "open"; public static final String VALUE_STATUS_OPEN = "open";
private final String KEY_ID = "id"; private static final String KEY_ID = "id";
private final String KEY_NAME = "name"; private static final String KEY_NAME = "name";
private final String KEY_STATUS = "status"; private static final String KEY_STATUS = "status";
private final String KEY_CHANGED_AT = "changed_at"; private static final String KEY_CHANGED_AT = "changed_at";
private final String KEY_ELAPSED_SECONDS = "elapsed_seconds"; private static final String KEY_ELAPSED_SECONDS = "elapsed_seconds";
private int id; private int id;
private String name; private String name;
......
...@@ -14,11 +14,11 @@ public class ToiletDefaultJson { ...@@ -14,11 +14,11 @@ public class ToiletDefaultJson {
/** /**
* JSON Param * JSON Param
*/ */
private final String KEY_PRIORITY = "priority"; private static final String KEY_PRIORITY = "priority";
private final String KEY_TOILET_ID = "toiletId"; private static final String KEY_TOILET_ID = "toiletId";
private final String KEY_TOILET_SEX = "toiletSex"; private static final String KEY_TOILET_SEX = "toiletSex";
private final String KEY_TOILET_NAME_EN = "toiletName_en"; private static final String KEY_TOILET_NAME_EN = "toiletName_en";
private final String KEY_TOILET_NAME_JP = "toiletName_jp"; private static final String KEY_TOILET_NAME_JP = "toiletName_jp";
private int priority; private int priority;
private int toiletId; private int toiletId;
......
...@@ -47,7 +47,7 @@ public class MainLogic { ...@@ -47,7 +47,7 @@ public class MainLogic {
} }
if (new File(copyFilePath).exists()) { if (new File(copyFilePath).exists()) {
JSONObject jsonObject = new JSONObject(FileUtil.getStringFromFile(copyFilePath));; JSONObject jsonObject = new JSONObject(FileUtil.getStringFromFile(copyFilePath));
JSONArray jsonArray = jsonObject.getJSONArray(KEY_TOILET_ARRAY); JSONArray jsonArray = jsonObject.getJSONArray(KEY_TOILET_ARRAY);
ArrayList<ToiletDefaultJson> toiletDefaultJsonArray = new ArrayList<ToiletDefaultJson>(); ArrayList<ToiletDefaultJson> toiletDefaultJsonArray = new ArrayList<ToiletDefaultJson>();
boolean isValidation = FALSE; boolean isValidation = FALSE;
...@@ -68,7 +68,7 @@ public class MainLogic { ...@@ -68,7 +68,7 @@ public class MainLogic {
} }
} }
public static String[] getExtSdCardPathsForActivity(Context context) { private static String[] getExtSdCardPathsForActivity(Context context) {
List<String> paths = new ArrayList<>(); List<String> paths = new ArrayList<>();
for (File file : context.getExternalFilesDirs("external")) { for (File file : context.getExternalFilesDirs("external")) {
if (file != null) { if (file != null) {
......
...@@ -26,8 +26,8 @@ import static java.lang.Boolean.TRUE; ...@@ -26,8 +26,8 @@ import static java.lang.Boolean.TRUE;
*/ */
public class UpdateToiletInfoTask extends TimerTask { public class UpdateToiletInfoTask extends TimerTask {
private static int mErrorCount = 0; private static final String TAG = "UpdateToiletInfoTask";
private final String TAG = "UpdateToiletInfoTask"; private int errorCount = 0;
private Context applicationContext; private Context applicationContext;
private ToiletInfo toiletInfo; private ToiletInfo toiletInfo;
...@@ -87,16 +87,16 @@ public class UpdateToiletInfoTask extends TimerTask { ...@@ -87,16 +87,16 @@ public class UpdateToiletInfoTask extends TimerTask {
} }
} }
if (isError) { if (isError) {
mErrorCount++; errorCount++;
} else { } else {
mErrorCount = 0; errorCount = 0;
} }
} else { } else {
mErrorCount++; errorCount++;
isNetworkConnect = FALSE; isNetworkConnect = FALSE;
} }
toiletInfo.setConnectErrorCount(mErrorCount); toiletInfo.setConnectErrorCount(errorCount);
toiletInfo.setNetworkConnect(isNetworkConnect); toiletInfo.setNetworkConnect(isNetworkConnect);
//Broadcast送信 //Broadcast送信
...@@ -106,12 +106,12 @@ public class UpdateToiletInfoTask extends TimerTask { ...@@ -106,12 +106,12 @@ public class UpdateToiletInfoTask extends TimerTask {
Log.d(TAG, "Thread End"); Log.d(TAG, "Thread End");
} }
public boolean isNetworkAvailable(Context context) { private boolean isNetworkAvailable(Context context) {
final ConnectivityManager connectivityManager = ((ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE)); final ConnectivityManager connectivityManager = ((ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE));
return connectivityManager.getActiveNetworkInfo() != null && connectivityManager.getActiveNetworkInfo().isConnected(); return connectivityManager.getActiveNetworkInfo() != null && connectivityManager.getActiveNetworkInfo().isConnected();
} }
public boolean isInternetAvailable() { private boolean isInternetAvailable() {
try { try {
final InetAddress address = InetAddress.getByName("google.com"); final InetAddress address = InetAddress.getByName("google.com");
return !address.equals(""); return !address.equals("");
......
...@@ -46,19 +46,12 @@ ...@@ -46,19 +46,12 @@
android:id="@+id/separator" android:id="@+id/separator"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="3dip" android:layout_height="3dip"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_marginEnd="50dp" android:layout_marginEnd="50dp"
android:layout_marginStart="50dp" android:layout_marginStart="50dp"
android:background="#746661" /> android:background="#746661" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
...@@ -202,6 +195,4 @@ ...@@ -202,6 +195,4 @@
</RelativeLayout> </RelativeLayout>
</LinearLayout>
</LinearLayout> </LinearLayout>
...@@ -48,8 +48,6 @@ ...@@ -48,8 +48,6 @@
android:id="@+id/separator" android:id="@+id/separator"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="3dip" android:layout_height="3dip"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_marginEnd="50dp" android:layout_marginEnd="50dp"
android:layout_marginStart="50dp" android:layout_marginStart="50dp"
...@@ -145,11 +143,7 @@ ...@@ -145,11 +143,7 @@
android:background="#746661" /> android:background="#746661" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -199,8 +193,6 @@ ...@@ -199,8 +193,6 @@
</LinearLayout> </LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -242,8 +234,6 @@ ...@@ -242,8 +234,6 @@
android:id="@+id/separator3" android:id="@+id/separator3"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="3dip" android:layout_height="3dip"
android:layout_alignParentTop="true"
android:layout_centerVertical="true"
android:layout_marginEnd="50dp" android:layout_marginEnd="50dp"
android:layout_marginStart="50dp" android:layout_marginStart="50dp"
android:background="#FFFFFF" /> android:background="#FFFFFF" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment