语言中英文完善
This commit is contained in:
@@ -171,6 +171,7 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
||||
super.onScanResult(callbackType, result);
|
||||
//Mac地址
|
||||
String deviceAddress = result.getDevice().getAddress();
|
||||
|
||||
// 去重:已存在的设备不再添加
|
||||
if (discoveredMacSet.contains(deviceAddress)) {
|
||||
return;
|
||||
@@ -181,7 +182,6 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
||||
//设备名字
|
||||
String deviceName = result.getScanRecord() != null ?
|
||||
result.getScanRecord().getDeviceName() : "无名称";
|
||||
|
||||
bean.setDeviceName(deviceName);
|
||||
bean.setMacAddress(deviceAddress);
|
||||
mDeviceList.add(bean);
|
||||
@@ -214,7 +214,7 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
||||
ToastUtil.showShort(mContext, "扫描失败,错误码: " + errorCode);
|
||||
}
|
||||
};
|
||||
scanner.startScan(filters, settings, mScanCallback);
|
||||
scanner.startScan(null, settings, mScanCallback);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,13 +244,17 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查蓝牙是否开启
|
||||
if (!bluetoothAdapter.isEnabled()) {
|
||||
Log.e("TEST", "initBluetooth: 蓝牙未开启,请求开启");
|
||||
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
||||
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
|
||||
} else {
|
||||
bluetoothReady = true;
|
||||
try {
|
||||
// 检查蓝牙是否开启
|
||||
if (!bluetoothAdapter.isEnabled()) {
|
||||
Log.e("TEST", "initBluetooth: 蓝牙未开启,请求开启");
|
||||
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
||||
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
|
||||
} else {
|
||||
bluetoothReady = true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class DeviceControlActivity extends BaseActivity<DeviceControlLayoutBindi
|
||||
.titleBar(viewBinding.rlTitle)
|
||||
.init();
|
||||
viewBinding.includedTitle.imgSetting.setVisibility(View.VISIBLE);
|
||||
viewBinding.includedTitle.imgSetting.setImageDrawable(getDrawable(R.mipmap.device_ctrl_setting));
|
||||
// viewBinding.includedTitle.imgSetting.setImageDrawable(getDrawable(R.mipmap.device_ctrl_setting));
|
||||
mAdapter = new DeviceTimeSelectAdapter(mContext,R.layout.device_work_time_item,mTimeList);
|
||||
viewBinding.rvTimeList.setAdapter(mAdapter);
|
||||
viewBinding.rvTimeList.addItemDecoration(new GridSpacingItemDecoration(4, 10, true));
|
||||
|
||||
@@ -120,7 +120,7 @@ public class SelectWifiActivity extends BaseActivity<DeviceResetWifiBinding, Dev
|
||||
}
|
||||
|
||||
private void initWifiList() {
|
||||
wifiListAdapter = new WifiListAdapter();
|
||||
wifiListAdapter = new WifiListAdapter(mContext);
|
||||
viewBinding.rvWifiList.setAdapter(wifiListAdapter);
|
||||
wifiListAdapter.setOnWifiItemClickListener(wifiName -> {
|
||||
mWifiName = wifiName;
|
||||
@@ -239,7 +239,7 @@ public class SelectWifiActivity extends BaseActivity<DeviceResetWifiBinding, Dev
|
||||
public void onFailed(int errorCode, String message) {
|
||||
isBleConnecting = false;
|
||||
if (errorCode != 0) {
|
||||
isBleConnected = espProvisionManager != null && espProvisionManager.isConnected();
|
||||
isBleConnected = espProvisionManager != null && espProvisionManager .isConnected();
|
||||
}
|
||||
Log.i("TEST","errorCode == " + errorCode + " message == " + message);
|
||||
ToastUtil.showShort(mContext, message);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class DeviceTimeSelectAdapter extends BaseQuickAdapter<String, BaseViewHo
|
||||
helper.setTextColor(R.id.tv_itme,mContext.getResources().getColor(R.color.white));
|
||||
}else{
|
||||
relTextBg.setBackground(mContext.getResources().getDrawable(R.drawable.shape_f7f7f7_line_button_bg));
|
||||
helper.setTextColor(R.id.tv_itme,mContext.getResources().getColor(R.color.color_838080));
|
||||
helper.setTextColor(R.id.tv_itme,mContext.getResources().getColor(R.color.textPrimaryColor));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ckkj.water.device.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -10,6 +11,8 @@ import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.ckkj.water.R;
|
||||
import com.ckkj.water.base.BaseActivity;
|
||||
import com.ckkj.water.utils.manager.ThemeManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -18,6 +21,10 @@ public class WifiListAdapter extends RecyclerView.Adapter<WifiListAdapter.WifiVi
|
||||
|
||||
private List<String> wifiList = new ArrayList<>();
|
||||
private OnWifiItemClickListener listener;
|
||||
private Context mContext;
|
||||
public WifiListAdapter(BaseActivity mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public interface OnWifiItemClickListener {
|
||||
void onWifiItemClick(String wifiName);
|
||||
@@ -49,6 +56,9 @@ public class WifiListAdapter extends RecyclerView.Adapter<WifiListAdapter.WifiVi
|
||||
listener.onWifiItemClick(wifiName);
|
||||
}
|
||||
});
|
||||
holder.ivWifiIcon.setImageResource(ThemeManager.isAppThemeLight(mContext) ?
|
||||
R.mipmap.icon_wifi :
|
||||
R.mipmap.icon_white_wifi );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -42,9 +42,6 @@ public class GuideActivity extends BaseActivity<GuideActivityLayoutBinding, Logi
|
||||
private List<Drawable> mImgUrls = new ArrayList<>();
|
||||
private List<ImageView> mPointList = new ArrayList<>();
|
||||
private boolean mHasEnterAppFlag = false;
|
||||
private String desc[] = {"探索你的个性特征",
|
||||
"一键生成,智能排盘工具",
|
||||
"贴心提供每日生活指南"};
|
||||
|
||||
private int[] guideDrawableIds = {
|
||||
R.mipmap.img_guide_1,
|
||||
|
||||
@@ -57,6 +57,11 @@ public class AppThemActivity extends BaseActivity<AppThemeChangeLayoutBinding, M
|
||||
|
||||
public void onClick(View v){
|
||||
switch (v.getId()){
|
||||
|
||||
case R.id.img_back:
|
||||
finish();
|
||||
break;
|
||||
|
||||
case R.id.linear_light:
|
||||
case R.id.img_light:
|
||||
switchTheme(ThemeManager.MODE_LIGHT);
|
||||
|
||||
Reference in New Issue
Block a user