This commit is contained in:
fengjignqi
2026-08-19 16:07:09 +08:00
parent 22f197a929
commit 0c692c77bd
18 changed files with 66 additions and 27 deletions

Binary file not shown.

View File

@@ -21,8 +21,8 @@ public class AppConfig {
// public static boolean IS_TEST_REQUEST = true;
/**************************本地*******************************/
// public static String BASE_URL = "http://192.168.1.217:8081/";//后端本地测试
public static String BASE_URL = "http://47.97.217.123:8081/";//服务器测试
public static String BASE_URL = "http://192.168.1.217:8082/";//后端本地测试
// public static String BASE_URL = "http://47.97.217.123:8081/";//服务器测试
public static String BASE_URL_TWO = BASE_URL;//测试
public static String BASE_URL_THREE = BASE_URL;//测试
public static boolean IS_TEST_REQUEST = true;

View File

@@ -547,10 +547,9 @@ public abstract class BaseActivity<T extends ViewBinding, P extends IPresenter>
editText.requestFocus();
//设置输入类型
setEditInputType(editText,inputType);
if(TextUtils.isEmpty(content)){
editText.setHint(hint);
}else{
if(!TextUtils.isEmpty(content)){
editText.setText(content);
}
if (!TextUtils.isEmpty(content)) {

View File

@@ -950,10 +950,9 @@ public abstract class BaseFragment<T extends ViewBinding,P extends IPresenter> e
//设置输入类型
setEditInputType(editText,inputType);
if(TextUtils.isEmpty(content)){
editText.setHint(hint);
}else{
if(!TextUtils.isEmpty(content)){
editText.setText(content);
editText.setSelection(content.length());
}

View File

@@ -64,7 +64,7 @@ public class MinePresenter extends BasePresenter<MineContract.MineView> {
public void updateUserInfo(String nickName,String avatar) {
try {
JSONObject json = new JSONObject();
if(!TextUtils.isEmpty(avatar)){
if(!TextUtils.isEmpty(nickName)){
json.put("nickName", nickName);
}
if(!TextUtils.isEmpty(avatar)){

View File

@@ -156,6 +156,7 @@ public class PlanDetailActivity extends BaseActivity<WaterPlanDetailLayoutBindin
// 开启任务,调用接口后再更新 Switch
mPresenter.updatePlanStatus(mDetailEntity, "1");
}
break;
}
}
@@ -173,8 +174,10 @@ public class PlanDetailActivity extends BaseActivity<WaterPlanDetailLayoutBindin
viewBinding.tvPlanName.setText(entity.getName());
if(entity.getStatus().equals("1")){
viewBinding.switchButton.setChecked(true);
viewBinding.tvPlanStatus.setText(getString(R.string.plan_on));
}else{
viewBinding.switchButton.setChecked(false);
viewBinding.tvPlanStatus.setText(getString(R.string.plan_off));
}
//针对周一 --- 周日的日期,只显示勾选的日期
List<WaterPlanWeekEntity.DetailsBean> list = new ArrayList<>();
@@ -248,8 +251,10 @@ public class PlanDetailActivity extends BaseActivity<WaterPlanDetailLayoutBindin
if(status.equals("1")){
showCenterTipDialog(R.mipmap.icon_dialog_success,getString(R.string.task_started));
viewBinding.switchButton.setChecked(true);
viewBinding.tvPlanStatus.setText(getString(R.string.plan_on));
}else{
viewBinding.switchButton.setChecked(false);
viewBinding.tvPlanStatus.setText(getString(R.string.plan_off));
}
}

View File

@@ -1,6 +1,7 @@
package com.ckkj.water.plan;
import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import android.content.Context;
import android.os.Bundle;
@@ -51,6 +52,7 @@ public class WaterPlanFragment extends BaseFragment<WaterPlanFragmentBinding, Wa
.init();
viewBinding.includedTitle.imgBack.setVisibility(INVISIBLE);
viewBinding.includedTitle.tvTitle.setText(getString(R.string.plan_title));
viewBinding.includedNoresult.tvAddPlan.setVisibility(VISIBLE);
initListener();
mAdapter = new WaterPlanListAdapter(mContext,R.layout.water_plan_list_item,mPlanList);
viewBinding.rvPlans.setAdapter(mAdapter);
@@ -110,6 +112,7 @@ public class WaterPlanFragment extends BaseFragment<WaterPlanFragmentBinding, Wa
private void initListener() {
setClick(viewBinding.tvAdd);
setClick(viewBinding.includedNoresult.btnRefresh);
setClick(viewBinding.includedNoresult.tvAddPlan);
}
private void setClick(View view) {
@@ -119,6 +122,7 @@ public class WaterPlanFragment extends BaseFragment<WaterPlanFragmentBinding, Wa
public void onClick(View v){
switch (v.getId()){
case R.id.tv_add:
case R.id.tv_add_plan:
goTo(mContext, AddWaterPlanActivity.class,null);
break;
@@ -148,7 +152,7 @@ public class WaterPlanFragment extends BaseFragment<WaterPlanFragmentBinding, Wa
if (mAdapter.getItemCount() >= total || pageList.size() == 0) {
// 使用 post 延迟调用,避免内部状态冲突导致的循环调用
viewBinding.refresh.postDelayed(() -> viewBinding.refresh.setNoMoreData(true), 300);
viewBinding.relNoMore.setVisibility(View.VISIBLE); // 自定义底部提示"暂无更多数据"
viewBinding.relNoMore.setVisibility(VISIBLE); // 自定义底部提示"暂无更多数据"
} else {
viewBinding.refresh.setNoMoreData(false);
viewBinding.relNoMore.setVisibility(View.GONE);
@@ -156,11 +160,11 @@ public class WaterPlanFragment extends BaseFragment<WaterPlanFragmentBinding, Wa
// 5. 控制空布局和内容显示
if (mAdapter.getItemCount() != 0) {
viewBinding.refresh.setVisibility(View.VISIBLE);
viewBinding.refresh.setVisibility(VISIBLE);
viewBinding.relNoresult.setVisibility(View.GONE);
} else {
viewBinding.refresh.setVisibility(View.GONE);
viewBinding.relNoresult.setVisibility(View.VISIBLE);
viewBinding.relNoresult.setVisibility(VISIBLE);
}
}

View File

@@ -16,10 +16,9 @@
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="@dimen/dp_270"
android:layout_height="@dimen/dp_83"
android:src="@mipmap/icon_launch_icon"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_120"/>
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"/>
</RelativeLayout>

View File

@@ -35,6 +35,22 @@
android:gravity="center"
android:text="@string/btn_manual_refresh"
android:textColor="@color/color_white"
android:textSize="16sp" />
android:textSize="16sp"
android:visibility="gone"/>
<TextView
android:id="@+id/tv_add_plan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_noresult"
android:layout_centerHorizontal="true"
android:paddingHorizontal="@dimen/dp_20"
android:paddingVertical="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:textSize="14sp"
android:textColor="@color/white"
android:text="@string/add_water_plan"
android:background="@drawable/shape_green_50"
android:gravity="center"
android:visibility="gone"/>
</RelativeLayout>
</RelativeLayout>

View File

@@ -101,7 +101,7 @@
android:layout_width="@dimen/dp_135"
android:layout_height="@dimen/dp_35"
android:layout_alignParentRight="true"
android:background="@drawable/shape_dialog_confirm_jb_bg"
android:background="@drawable/shape_green_button_bg"
android:gravity="center"
android:textColor="@color/color_white" />
</RelativeLayout>

View File

@@ -50,9 +50,9 @@
android:background="@drawable/shape_line_gray_bg"
android:layout_marginTop="@dimen/dp_10"
android:textSize="16sp"
android:textColor="@color/textPrimaryColor"
android:textColorHint="@color/color_subtitle"
android:hint="请输入激活码"/>
android:textColor="@color/dialog_input_hint_color"
android:textColorHint="@color/dialog_input_hint_color"
android:hint=""/>
<TextView
android:id="@+id/tv_click"

View File

@@ -137,6 +137,7 @@
android:paddingVertical="@dimen/dp_15">
<TextView
android:id="@+id/tv_sta"
android:layout_width="82dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
@@ -144,6 +145,15 @@
android:textColor="@color/textPrimaryColor"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_plan_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/tv_sta"
android:textColor="@color/textPrimaryColor"
android:textSize="16sp" />
<com.kyleduo.switchbutton.SwitchButton
android:id="@+id/switch_button"
android:layout_width="wrap_content"

View File

@@ -16,7 +16,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingVertical="@dimen/dp_12">
android:paddingVertical="@dimen/dp_22">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -40,7 +40,8 @@
android:layout_marginTop="@dimen/dp_5"
android:text="YA226641000107"
android:textColor="@color/color_666666"
android:textSize="12sp" />
android:textSize="12sp"
android:visibility="gone"/>
</LinearLayout>

View File

@@ -110,7 +110,7 @@
<!-- Schedule -->
<string name="input_plan_name">Enter schedule name</string>
<string name="add_water_plan">+ New Schedule</string>
<string name="add_water_plan">+ Add</string>
<string name="plan_title">Schedules</string>
<string name="water_device_config">Watering Settings</string>
<string name="water_bound_device">Linked Devices</string>
@@ -138,6 +138,8 @@
<string name="btn_manual_refresh">Refresh</string>
<string name="task_started">Task Started</string>
<string name="associated">Associated</string>
<string name="plan_on">ON</string>
<string name="plan_off">OFF</string>
<!-- History -->
<string name="history_title">History</string>

View File

@@ -6,6 +6,7 @@
<color name="mainBackgroundColor">#303030</color>
<color name="color_gray_theme">#303030</color>
<color name="textPrimaryColor">#E0E0E0</color>
<color name="dialog_input_hint_color">#666666</color>
<color name="color_subtitle">#E0E0E0</color>
<color name="text_hint_theme_color">#303030</color>
<color name="deviceControlItemColor">#878787</color>

View File

@@ -5,6 +5,7 @@
<color name="colorAccent">#FF4081</color>
<color name="mainBackgroundColor">#FFFFFF</color>
<color name="textPrimaryColor">#222222</color>
<color name="dialog_input_hint_color">#222222</color>
<color name="text_hint_theme_color">#838080</color>
<color name="color_subtitle">#666666</color>
<color name="color_gray_theme">#F9F9F9</color>

View File

@@ -129,6 +129,8 @@
<string name="btn_manual_refresh">手动刷新</string>
<string name="task_started">任务已开启</string>
<string name="associated">已关联</string>
<string name="plan_on">开启</string>
<string name="plan_off">关闭</string>
<!--历史-->
@@ -370,7 +372,7 @@
<string name="tips_network_not_connected">网络未连接</string>
<string name="tips_yinsizhengce_click">星语明灯平台隐私政策》</string>
<string name="tips_yinsizhengce_click">《隐私政策》</string>
<string name="common_permission_description">权限说明</string>
<string name="common_permission_message">使用此功能需要先授予%s</string>

View File

@@ -1,4 +1,4 @@
#Fri Jul 10 09:12:26 CST 2026
#Tue Aug 18 10:51:55 CST 2026
D\:\\AndroidWorkSpace\\WaterProject\\WaterProject\\imagepickerl\\src\\main\\res\\drawable-hdpi\\ef_ic_arrow_back.png=D\:\\AndroidWorkSpace\\WaterProject\\WaterProject\\imagepickerl\\build\\intermediates\\packaged_res\\debug\\drawable-hdpi-v4\\ef_ic_arrow_back.png
D\:\\AndroidWorkSpace\\WaterProject\\WaterProject\\imagepickerl\\src\\main\\res\\drawable-hdpi\\ef_ic_arrow_forward.png=D\:\\AndroidWorkSpace\\WaterProject\\WaterProject\\imagepickerl\\build\\intermediates\\packaged_res\\debug\\drawable-hdpi-v4\\ef_ic_arrow_forward.png
D\:\\AndroidWorkSpace\\WaterProject\\WaterProject\\imagepickerl\\src\\main\\res\\drawable-hdpi\\ef_ic_camera_white.png=D\:\\AndroidWorkSpace\\WaterProject\\WaterProject\\imagepickerl\\build\\intermediates\\packaged_res\\debug\\drawable-hdpi-v4\\ef_ic_camera_white.png