Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #40 from SeeedJP/dev-matsujirushi
Browse files Browse the repository at this point in the history
Add Japanese string
  • Loading branch information
KillingJacky authored Mar 27, 2021
2 parents 360638b + 726e09e commit 132d347
Show file tree
Hide file tree
Showing 44 changed files with 347 additions and 893 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ protected void onCreate(Bundle savedInstanceState) {
private void initView() {
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.groves);
getSupportActionBar().setTitle(R.string.menu_grove_list);
init();
if (mLvGroves != null) {
mAdapter = new GrovesAdapter(this, mGroveDrivers);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/cc/seeed/iot/activity/HelpActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void initDate() {
private void initView() {
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.help_toolbar);
getSupportActionBar().setTitle(R.string.menu_support);
}

/* @Override
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/cc/seeed/iot/activity/NodeSettingActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void onCreate(Bundle savedInstanceState) {
private void initView() {
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(getString(R.string.toolBar_title));
getSupportActionBar().setTitle(getString(R.string.node_setting_activity_title));
}

private void initData() {
Expand All @@ -93,7 +93,7 @@ private void initData() {

mTvName.setText(node.name);
if (TextUtils.isEmpty(node.dataxserver)) {
mTvConnectServer.setText(R.string.not_set);
mTvConnectServer.setText(R.string.node_setting_activity_data_exchange_server_empty);
} else {
mTvConnectServer.setText(node.dataxserver);
}
Expand All @@ -119,23 +119,23 @@ public void onClick(View view) {
}

private void reName() {
DialogUtils.showEditOneRowDialog(NodeSettingActivity.this, "Edit Device Name", "", new DialogUtils.ButtonEditClickListenter() {
DialogUtils.showEditOneRowDialog(NodeSettingActivity.this, getString(R.string.node_setting_activity_edit_device_name), "", new DialogUtils.ButtonEditClickListenter() {
@Override
public void okClick(Dialog dialog, String content) {
if (TextUtils.isEmpty(content)) {
App.showToastShrot("The device name can not be empty");
return;
} else {
dialog.dismiss();
progressDialog = DialogUtils.showProgressDialog(NodeSettingActivity.this, getString(R.string.loading));
progressDialog = DialogUtils.showProgressDialog(NodeSettingActivity.this, getString(R.string.msg_loading));
ConfigDeviceLogic.getInstance().nodeReName(node.node_sn, content);
}
}
});
}

private void saveUrl() {
DialogUtils.showEditOneRowDialog(NodeSettingActivity.this, "Customized Server","", new DialogUtils.ButtonEditClickListenter() {
DialogUtils.showEditOneRowDialog(NodeSettingActivity.this, getString(R.string.data_exchange_server),"", new DialogUtils.ButtonEditClickListenter() {
@Override
public void okClick(Dialog dialog, String content) {
if (TextUtils.isEmpty(content)) {
Expand All @@ -152,7 +152,7 @@ public void okClick(Dialog dialog, String content) {
}

public void getIpAddress(final Activity context, final Dialog dialog, final String url) {
progressDialog = DialogUtils.showProgressDialog(context, getString(R.string.loading));
progressDialog = DialogUtils.showProgressDialog(context, getString(R.string.msg_loading));
NetworkUtils.getIpAddress(context, NetworkUtils.getDomainName(url), new NetworkUtils.OnIpCallback() {
@Override
public void okCallback(String ip) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void initView() {
mEtCustomServer.addTextChangedListener(this);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.choose_server_toolbar);
getSupportActionBar().setTitle(R.string.select_server_activity_title);
}

private void initData() {
Expand Down
17 changes: 8 additions & 9 deletions app/src/main/java/cc/seeed/iot/activity/SetupDeviceActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ public boolean onOptionsItemSelected(MenuItem item) {
return true;
} else if (id == R.id.update) {
List<String> menu = new ArrayList<>();
menu.add("View API");
menu.add("Device Setting");
menu.add("Change Wi-Fi Network");
menu.add("Help");
menu.add(getResources().getString(R.string.menu_view_api));
menu.add(getResources().getString(R.string.menu_device_setting));
menu.add(getResources().getString(R.string.menu_change_wifi));
menu.add(getResources().getString(R.string.menu_help));
DialogUtils.showMenuPopWindow(this, mToolbar, menu, new DialogUtils.OnMenuItemChickListener() {
@Override
public void chickItem(View v, int position) {
Expand Down Expand Up @@ -448,7 +448,7 @@ public void cancelClick() {
mBtnUpdate.setEnabled(false);
mBtnUpdate.setSelected(false);
progressDialog = new CustomProgressDialog(this, R.style.AlertDialogBg);
setProgressMsg("Preparing Server (10%)");
setProgressMsg(getString(R.string.msg_update_firmware_in_progress) + " (10%)");
mRlRemove.setVisibility(View.GONE);
isUpdateIng = true;
ConfigDeviceLogic.getInstance().updateFirware(node.node_key, node_josn);
Expand Down Expand Up @@ -929,13 +929,12 @@ public void onEvent(String event, int ret, String errInfo, Object[] data) {
if (ret == ConfigDeviceLogic.UPDATE_DONE) {
stopUpdate();
old_node_josn = new NodeConfigHelper().getConfigJson(pinConfigs, node);
// DialogUtils.showErrorDialog(SetupIotLinkActivity.this, "", "OK", "", "Firware Updated!", null);
App.showToastShrot("Firmware Updated!");
App.showToastShrot(getString(R.string.msg_updated_firmware));
setUpdateButton();
} else if (ret == ConfigDeviceLogic.UPDATEING) {
if (progress <= 80) {
progress += 12;
setProgressMsg("Preparing Server (" + progress + "%)");
setProgressMsg(getString(R.string.msg_update_firmware_in_progress) + " (" + progress + "%)");
}
} else if (ret == ConfigDeviceLogic.FAIL) {
if (data != null && data.length > 0) {
Expand All @@ -950,7 +949,7 @@ public void onEvent(String event, int ret, String errInfo, Object[] data) {
showErrDialog(bean);
}
} else if (ret == ConfigDeviceLogic.SUCCESS) {
setProgressMsg("Preparing Server (40%)");
setProgressMsg(getString(R.string.msg_update_firmware_in_progress) + " (40%)");
progress = 40;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private void initToolBar() {
setSupportActionBar(mToolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.add_device_step01_link_title);
getSupportActionBar().setTitle(R.string.step01_go_ready_activity_title_wio_link);
}
}

Expand All @@ -83,17 +83,17 @@ private void initData() {
case Constant.WIO_LINK_V1_0:
mIvCourse.setImageResource(R.mipmap.link_config);
if (node != null) {
getSupportActionBar().setTitle(R.string.add_device_step01_change_wifi);
getSupportActionBar().setTitle(R.string.step01_go_ready_activity_title_change_wifi);
} else {
getSupportActionBar().setTitle(R.string.add_device_step01_link_title);
getSupportActionBar().setTitle(R.string.step01_go_ready_activity_title_wio_link);
}
break;
case Constant.WIO_NODE_V1_0:
mIvCourse.setImageResource(R.mipmap.node_config);
if (node != null) {
getSupportActionBar().setTitle(R.string.add_device_step01_change_wifi);
getSupportActionBar().setTitle(R.string.step01_go_ready_activity_title_change_wifi);
} else {
getSupportActionBar().setTitle(R.string.add_device_step01_node_title);
getSupportActionBar().setTitle(R.string.step01_go_ready_activity_title_wio_node);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected void onCreate(Bundle savedInstanceState) {
private void initToolBar() {
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.title_wifi_list_activity);
getSupportActionBar().setTitle(R.string.step02_wifi_list_activity_title);
}

private void initData() {
Expand Down Expand Up @@ -219,7 +219,7 @@ public void onItem(View caller) {
int position = mWifiListView.getChildLayoutPosition(caller);
scanResult = mWifiListAdapter.getItem(position);
final String oldPwd = App.getSp().getString(scanResult.SSID, "");
DialogUtils.showEditOneRowDialog(Step02WifiListActivity.this, "Enter Wifi Password", oldPwd, new DialogUtils.ButtonEditClickListenter() {
DialogUtils.showEditOneRowDialog(Step02WifiListActivity.this, getString(R.string.msg_enter_wifi_password), oldPwd, new DialogUtils.ButtonEditClickListenter() {
@Override
public void okClick(Dialog dialog, String pwd) {
MobclickAgent.onEvent(Step02WifiListActivity.this, "17003");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ protected void onCreate(Bundle savedInstanceState) {
private void initToolBar() {
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle(R.string.title_wio_activity);
getSupportActionBar().setTitle(R.string.step03_wifi_wio_list_activity_title);
}

private void initData() {
mTvTip.setText(R.string.is_config_mode);
mTvTip.setText(R.string.msg_check_wio_is_in_config_mode);
mStepView.setDoingStep(2);
if (mWifiListView != null) {
mWifiListView.setHasFixedSize(true);
Expand Down Expand Up @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ private void login() {
String email = mEtEmail.getText().toString().trim();
String pwd = mEtPwd.getText().toString().trim();
if (!RegularUtils.isEmail(email)) {
mEtEmail.setError(getString(R.string.email_format_error));
mEtEmail.setError(getString(R.string.msg_email_format_error));
mEtEmail.requestFocus();
return;
} else if (TextUtils.isEmpty(pwd) || pwd.length() < 6) {
mEtPwd.setError(getString(R.string.pwd_format_error));
mEtPwd.setError(getString(R.string.msg_password_too_short_error));
mEtPwd.requestFocus();
return;
} else {
Expand Down
Loading

0 comments on commit 132d347

Please sign in to comment.