diff --git a/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt b/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt index e16968f9370b..1fecd374406e 100644 --- a/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/generalsettings/showonapplaunch/ShowOnAppLaunchActivity.kt @@ -18,8 +18,6 @@ package com.duckduckgo.app.generalsettings.showonapplaunch import android.os.Bundle import android.view.MenuItem -import androidx.core.view.isGone -import androidx.core.view.isVisible import androidx.lifecycle.Lifecycle import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope @@ -30,6 +28,7 @@ import com.duckduckgo.app.generalsettings.showonapplaunch.ShowOnAppLaunchViewMod import com.duckduckgo.app.generalsettings.showonapplaunch.ShowOnAppLaunchViewModel.ShowOnAppLaunchOption.NewTabPage import com.duckduckgo.app.generalsettings.showonapplaunch.ShowOnAppLaunchViewModel.ShowOnAppLaunchOption.SpecificPage import com.duckduckgo.common.ui.DuckDuckGoActivity +import com.duckduckgo.common.ui.view.showKeyboard import com.duckduckgo.common.ui.viewbinding.viewBinding import com.duckduckgo.di.scopes.ActivityScope import kotlinx.coroutines.flow.launchIn @@ -93,8 +92,10 @@ class ShowOnAppLaunchActivity : DuckDuckGoActivity() { is SpecificPage -> { binding.specificPageCheckListItem.setChecked(true) with(binding.specificPageUrlInput) { - isVisible = true text = viewState.selectedOption.url + isEditable = true + setSelectAllOnFocus(true) + showKeyboard() } } } @@ -106,6 +107,6 @@ class ShowOnAppLaunchActivity : DuckDuckGoActivity() { binding.lastOpenedTabCheckListItem.setChecked(false) binding.newTabCheckListItem.setChecked(false) binding.specificPageCheckListItem.setChecked(false) - binding.specificPageUrlInput.isGone = true + binding.specificPageUrlInput.isEditable = false } } diff --git a/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/text/DaxTextInput.kt b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/text/DaxTextInput.kt index 0c6b4b1d13c3..0d84b843644e 100644 --- a/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/text/DaxTextInput.kt +++ b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/text/DaxTextInput.kt @@ -71,6 +71,7 @@ interface TextInput { @DrawableRes endIconRes: Int, contentDescription: String? = null, ) + fun setSelectAllOnFocus(boolean: Boolean) fun removeEndIcon() @@ -257,6 +258,10 @@ class DaxTextInput @JvmOverloads constructor( } } + override fun setSelectAllOnFocus(boolean: Boolean) { + binding.internalEditText.setSelectAllOnFocus(boolean) + } + override fun removeEndIcon() { binding.internalInputLayout.apply { endIconMode = END_ICON_NONE