Skip to content

Commit

Permalink
[#529] Review: Replace RelativeLayout with FrameLayout in XML
Browse files Browse the repository at this point in the history
  • Loading branch information
florentmaitre committed Jul 3, 2023
1 parent d8f5db3 commit 0e9059b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

package com.orange.ods.app.ui.components.buttons

import android.widget.RelativeLayout
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.appcompat.content.res.AppCompatResources
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -118,8 +119,9 @@ private fun TextButton(
this.enabled = enabled
this.style = style
this.displaySurface = displaySurface
val width = if (fullScreenWidth) RelativeLayout.LayoutParams.MATCH_PARENT else RelativeLayout.LayoutParams.WRAP_CONTENT
odsTextbutton.layoutParams = RelativeLayout.LayoutParams(width, RelativeLayout.LayoutParams.WRAP_CONTENT)
root.layoutParams = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
val width = if (fullScreenWidth) FrameLayout.LayoutParams.MATCH_PARENT else FrameLayout.LayoutParams.WRAP_CONTENT
odsTextbutton.layoutParams = FrameLayout.LayoutParams(width, FrameLayout.LayoutParams.WRAP_CONTENT)
}
)
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/ods_icon_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

</data>

<RelativeLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand All @@ -54,6 +54,6 @@
app:enabled="true"
app:displaySurface="standard" />

</RelativeLayout>
</FrameLayout>

</layout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/ods_icon_toggle_buttons_group.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

</data>

<RelativeLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand All @@ -42,6 +42,6 @@
app:selectedIndex="0"
app:displaySurface="standard" />

</RelativeLayout>
</FrameLayout>

</layout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/ods_icon_toogle_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

</data>

<RelativeLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand Down Expand Up @@ -66,6 +66,6 @@
app:iconContentDescription="Button"
app:displaySurface="standard" />

</RelativeLayout>
</FrameLayout>

</layout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/ods_text_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

</data>

<RelativeLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

Expand All @@ -60,6 +60,6 @@
app:textButtonStyle="primary"
app:displaySurface="standard" />

</RelativeLayout>
</FrameLayout>

</layout>

0 comments on commit 0e9059b

Please sign in to comment.