From 898ee1dae93af6ca4a0c2536bd4daccc7f686ac1 Mon Sep 17 00:00:00 2001 From: siguangli Date: Tue, 7 May 2024 17:33:09 +0800 Subject: [PATCH] fix(android): debugServerHost invalid setting --- .../java/com/openhippy/example/PageConfiguration.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/framework/examples/android-demo/src/main/java/com/openhippy/example/PageConfiguration.kt b/framework/examples/android-demo/src/main/java/com/openhippy/example/PageConfiguration.kt index 06a76cd7808..9d3cf3aaccb 100644 --- a/framework/examples/android-demo/src/main/java/com/openhippy/example/PageConfiguration.kt +++ b/framework/examples/android-demo/src/main/java/com/openhippy/example/PageConfiguration.kt @@ -32,6 +32,7 @@ import android.widget.ImageView import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.AppCompatEditText import androidx.core.view.WindowInsetsControllerCompat import com.tencent.mtt.hippy.HippyEngine import com.tencent.mtt.hippy.utils.LogUtils @@ -175,16 +176,16 @@ class PageConfiguration : AppCompatActivity(), View.OnClickListener { } val debugButton = pageConfigurationRoot.findViewById(R.id.page_configuration_debug_setting_image) - val debugServerHost = + val debugServerHostParent = pageConfigurationRoot.findViewById(R.id.page_configuration_debug_server_host) debugButton.setOnClickListener { if (debugMode) { (debugButton as ImageView).setImageResource(R.drawable.page_config_debug_off_2x) - debugServerHost.visibility = View.GONE + debugServerHostParent.visibility = View.GONE debugMode = false } else { (debugButton as ImageView).setImageResource(R.drawable.page_config_debug_on_2x) - debugServerHost.visibility = View.VISIBLE + debugServerHostParent.visibility = View.VISIBLE debugMode = true } } @@ -202,6 +203,11 @@ class PageConfiguration : AppCompatActivity(), View.OnClickListener { val createButton = pageConfigurationRoot.findViewById(R.id.page_configuration_create_image) createButton.setOnClickListener { v -> + val debugServerHostInput = + pageConfigurationRoot.findViewById(R.id.page_configuration_debug_server_host_input) + (debugServerHostInput as AppCompatEditText)?.let { + debugServerHost = it.text.toString() + } onCreateClick() } }