app/src/main/java/com/hdl/photovoltaic/other/HdlCommonLogic.java
@@ -1,10 +1,12 @@ package com.hdl.photovoltaic.other; import android.app.Activity; import android.content.Context; import android.graphics.Bitmap; import android.os.SystemClock; import android.text.TextUtils; import android.view.View; import android.view.inputmethod.InputMethodManager; import android.widget.ImageView; import android.widget.TextView; @@ -215,6 +217,8 @@ } } /** * 没有数据界面的样式 * app/src/main/java/com/hdl/photovoltaic/other/HdlUniLogic.java
@@ -1493,7 +1493,7 @@ // com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(data); try { String devices = getKeyValue("devices", getKeyValue("data", data)); String homeId = UserConfigManage.getInstance().getHomeId(); //绑定成功之后通知 String homeId = UserConfigManage.getInstance().getHomeId(); //uni创建电站成功之后通知给Android的 Gson gson = new Gson(); Type typeOfT = new TypeToken<List<GatewayBean>>() { }.getType(); app/src/main/java/com/hdl/photovoltaic/ui/home/HomePageFragment.java
@@ -469,7 +469,6 @@ // 取消粘性事件 EventBus.getDefault().removeStickyEvent(eventBus); HdlLogLogic.print("正在点击【首页】"); } } } @@ -514,7 +513,7 @@ return; } viewBinding.infoRl1Text1Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getInstalledCapacity())); viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getPower(),UnitType.kW,false)); viewBinding.infoRl1Text3Tv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getPower(), UnitType.kW, false)); viewBinding.infoRl1FText1Tv.setText(dataOverBean.getPowerRatio()); viewBinding.homePageStationInfoRl2DayIc.dataTv.setText(HdlCommonLogic.getConvertDoubleUnit(dataOverBean.getTodayElectricity())); app/src/main/java/com/hdl/photovoltaic/ui/message/SearchMessageActivity.java
@@ -1,12 +1,14 @@ package com.hdl.photovoltaic.ui.message; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.view.View; import android.view.inputmethod.InputMethodManager; import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; @@ -157,6 +159,8 @@ viewBinding.listParent.setVisibility(View.GONE); searchHistoryAdapter.setList(searchHistoryTitleList); clearCacheData(); viewBinding.messageSearchEt.requestFocus(); showSoftInput(); } }); //删除 @@ -199,6 +203,23 @@ } /** * 显示软键盘 */ public void showSoftInput() { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.showSoftInput(viewBinding.messageSearchEt, 0); } /** * 隐藏软键盘 */ public void hideSoftInputFromWindow() { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(viewBinding.getRoot().getWindowToken(), 0); } private void initView() { viewBinding.historyListParent.setVisibility(View.VISIBLE); viewBinding.listParent.setVisibility(View.GONE); app/src/main/java/com/hdl/photovoltaic/ui/powerstation/DeviceSearchActivity.java
@@ -5,11 +5,13 @@ import androidx.recyclerview.widget.RecyclerView; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import android.content.Context; import android.os.Bundle; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.view.View; import android.view.inputmethod.InputMethodManager; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -166,6 +168,8 @@ viewBinding.deviceNullDataIc.getRoot().setVisibility(View.GONE); searchHistoryAdapter.setList(searchHistoryTitleList); clearData(); viewBinding.powerStationSearchEt.requestFocus(); showSoftInput(); } }); //删除 @@ -176,6 +180,7 @@ searchHistoryAdapter.setList(searchHistoryTitleList); viewBinding.deviceNullDataIc.getRoot().setVisibility(View.GONE); HdlFileLogic.getInstance().deleteFile(getHistoryFileNamePath()); } }); //历史记录点击事件 @@ -228,6 +233,7 @@ } private void initView() { viewBinding.historyListParent.setVisibility(View.VISIBLE); viewBinding.listParent.setVisibility(View.GONE); @@ -266,6 +272,22 @@ }); } /** * 显示软键盘 */ public void showSoftInput() { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.showSoftInput(viewBinding.powerStationSearchEt, 0); } /** * 隐藏软键盘 */ public void hideSoftInputFromWindow() { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(viewBinding.getRoot().getWindowToken(), 0); } /** * 输入电站名称进行过滤 app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseAndDeviceFragment.java
@@ -955,6 +955,7 @@ HdlResidenceLogic.getInstance().delHouseId(homeId);//删除电站缓存 initData();//初始化缓存数据 houseInfoAdapter.setList(houseListBeanIDList, powerStationStatusValue);//重新刷新列表 getStatusOverview();//删除成功后刷新电站状态概览 nullDataUpdateUi();//检测数据是否为空 } app/src/main/java/com/hdl/photovoltaic/ui/powerstation/HouseSearchActivity.java
@@ -1,11 +1,13 @@ package com.hdl.photovoltaic.ui.powerstation; import android.content.Context; import android.os.Bundle; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; import android.view.View; import android.view.inputmethod.InputMethodManager; import androidx.annotation.NonNull; import androidx.recyclerview.widget.LinearLayoutManager; @@ -147,6 +149,7 @@ loadNextPageHouseList(false, ++currentHouseListPage, false); } } } }); //清除 @@ -159,6 +162,8 @@ viewBinding.listParent.setVisibility(View.GONE); viewBinding.deviceNullDataIc.getRoot().setVisibility(View.GONE); searchHistoryAdapter.setList(searchHistoryTitleList); viewBinding.powerStationSearchEt.requestFocus(); showSoftInput(); clearData(); } }); @@ -201,6 +206,23 @@ } }); } /** * 显示软键盘 */ public void showSoftInput() { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.showSoftInput(viewBinding.powerStationSearchEt, 0); } /** * 隐藏软键盘 */ public void hideSoftInputFromWindow() { InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputMethodManager.hideSoftInputFromWindow(viewBinding.getRoot().getWindowToken(), 0); } private void initView() { @@ -442,4 +464,6 @@ public String getHistoryFileNamePath() { return HdlFileLogic.getInstance().getCurrentUserRootPath() + "/house_history.txt"; } }