From af31aeb1f8fd4f1d91ae01bc0e45798da3090f4c Mon Sep 17 00:00:00 2001 From: Takashi Matsuoka Date: Mon, 22 Mar 2021 18:06:12 +0900 Subject: [PATCH] Remove unused resources and code --- .../add_step/Step03WifiWioListActivity.java | 111 --------- .../activity/user/LoginAndRegistActivity.java | 1 - .../seeed/iot/ui_main/MainScreenActivity.java | 5 - .../java/cc/seeed/iot/util/DialogUtils.java | 1 - app/src/main/res/layout/ap_connect.xml | 4 +- app/src/main/res/layout/dialog_name_input.xml | 38 ---- .../main/res/layout/smartconfig_connect.xml | 117 ---------- .../res/layout/smartconfig_connect_backup.xml | 130 ----------- .../main/res/layout/smartconfig_connected.xml | 96 -------- app/src/main/res/layout/smartconfig_ready.xml | 31 --- app/src/main/res/menu/drawer_view.xml | 51 ----- app/src/main/res/menu/menu_main.xml | 9 - app/src/main/res/menu/menu_main2.xml | 9 - app/src/main/res/values-ja/strings.xml | 7 +- app/src/main/res/values/strings.xml | 215 ++++++------------ 15 files changed, 81 insertions(+), 744 deletions(-) delete mode 100644 app/src/main/res/layout/dialog_name_input.xml delete mode 100644 app/src/main/res/layout/smartconfig_connect.xml delete mode 100644 app/src/main/res/layout/smartconfig_connect_backup.xml delete mode 100644 app/src/main/res/layout/smartconfig_connected.xml delete mode 100644 app/src/main/res/layout/smartconfig_ready.xml delete mode 100644 app/src/main/res/menu/drawer_view.xml delete mode 100644 app/src/main/res/menu/menu_main.xml delete mode 100644 app/src/main/res/menu/menu_main2.xml diff --git a/app/src/main/java/cc/seeed/iot/activity/add_step/Step03WifiWioListActivity.java b/app/src/main/java/cc/seeed/iot/activity/add_step/Step03WifiWioListActivity.java index 9569a4e..5133a21 100644 --- a/app/src/main/java/cc/seeed/iot/activity/add_step/Step03WifiWioListActivity.java +++ b/app/src/main/java/cc/seeed/iot/activity/add_step/Step03WifiWioListActivity.java @@ -264,117 +264,6 @@ public void wifiConnect(final String SSID) { mWaitDialog.setMessage("Connecting to " + SSID + "..."); mWaitDialog.setCanceledOnTouchOutside(false); mWaitDialog.show(); -// startTime = System.currentTimeMillis(); -// -// final Timer timer = new Timer(); -// timer.scheduleAtFixedRate(new TimerTask() { -// public void run() { -// flag++; -// if (flag >= TimeOutCount) { -// // TimeOutCount = App.getSp().getInt(Constant.SP_Connect_Wifi_TimeOut_Count, 30); -// if (TimeOutCount <= 60) { -// TimeOutCount += 15; -// } -// App.getSp().edit().putInt(Constant.SP_Connect_Wifi_TimeOut_Count, TimeOutCount).commit(); -// timer.cancel(); -// MLog.e(this, "超时"); -// runOnUiThread(new Runnable() { -// @Override -// public void run() { -// /* DialogUtils.showErrorDialog(Step03WifiWioListActivity.this, "Fail connect to Wio Wifi:1031", getString(R.string.dialog_btn_tryAgain), -// getString(R.string.dialog_btn_Cancel), getString(R.string.cont_connection_wio_wifi), new DialogUtils.OnErrorButtonClickListenter() { -// @Override -// public void okClick() { -// wifiConnect(SSID); -// timer.cancel(); -// } -// -// @Override -// public void cancelClick() { -// timer.cancel(); -// } -// });*/ -// AlertDialog dialog = new AlertDialog.Builder(Step03WifiWioListActivity.this) -// .setTitle("Fail connect to Wio Wi-Fi") -// .setMessage(getString(R.string.cont_connection_wio_wifi)) -// .setPositiveButton("Try again", new DialogInterface.OnClickListener() { -// @Override -// public void onClick(DialogInterface dialog, int which) { -// TimeOutCount = App.getSp().getInt(Constant.SP_Connect_Wifi_TimeOut_Count, 30); -// wifiConnect(SSID); -// timer.cancel(); -// ConnectCount++; -// } -// }) -// .setNeutralButton("Setting", new DialogInterface.OnClickListener() { -// @Override -// public void onClick(DialogInterface dialog, int which) { -// timer.cancel(); -// Intent intent = new Intent(Settings.ACTION_WIFI_SETTINGS); -// startActivityForResult(intent, SETTING_REQ_CODE); -// } -// }) -// .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { -// @Override -// -// public void onClick(DialogInterface dialog, int which) { -// timer.cancel(); -// } -// }).create(); -// // dialog.setCancelable(true); -// dialog.setCanceledOnTouchOutside(true); -// dialog.show(); -// -// dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setVisibility(View.VISIBLE); -// /* if (ConnectCount > 2) { -// dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setVisibility(View.VISIBLE); -// } else { -// dialog.getButton(AlertDialog.BUTTON_NEUTRAL).setVisibility(View.GONE); -// }*/ -// } -// }); -// -// if (mWaitDialog != null) { -// mWaitDialog.dismiss(); -// } -// } else { -// /* runOnUiThread(new Runnable() { -// @Override -// public void run() { -// if (!checkWifiIsExist(SSID)) { -// timer.cancel(); -// if (mWaitDialog != null) { -// mWaitDialog.dismiss(); -// } -// DialogUtils.showErrorDialog(Step03WifiWioListActivity.this, "WiFi not exist:1034", getString(R.string.dialog_btn_OK), -// null, "Equipment Wi-Fi hotspot does not exist", null); -// } -// } -// });*/ -// } -// if (WifiUtils.isWifiConnected(Step03WifiWioListActivity.thi s) && getCurrentSsid().equals("\"" + SSID + "\"")) { -// timer.cancel(); -// MLog.e(this, "连接成功"); -// if (mWaitDialog != null) { -// mWaitDialog.dismiss(); -// } -// Log.e(TAG, "###### connect success"); -// goStep04(); -// return; -// } else { -// // MLog.e(this, "连接失败"); -// } -// runOnUiThread(new Runnable() { -// @Override -// public void run() { -// mWaitDialog.setMessage("Connecting to " + SSID + " Wi-Fi (" + (TimeOutCount - flag) + ")"); -// } -// }); -// -// } -// } - -// , 1500, 1000); break; } } diff --git a/app/src/main/java/cc/seeed/iot/activity/user/LoginAndRegistActivity.java b/app/src/main/java/cc/seeed/iot/activity/user/LoginAndRegistActivity.java index 3579ce9..e4779f1 100644 --- a/app/src/main/java/cc/seeed/iot/activity/user/LoginAndRegistActivity.java +++ b/app/src/main/java/cc/seeed/iot/activity/user/LoginAndRegistActivity.java @@ -200,7 +200,6 @@ public void cancelClick() { return; } OtherPlatformUtils.getFacebookInfo(this, callbackManager, OtherPlatformUtils.LoginWithFacebook); - // dialog = DialogUtils.showProgressDialog(LoginAndRegistActivity.this, getString(R.string.loading_login)); break; case R.id.mRlSelectServer: startActivity(new Intent(LoginAndRegistActivity.this, SelectServerActivity.class)); diff --git a/app/src/main/java/cc/seeed/iot/ui_main/MainScreenActivity.java b/app/src/main/java/cc/seeed/iot/ui_main/MainScreenActivity.java index e011add..318c277 100644 --- a/app/src/main/java/cc/seeed/iot/ui_main/MainScreenActivity.java +++ b/app/src/main/java/cc/seeed/iot/ui_main/MainScreenActivity.java @@ -612,11 +612,6 @@ public void onClick(DialogInterface dialog, int which) { return true; } Intent intent = new Intent(this, SetupDeviceActivity.class); - /* if (node.board.equals(Constant.WIO_LINK_V1_0)) { - intent.setClass(this, SetupIotLinkActivity.class); - } else if (node.board.equals(Constant.WIO_NODE_V1_0)) { - intent.setClass(this, SetupIotNodeActivity.class); - }*/ intent.putExtra("node_sn", node.node_sn); startActivity(intent); return true; diff --git a/app/src/main/java/cc/seeed/iot/util/DialogUtils.java b/app/src/main/java/cc/seeed/iot/util/DialogUtils.java index 910c5a2..5d0db99 100644 --- a/app/src/main/java/cc/seeed/iot/util/DialogUtils.java +++ b/app/src/main/java/cc/seeed/iot/util/DialogUtils.java @@ -210,7 +210,6 @@ public void onClick(View v) { if (mRbCustomServer.isChecked()) { String url = mEtCustomServer.getText().toString().trim(); if (!RegularUtils.isWebsite(url)) { - // App.showToastShrot(context.getString(R.string.website_format_error)); mEtCustomServer.setError(context.getResources().getString(R.string.website_format_hint), context.getDrawable(R.mipmap.edit_help)); return; } diff --git a/app/src/main/res/layout/ap_connect.xml b/app/src/main/res/layout/ap_connect.xml index d2cdfba..8f62cc5 100644 --- a/app/src/main/res/layout/ap_connect.xml +++ b/app/src/main/res/layout/ap_connect.xml @@ -36,10 +36,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/mIvLoading" - android:layout_marginTop="50dp" android:layout_centerHorizontal="true" + android:layout_marginTop="50dp" android:gravity="center_horizontal" - android:text="We are almost there!\r\nThis process will take about a minute." + android:text="We are almost there!\nThis process will take about a minute." android:textColor="#A6000000" android:textSize="14sp" app:cusTextFont="@string/Proxima_Nova_Regular" /> diff --git a/app/src/main/res/layout/dialog_name_input.xml b/app/src/main/res/layout/dialog_name_input.xml deleted file mode 100644 index ef5e27e..0000000 --- a/app/src/main/res/layout/dialog_name_input.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/smartconfig_connect.xml b/app/src/main/res/layout/smartconfig_connect.xml deleted file mode 100644 index 3f01656..0000000 --- a/app/src/main/res/layout/smartconfig_connect.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -