语言中英文完善

This commit is contained in:
fengjignqi
2026-06-09 10:50:23 +08:00
parent e040be11c3
commit 77f6001a31
21 changed files with 41 additions and 22 deletions

View File

@@ -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);
}
}

View File

@@ -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));

View File

@@ -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);

View File

@@ -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));
}
}

View File

@@ -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

View File

@@ -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,

View File

@@ -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);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"/>
<solid android:color="@color/white"/>
<solid android:color="@color/deviceControlItemColor"/>
<stroke android:color="@color/color_ebebeb" android:width="@dimen/dp_0_5"/>
</shape>

View File

@@ -183,10 +183,11 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:paddingVertical="@dimen/dp_6"
android:orientation="horizontal"
android:background="@drawable/shape_f9f9f9_corner_5"
android:layout_marginHorizontal="@dimen/dp_20">
android:layout_marginHorizontal="@dimen/dp_10">
<TextView
android:id="@+id/tv_work_duartion"
android:layout_width="match_parent"

View File

@@ -17,7 +17,7 @@
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textSize="14sp"
android:textColor="@color/color_838080"
android:textColor="@color/textPrimaryColor"
android:text="30min"/>
</RelativeLayout>
</LinearLayout>

View File

@@ -55,7 +55,7 @@
android:layout_height="@dimen/dp_20"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@mipmap/icon_mine_settings"
android:src="@drawable/icon_mine_settings"
android:layout_marginRight="@dimen/dp_20"
android:visibility="gone"/>
</RelativeLayout>

View File

@@ -12,7 +12,7 @@
android:layout_width="22dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:src="@mipmap/img_back_black"
android:src="@drawable/img_back_black"
android:layout_marginLeft="@dimen/dp_10"/>
<TextView
android:id="@+id/tv_title"
@@ -55,7 +55,7 @@
android:layout_height="@dimen/dp_20"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:src="@mipmap/icon_mine_settings"
android:src="@drawable/icon_mine_settings"
android:layout_marginRight="@dimen/dp_20"
android:visibility="gone"/>
</RelativeLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

View File

@@ -8,4 +8,5 @@
<color name="textPrimaryColor">#E0E0E0</color>
<color name="color_subtitle">#E0E0E0</color>
<color name="text_hint_theme_color">#303030</color>
<color name="deviceControlItemColor">#878787</color>
</resources>

View File

@@ -8,6 +8,7 @@
<color name="text_hint_theme_color">#838080</color>
<color name="color_subtitle">#666666</color>
<color name="color_gray_theme">#F9F9F9</color>
<color name="deviceControlItemColor">#FFFFFF</color>