Skip to content

Commit

Permalink
Merge pull request #12311 from woocommerce/issue/12294-fix-product-de…
Browse files Browse the repository at this point in the history
…scription-write-with-ai-button

Product Creation with AI: Fix the visibility of “Write with AI” button
  • Loading branch information
JorgeMucientes authored Aug 13, 2024
2 parents ddb0cd9 + bb9b04d commit d5e7a9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*** For entries which are touching the Android Wear app's, start entry with `[WEAR]` too.
20.0
-----

- [*] Fixed the hidden “Write with AI” issue that occurs when the keyboard is open. [https://github.com/woocommerce/woocommerce-android/pull/12311]

19.9
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.viewModels
import com.woocommerce.android.R
import com.woocommerce.android.extensions.copyToClipboard
Expand All @@ -26,6 +27,11 @@ class AIProductDescriptionBottomSheetFragment : WCBottomSheetDialogFragment() {

private val viewModel: AIProductDescriptionViewModel by viewModels()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setStyle(DialogFragment.STYLE_NORMAL, R.style.Woo_Theme_BottomSheetDialog_Resizeable)
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
return ComposeView(requireContext()).apply {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)
Expand Down
4 changes: 4 additions & 0 deletions WooCommerce/src/main/res/values/styles_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -811,4 +811,8 @@ theme across the entire app. Overridden versions should be added to the styles.x
<style name="Theme.Woo.BottomSheet" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@drawable/bottomsheet_rounded</item>
</style>

<style name="Woo.Theme.BottomSheetDialog.Resizeable" parent="Woo.Theme.BottomSheetDialog">
<item name="android:windowSoftInputMode">adjustResize</item>
</style>
</resources>

0 comments on commit d5e7a9d

Please sign in to comment.