Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c343f1f authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

Merge branch '766-set_max_btn_width' into 'main'

Issue 766: Set max width to half of screen width for install button.

See merge request !254
parents 0d1a1ff7 ef1431ca
Loading
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -133,6 +133,8 @@ class ApplicationListRVAdapter(
            setAppIcon(searchApp, shimmerDrawable)
            removeIsPurchasedObserver(holder)

            setInstallButtonDimensions(view)

            if (appInfoFetchViewModel.isAppInBlockedList(searchApp)) {
                setupShowMoreButton()
            } else {
@@ -145,6 +147,16 @@ class ApplicationListRVAdapter(
        }
    }

    private fun ApplicationListItemBinding.setInstallButtonDimensions(item: View) {
        item.post {
            val maxAllowedWidth = item.measuredWidth / 2
            installButton.apply {
                if (width > maxAllowedWidth)
                    width = maxAllowedWidth
            }
        }
    }

    private fun ApplicationListItemBinding.setAppIcon(
        searchApp: FusedApp,
        shimmerDrawable: ShimmerDrawable
+0 −1
Original line number Diff line number Diff line
@@ -60,7 +60,6 @@ import foundation.e.apps.utils.exceptions.GPlayLoginException
import foundation.e.apps.utils.modules.PWAManagerModule
import foundation.e.apps.utils.parentFragment.TimeoutFragment
import kotlinx.coroutines.launch
import timber.log.Timber
import javax.inject.Inject

@AndroidEntryPoint
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@
    <com.google.android.material.button.MaterialButton
        android:id="@+id/installButton"
        style="@style/InstallButtonStyle"
        android:layout_width="80dp"
        android:layout_width="wrap_content"
        android:layout_height="40dp"
        android:text="@string/install"
        android:textAllCaps="true"