From 0e2325fbddacb5e776a1f1392623e3175f9d03ff Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 05 十二月 2024 17:13:53 +0800 Subject: [PATCH] 2024年12月05日17:13:52 --- app/src/main/res/layout/fragment_me.xml | 87 +++++++++++++-------- app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java | 10 - app/src/main/res/values-zh/strings.xml | 2 app/src/main/res/values/strings.xml | 2 app/src/main/java/com/hdl/photovoltaic/config/AppConfigManage.java | 2 app/src/main/res/values-en/strings.xml | 2 app/src/main/res/layout/item_plant_details.xml | 53 +++++++----- app/src/main/res/layout/item_device_details.xml | 52 +++++++----- app/src/main/java/com/hdl/photovoltaic/ui/me/WebActivity.java | 15 ++- 9 files changed, 131 insertions(+), 94 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/config/AppConfigManage.java b/app/src/main/java/com/hdl/photovoltaic/config/AppConfigManage.java index 42a1fac..84c22ac 100644 --- a/app/src/main/java/com/hdl/photovoltaic/config/AppConfigManage.java +++ b/app/src/main/java/com/hdl/photovoltaic/config/AppConfigManage.java @@ -8,7 +8,7 @@ public class AppConfigManage { /*********鏄惁姝e紡鏈嶅姟鍣�*********/ - private static final boolean isOnlineServer = true; + private static final boolean isOnlineServer = false; /*********姝e紡鐜*********/ private static final String APP_KEY_ONLINE = "CSZEMDJL"; private static final String APP_SECRET_ONLINE = "CSZEMDKBCSZEMDKR"; diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java index 8a2b6c9..3bbe470 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/me/MeFragment.java @@ -295,11 +295,9 @@ */ private void setMemberName(String userName) { if (TextUtils.isEmpty(userName)) { - viewBinding.fragmentMeUserNameTv.setVisibility(View.GONE); - viewBinding.fragmentMeUserNameNextIv.setVisibility(View.GONE); + viewBinding.userNameLl.setVisibility(View.GONE); } else { - viewBinding.fragmentMeUserNameTv.setVisibility(View.VISIBLE); - viewBinding.fragmentMeUserNameNextIv.setVisibility(View.VISIBLE); + viewBinding.userNameLl.setVisibility(View.VISIBLE); viewBinding.fragmentMeUserNameTv.setText(userName); } @@ -310,17 +308,15 @@ * 鏄剧ず璐﹀彿 */ private void setMemberAccount(String userAccount) { - if (viewBinding.fragmentMeUserNameTv.getVisibility() == View.VISIBLE) { + if (viewBinding.userNameLl.getVisibility() == View.VISIBLE) { viewBinding.fragmentMeUserRoleNextIv.setVisibility(View.GONE); } else { viewBinding.fragmentMeUserRoleNextIv.setVisibility(View.VISIBLE); } - if (TextUtils.isEmpty(userAccount)) { userAccount = "--"; } viewBinding.fragmentMeUserRoleTv.setText(userAccount); - } diff --git a/app/src/main/java/com/hdl/photovoltaic/ui/me/WebActivity.java b/app/src/main/java/com/hdl/photovoltaic/ui/me/WebActivity.java index edcd8e8..6188e99 100644 --- a/app/src/main/java/com/hdl/photovoltaic/ui/me/WebActivity.java +++ b/app/src/main/java/com/hdl/photovoltaic/ui/me/WebActivity.java @@ -1,6 +1,7 @@ package com.hdl.photovoltaic.ui.me; +import android.annotation.SuppressLint; import android.os.Bundle; import android.view.View; @@ -35,7 +36,7 @@ @Override public void onBindView(Bundle savedInstanceState) { - setStatusBarTranslucent(); + setStatusBarTranslucent(); this.typeIntValue = getIntent().getIntExtra("type", 0); //鍒濆鍖� initView(); @@ -52,7 +53,11 @@ }); } + @SuppressLint("SetJavaScriptEnabled") private void initView() { + viewBinding.contentView.getSettings().setJavaScriptEnabled(true); + //xml閲岄潰璁剧疆鑳屾櫙鏃犳晥 + viewBinding.contentView.setBackgroundColor(getColor(R.color.text_FF161616)); if (this.typeIntValue == 0) { viewBinding.toolbarTopRl.topTitleTv.setText(R.string.app_service_agreement); } else { @@ -64,19 +69,19 @@ //涓枃 if (this.typeIntValue == 0) { //鐢ㄦ埛鍗忚 - viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__UserAgreement.html"); + viewBinding.contentView.loadUrl("https://nearest.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/userAgreement"); } else { //闅愮鍗忚 - viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__PrivacyPolicy.html"); + viewBinding.contentView.loadUrl("https://nearest.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/privacyAgreement"); } } else { //鑻辨枃 if (this.typeIntValue == 0) { //鐢ㄦ埛鍗忚 - viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy__UserAgreement-En.html"); + viewBinding.contentView.loadUrl("https://nearest.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/userAgreementEn"); } else { //闅愮鍗忚 - viewBinding.contentView.loadUrl("https://developer.hdlcontrol.com/GreenSmartEnergy_PrivacyPolicy-En.html"); + viewBinding.contentView.loadUrl("https://nearest.hdlcontrol.com/common-h5/#/pages/greenEnergyAgreement/privacyAgreementEn"); } } diff --git a/app/src/main/res/layout/fragment_me.xml b/app/src/main/res/layout/fragment_me.xml index 83a2a84..a507662 100644 --- a/app/src/main/res/layout/fragment_me.xml +++ b/app/src/main/res/layout/fragment_me.xml @@ -57,47 +57,68 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - <TextView - android:id="@+id/fragment_me_user_name_tv" - android:layout_width="wrap_content" - android:layout_height="22dp" + <!--鏄剧ず鐢ㄦ埛鍚嶇О--> + <LinearLayout + android:id="@+id/user_name_ll" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/dp_16" android:layout_marginTop="@dimen/dp_16" - android:textColor="@color/text_E6FFFFFF" - android:textSize="@dimen/text_18" + android:layout_marginEnd="@dimen/dp_16" + android:gravity="center" + android:orientation="horizontal" app:layout_constraintEnd_toEndOf="@+id/fragment_me_icon_iv" app:layout_constraintStart_toStartOf="@+id/fragment_me_icon_iv" - app:layout_constraintTop_toBottomOf="@+id/fragment_me_icon_iv" /> + app:layout_constraintTop_toBottomOf="@+id/fragment_me_icon_iv"> - <ImageView - android:id="@+id/fragment_me_user_name_next_iv" - android:layout_width="16dp" - android:layout_height="@dimen/dp_16" - android:layout_marginStart="3dp" - android:src="@drawable/next" - app:layout_constraintBottom_toBottomOf="@+id/fragment_me_user_name_tv" - app:layout_constraintStart_toEndOf="@+id/fragment_me_user_name_tv" - app:layout_constraintTop_toTopOf="@+id/fragment_me_user_name_tv" /> + <TextView + android:id="@+id/fragment_me_user_name_tv" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="end|center_vertical" + android:paddingStart="@dimen/dp_0" + android:paddingEnd="@dimen/dp_3" + android:textColor="@color/text_E6FFFFFF" + android:textSize="@dimen/text_18" /> - <TextView - android:id="@+id/fragment_me_user_role_tv" - android:layout_width="wrap_content" - android:layout_height="17dp" - android:layout_marginTop="@dimen/dp_11" - android:textColor="@color/text_66FFFFFF" - android:textSize="@dimen/text_14" + <ImageView + android:id="@+id/fragment_me_user_name_next_iv" + android:layout_width="16dp" + android:layout_height="@dimen/dp_16" + android:src="@drawable/next" /> + </LinearLayout> + <!--鏄剧ず鐢ㄦ埛璐﹀彿--> + <LinearLayout + android:id="@+id/account_ll" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="@dimen/dp_16" + android:layout_marginTop="4.5dp" + android:layout_marginEnd="@dimen/dp_16" + android:gravity="center" + android:orientation="horizontal" app:layout_constraintEnd_toEndOf="@+id/fragment_me_icon_iv" app:layout_constraintStart_toStartOf="@+id/fragment_me_icon_iv" - app:layout_constraintTop_toBottomOf="@+id/fragment_me_user_name_tv" /> + app:layout_constraintTop_toBottomOf="@+id/user_name_ll"> - <ImageView - android:id="@+id/fragment_me_user_role_next_iv" - android:layout_width="@dimen/dp_16" - android:layout_height="@dimen/dp_16" - android:layout_marginStart="3dp" - android:src="@drawable/next" - app:layout_constraintBottom_toBottomOf="@+id/fragment_me_user_role_tv" - app:layout_constraintStart_toEndOf="@+id/fragment_me_user_role_tv" - app:layout_constraintTop_toTopOf="@+id/fragment_me_user_role_tv" /> + <TextView + android:id="@+id/fragment_me_user_role_tv" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="end|center_vertical" + android:paddingStart="@dimen/dp_0" + android:paddingEnd="@dimen/dp_3" + android:textColor="@color/text_66FFFFFF" + android:textSize="@dimen/text_14" /> + + <ImageView + android:id="@+id/fragment_me_user_role_next_iv" + android:layout_width="@dimen/dp_16" + android:layout_height="@dimen/dp_16" + android:src="@drawable/next" /> + </LinearLayout> + + </androidx.constraintlayout.widget.ConstraintLayout> <LinearLayout diff --git a/app/src/main/res/layout/item_device_details.xml b/app/src/main/res/layout/item_device_details.xml index 2913a84..e6b701e 100644 --- a/app/src/main/res/layout/item_device_details.xml +++ b/app/src/main/res/layout/item_device_details.xml @@ -36,36 +36,44 @@ android:background="@drawable/device_image" android:scaleType="centerCrop" /> - <TextView - android:id="@+id/device_state_tv" - android:layout_width="7dp" - android:layout_height="7dp" - android:layout_marginStart="@dimen/dp_11" - android:layout_marginTop="@dimen/dp_21" - android:layout_toEndOf="@+id/device_details_image_iv" - android:background="@drawable/device_state_ff38c494" /> - <TextView - android:id="@+id/device_details_name_tv" + <LinearLayout + android:id="@+id/home_name_ll" android:layout_width="match_parent" - android:layout_height="@dimen/dp_19" - android:layout_marginStart="@dimen/dp_6" + android:layout_height="@dimen/dp_20" + android:layout_marginStart="@dimen/dp_11" android:layout_marginTop="@dimen/dp_15" - android:layout_marginEnd="@dimen/dp_6" - android:layout_toEndOf="@+id/device_state_tv" - android:ellipsize="end" - android:gravity="center_vertical|start" - android:singleLine="true" - android:textColor="@color/text_E6FFFFFF" - android:textSize="@dimen/text_14" /> + android:layout_toEndOf="@+id/device_details_image_iv" + android:gravity="center_vertical" + android:orientation="horizontal"> + + <TextView + android:id="@+id/device_state_tv" + android:layout_width="7dp" + android:layout_height="7dp" + android:background="@drawable/device_state_ff38c494" /> + + <TextView + android:id="@+id/device_details_name_tv" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:ellipsize="end" + android:gravity="center_vertical|start" + android:paddingStart="@dimen/dp_6" + android:paddingEnd="@dimen/dp_20" + android:singleLine="true" + android:text="@string/power_station" + android:textColor="@color/text_E6FFFFFF" + android:textSize="@dimen/text_14" /> + </LinearLayout> <TextView android:id="@+id/device_details_sn_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@+id/device_details_name_tv" - android:layout_alignStart="@+id/device_state_tv" + android:layout_below="@+id/home_name_ll" + android:layout_alignStart="@+id/home_name_ll" android:layout_marginTop="@dimen/dp_3" android:gravity="center_vertical" android:text="SN:" @@ -76,7 +84,7 @@ android:id="@+id/device_details_value_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@+id/device_details_name_tv" + android:layout_below="@+id/home_name_ll" android:layout_marginStart="3dp" android:layout_marginTop="1.5dp" android:layout_toEndOf="@+id/device_details_sn_tv" diff --git a/app/src/main/res/layout/item_plant_details.xml b/app/src/main/res/layout/item_plant_details.xml index 07a5ac1..4700d04 100644 --- a/app/src/main/res/layout/item_plant_details.xml +++ b/app/src/main/res/layout/item_plant_details.xml @@ -31,36 +31,43 @@ android:background="@drawable/default_user" android:scaleType="centerCrop" /> - <TextView - android:id="@+id/device_state_tv" - android:layout_width="7dp" - android:layout_height="7dp" - android:layout_marginStart="@dimen/dp_11" - android:layout_marginTop="@dimen/dp_21" - android:layout_toEndOf="@+id/device_details_image_iv" - android:background="@drawable/device_state_ff38c494" /> - <TextView - android:id="@+id/device_details_name_tv" + <LinearLayout + android:id="@+id/home_name_ll" android:layout_width="match_parent" android:layout_height="@dimen/dp_20" - android:layout_marginStart="@dimen/dp_6" + android:layout_marginStart="@dimen/dp_11" android:layout_marginTop="@dimen/dp_15" - android:layout_marginEnd="10dp" - android:layout_toEndOf="@+id/device_state_tv" - android:ellipsize="end" - android:gravity="center_vertical|start" - android:singleLine="true" - android:text="@string/power_station" - android:textColor="@color/text_E6FFFFFF" - android:textSize="@dimen/text_14" /> + android:layout_toEndOf="@+id/device_details_image_iv" + android:gravity="center_vertical" + android:orientation="horizontal"> + + <TextView + android:id="@+id/device_state_tv" + android:layout_width="7dp" + android:layout_height="7dp" + android:background="@drawable/device_state_ff38c494" /> + + <TextView + android:id="@+id/device_details_name_tv" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:ellipsize="end" + android:gravity="center_vertical|start" + android:paddingStart="@dimen/dp_6" + android:paddingEnd="@dimen/dp_20" + android:singleLine="true" + android:text="@string/power_station" + android:textColor="@color/text_E6FFFFFF" + android:textSize="@dimen/text_14" /> + </LinearLayout> <TextView android:id="@+id/device_details_sn_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@+id/device_details_name_tv" - android:layout_alignStart="@+id/device_state_tv" + android:layout_below="@+id/home_name_ll" + android:layout_alignStart="@+id/home_name_ll" android:layout_marginTop="@dimen/dp_3" android:gravity="center_vertical" android:text="@string/string_capacity" @@ -71,7 +78,7 @@ android:id="@+id/device_details_value_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_below="@+id/device_details_name_tv" + android:layout_below="@+id/home_name_ll" android:layout_marginStart="3dp" android:layout_marginTop="1.5dp" android:layout_toEndOf="@+id/device_details_sn_tv" @@ -111,7 +118,7 @@ <LinearLayout android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="@dimen/dp_18"> <TextView android:id="@+id/power_value_tv" diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 273e3b2..301247f 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -283,7 +283,7 @@ <string name="no_equipment">No equipment!</string> <string name="filtering">Select</string> <string name="reset">Reset</string> - <string name="string_capacity">String capacity:</string> + <string name="string_capacity">String capacity</string> <string name="grid_connected_state">Grid-connected state</string> <string name="grid_connected">Grid-tied</string> <string name="off_network">Off-grid</string> diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 7b36d32..5d73cee 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -281,7 +281,7 @@ <string name="no_equipment">鏆傛棤璁惧!</string> <string name="filtering">绛涢��</string> <string name="reset">閲嶇疆</string> - <string name="string_capacity">缁勪覆瀹归噺:</string> + <string name="string_capacity">缁勪覆瀹归噺</string> <string name="grid_connected_state">骞剁綉鐘舵��</string> <string name="grid_connected">骞剁綉</string> <string name="off_network">绂荤綉</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0352fe3..0b9d4e6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -281,7 +281,7 @@ <string name="no_equipment">鏆傛棤璁惧!</string> <string name="filtering">绛涢��</string> <string name="reset">閲嶇疆</string> - <string name="string_capacity">缁勪覆瀹归噺:</string> + <string name="string_capacity">缁勪覆瀹归噺</string> <string name="grid_connected_state">骞剁綉鐘舵��</string> <string name="grid_connected">骞剁綉</string> <string name="off_network">绂荤綉</string> -- Gitblit v1.8.0