语言中英文完善
@@ -171,6 +171,7 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
|||||||
super.onScanResult(callbackType, result);
|
super.onScanResult(callbackType, result);
|
||||||
//Mac地址
|
//Mac地址
|
||||||
String deviceAddress = result.getDevice().getAddress();
|
String deviceAddress = result.getDevice().getAddress();
|
||||||
|
|
||||||
// 去重:已存在的设备不再添加
|
// 去重:已存在的设备不再添加
|
||||||
if (discoveredMacSet.contains(deviceAddress)) {
|
if (discoveredMacSet.contains(deviceAddress)) {
|
||||||
return;
|
return;
|
||||||
@@ -181,7 +182,6 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
|||||||
//设备名字
|
//设备名字
|
||||||
String deviceName = result.getScanRecord() != null ?
|
String deviceName = result.getScanRecord() != null ?
|
||||||
result.getScanRecord().getDeviceName() : "无名称";
|
result.getScanRecord().getDeviceName() : "无名称";
|
||||||
|
|
||||||
bean.setDeviceName(deviceName);
|
bean.setDeviceName(deviceName);
|
||||||
bean.setMacAddress(deviceAddress);
|
bean.setMacAddress(deviceAddress);
|
||||||
mDeviceList.add(bean);
|
mDeviceList.add(bean);
|
||||||
@@ -214,7 +214,7 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
|||||||
ToastUtil.showShort(mContext, "扫描失败,错误码: " + errorCode);
|
ToastUtil.showShort(mContext, "扫描失败,错误码: " + errorCode);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
scanner.startScan(filters, settings, mScanCallback);
|
scanner.startScan(null, settings, mScanCallback);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -244,6 +244,7 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// 检查蓝牙是否开启
|
// 检查蓝牙是否开启
|
||||||
if (!bluetoothAdapter.isEnabled()) {
|
if (!bluetoothAdapter.isEnabled()) {
|
||||||
Log.e("TEST", "initBluetooth: 蓝牙未开启,请求开启");
|
Log.e("TEST", "initBluetooth: 蓝牙未开启,请求开启");
|
||||||
@@ -252,6 +253,9 @@ public class AddDeviceActivity_copy extends BaseActivity<AddDeviceLayoutBinding,
|
|||||||
} else {
|
} else {
|
||||||
bluetoothReady = true;
|
bluetoothReady = true;
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class DeviceControlActivity extends BaseActivity<DeviceControlLayoutBindi
|
|||||||
.titleBar(viewBinding.rlTitle)
|
.titleBar(viewBinding.rlTitle)
|
||||||
.init();
|
.init();
|
||||||
viewBinding.includedTitle.imgSetting.setVisibility(View.VISIBLE);
|
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);
|
mAdapter = new DeviceTimeSelectAdapter(mContext,R.layout.device_work_time_item,mTimeList);
|
||||||
viewBinding.rvTimeList.setAdapter(mAdapter);
|
viewBinding.rvTimeList.setAdapter(mAdapter);
|
||||||
viewBinding.rvTimeList.addItemDecoration(new GridSpacingItemDecoration(4, 10, true));
|
viewBinding.rvTimeList.addItemDecoration(new GridSpacingItemDecoration(4, 10, true));
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class SelectWifiActivity extends BaseActivity<DeviceResetWifiBinding, Dev
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void initWifiList() {
|
private void initWifiList() {
|
||||||
wifiListAdapter = new WifiListAdapter();
|
wifiListAdapter = new WifiListAdapter(mContext);
|
||||||
viewBinding.rvWifiList.setAdapter(wifiListAdapter);
|
viewBinding.rvWifiList.setAdapter(wifiListAdapter);
|
||||||
wifiListAdapter.setOnWifiItemClickListener(wifiName -> {
|
wifiListAdapter.setOnWifiItemClickListener(wifiName -> {
|
||||||
mWifiName = wifiName;
|
mWifiName = wifiName;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class DeviceTimeSelectAdapter extends BaseQuickAdapter<String, BaseViewHo
|
|||||||
helper.setTextColor(R.id.tv_itme,mContext.getResources().getColor(R.color.white));
|
helper.setTextColor(R.id.tv_itme,mContext.getResources().getColor(R.color.white));
|
||||||
}else{
|
}else{
|
||||||
relTextBg.setBackground(mContext.getResources().getDrawable(R.drawable.shape_f7f7f7_line_button_bg));
|
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;
|
package com.ckkj.water.device.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -10,6 +11,8 @@ import androidx.annotation.NonNull;
|
|||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.ckkj.water.R;
|
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.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -18,6 +21,10 @@ public class WifiListAdapter extends RecyclerView.Adapter<WifiListAdapter.WifiVi
|
|||||||
|
|
||||||
private List<String> wifiList = new ArrayList<>();
|
private List<String> wifiList = new ArrayList<>();
|
||||||
private OnWifiItemClickListener listener;
|
private OnWifiItemClickListener listener;
|
||||||
|
private Context mContext;
|
||||||
|
public WifiListAdapter(BaseActivity mContext) {
|
||||||
|
this.mContext = mContext;
|
||||||
|
}
|
||||||
|
|
||||||
public interface OnWifiItemClickListener {
|
public interface OnWifiItemClickListener {
|
||||||
void onWifiItemClick(String wifiName);
|
void onWifiItemClick(String wifiName);
|
||||||
@@ -49,6 +56,9 @@ public class WifiListAdapter extends RecyclerView.Adapter<WifiListAdapter.WifiVi
|
|||||||
listener.onWifiItemClick(wifiName);
|
listener.onWifiItemClick(wifiName);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
holder.ivWifiIcon.setImageResource(ThemeManager.isAppThemeLight(mContext) ?
|
||||||
|
R.mipmap.icon_wifi :
|
||||||
|
R.mipmap.icon_white_wifi );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ public class GuideActivity extends BaseActivity<GuideActivityLayoutBinding, Logi
|
|||||||
private List<Drawable> mImgUrls = new ArrayList<>();
|
private List<Drawable> mImgUrls = new ArrayList<>();
|
||||||
private List<ImageView> mPointList = new ArrayList<>();
|
private List<ImageView> mPointList = new ArrayList<>();
|
||||||
private boolean mHasEnterAppFlag = false;
|
private boolean mHasEnterAppFlag = false;
|
||||||
private String desc[] = {"探索你的个性特征",
|
|
||||||
"一键生成,智能排盘工具",
|
|
||||||
"贴心提供每日生活指南"};
|
|
||||||
|
|
||||||
private int[] guideDrawableIds = {
|
private int[] guideDrawableIds = {
|
||||||
R.mipmap.img_guide_1,
|
R.mipmap.img_guide_1,
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ public class AppThemActivity extends BaseActivity<AppThemeChangeLayoutBinding, M
|
|||||||
|
|
||||||
public void onClick(View v){
|
public void onClick(View v){
|
||||||
switch (v.getId()){
|
switch (v.getId()){
|
||||||
|
|
||||||
|
case R.id.img_back:
|
||||||
|
finish();
|
||||||
|
break;
|
||||||
|
|
||||||
case R.id.linear_light:
|
case R.id.linear_light:
|
||||||
case R.id.img_light:
|
case R.id.img_light:
|
||||||
switchTheme(ThemeManager.MODE_LIGHT);
|
switchTheme(ThemeManager.MODE_LIGHT);
|
||||||
|
|||||||
BIN
app/src/main/res/drawable-night/icon_mine_settings.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
app/src/main/res/drawable-night/img_back_black.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/drawable/icon_mine_settings.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
app/src/main/res/drawable/img_back_black.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<corners android:radius="5dp"/>
|
<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"/>
|
<stroke android:color="@color/color_ebebeb" android:width="@dimen/dp_0_5"/>
|
||||||
</shape>
|
</shape>
|
||||||
@@ -183,10 +183,11 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_10"
|
||||||
android:paddingVertical="@dimen/dp_6"
|
android:paddingVertical="@dimen/dp_6"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:background="@drawable/shape_f9f9f9_corner_5"
|
android:background="@drawable/shape_f9f9f9_corner_5"
|
||||||
android:layout_marginHorizontal="@dimen/dp_20">
|
android:layout_marginHorizontal="@dimen/dp_10">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_work_duartion"
|
android:id="@+id/tv_work_duartion"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/color_838080"
|
android:textColor="@color/textPrimaryColor"
|
||||||
android:text="30min"/>
|
android:text="30min"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
android:layout_height="@dimen/dp_20"
|
android:layout_height="@dimen/dp_20"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:src="@mipmap/icon_mine_settings"
|
android:src="@drawable/icon_mine_settings"
|
||||||
android:layout_marginRight="@dimen/dp_20"
|
android:layout_marginRight="@dimen/dp_20"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
android:layout_width="22dp"
|
android:layout_width="22dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:src="@mipmap/img_back_black"
|
android:src="@drawable/img_back_black"
|
||||||
android:layout_marginLeft="@dimen/dp_10"/>
|
android:layout_marginLeft="@dimen/dp_10"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_title"
|
android:id="@+id/tv_title"
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
android:layout_height="@dimen/dp_20"
|
android:layout_height="@dimen/dp_20"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:src="@mipmap/icon_mine_settings"
|
android:src="@drawable/icon_mine_settings"
|
||||||
android:layout_marginRight="@dimen/dp_20"
|
android:layout_marginRight="@dimen/dp_20"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|||||||
BIN
app/src/main/res/mipmap-xhdpi/icon_white_wifi.png
Normal file
|
After Width: | Height: | Size: 601 B |
BIN
app/src/main/res/mipmap-xxhdpi/icon_white_wifi.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/icon_white_wifi.png
Normal file
|
After Width: | Height: | Size: 595 B |
@@ -8,4 +8,5 @@
|
|||||||
<color name="textPrimaryColor">#E0E0E0</color>
|
<color name="textPrimaryColor">#E0E0E0</color>
|
||||||
<color name="color_subtitle">#E0E0E0</color>
|
<color name="color_subtitle">#E0E0E0</color>
|
||||||
<color name="text_hint_theme_color">#303030</color>
|
<color name="text_hint_theme_color">#303030</color>
|
||||||
|
<color name="deviceControlItemColor">#878787</color>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
<color name="text_hint_theme_color">#838080</color>
|
<color name="text_hint_theme_color">#838080</color>
|
||||||
<color name="color_subtitle">#666666</color>
|
<color name="color_subtitle">#666666</color>
|
||||||
<color name="color_gray_theme">#F9F9F9</color>
|
<color name="color_gray_theme">#F9F9F9</color>
|
||||||
|
<color name="deviceControlItemColor">#FFFFFF</color>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||