Skip to content

Commit

Permalink
fix(android): debugServerHost invalid setting (#3841)
Browse files Browse the repository at this point in the history
Co-authored-by: siguangli <[email protected]>
  • Loading branch information
siguangli and siguangli2018 authored May 7, 2024
1 parent fd05c64 commit 5ef587e
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -175,16 +176,16 @@ class PageConfiguration : AppCompatActivity(), View.OnClickListener {
}
val debugButton =
pageConfigurationRoot.findViewById<View>(R.id.page_configuration_debug_setting_image)
val debugServerHost =
val debugServerHostParent =
pageConfigurationRoot.findViewById<View>(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
}
}
Expand All @@ -202,6 +203,11 @@ class PageConfiguration : AppCompatActivity(), View.OnClickListener {
val createButton =
pageConfigurationRoot.findViewById<View>(R.id.page_configuration_create_image)
createButton.setOnClickListener { v ->
val debugServerHostInput =
pageConfigurationRoot.findViewById<View>(R.id.page_configuration_debug_server_host_input)
(debugServerHostInput as AppCompatEditText)?.let {
debugServerHost = it.text.toString()
}
onCreateClick()
}
}
Expand Down

0 comments on commit 5ef587e

Please sign in to comment.