Commit fef13c09 authored by Amit Kumar's avatar Amit Kumar 💻
Browse files

Center the hotseat icons

parent 7f118f16
Pipeline #144679 passed with stage
in 7 minutes and 45 seconds
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Pixel_3a_XL_API_29.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2021-09-30T08:57:06.401616Z" />
</component>
</project>
\ No newline at end of file
...@@ -26,7 +26,6 @@ import foundation.e.blisslauncher.core.database.model.ApplicationItem ...@@ -26,7 +26,6 @@ import foundation.e.blisslauncher.core.database.model.ApplicationItem
import foundation.e.blisslauncher.core.database.model.LauncherItem import foundation.e.blisslauncher.core.database.model.LauncherItem
import foundation.e.blisslauncher.core.database.model.ShortcutItem import foundation.e.blisslauncher.core.database.model.ShortcutItem
import foundation.e.blisslauncher.core.utils.Constants import foundation.e.blisslauncher.core.utils.Constants
import foundation.e.blisslauncher.features.launcher.Hotseat
import foundation.e.blisslauncher.features.test.anim.Interpolators import foundation.e.blisslauncher.features.test.anim.Interpolators
import foundation.e.blisslauncher.features.test.dragndrop.DropTarget import foundation.e.blisslauncher.features.test.dragndrop.DropTarget
import foundation.e.blisslauncher.features.test.graphics.DragPreviewProvider import foundation.e.blisslauncher.features.test.graphics.DragPreviewProvider
...@@ -199,7 +198,7 @@ open class CellLayout @JvmOverloads constructor( ...@@ -199,7 +198,7 @@ open class CellLayout @JvmOverloads constructor(
return Math.min( return Math.min(
measuredHeight, measuredHeight,
launcher.deviceProfile launcher.deviceProfile
.getCellHeight(if (parent is Hotseat) Constants.CONTAINER_HOTSEAT else Constants.CONTAINER_DESKTOP) .getCellHeight(mContainerType)
) )
} }
......
...@@ -134,6 +134,7 @@ class IconTextView @JvmOverloads constructor( ...@@ -134,6 +134,7 @@ class IconTextView @JvmOverloads constructor(
compoundDrawablePadding = dp.iconDrawablePaddingPx compoundDrawablePadding = dp.iconDrawablePaddingPx
ellipsize = TruncateAt.END ellipsize = TruncateAt.END
longPressHelper = CheckLongPressHelper(this) longPressHelper = CheckLongPressHelper(this)
setTextAlpha(1f)
} }
override fun onFocusChanged( override fun onFocusChanged(
......
...@@ -30,6 +30,7 @@ import android.view.WindowManager ...@@ -30,6 +30,7 @@ import android.view.WindowManager
import foundation.e.blisslauncher.R import foundation.e.blisslauncher.R
import foundation.e.blisslauncher.core.Utilities import foundation.e.blisslauncher.core.Utilities
import foundation.e.blisslauncher.core.utils.Constants import foundation.e.blisslauncher.core.utils.Constants
import foundation.e.blisslauncher.core.utils.ResourceUtils
import foundation.e.blisslauncher.features.notification.DotRenderer import foundation.e.blisslauncher.features.notification.DotRenderer
import foundation.e.blisslauncher.features.test.uninstall.UninstallButtonRenderer import foundation.e.blisslauncher.features.test.uninstall.UninstallButtonRenderer
import kotlin.math.max import kotlin.math.max
...@@ -211,8 +212,8 @@ class VariantDeviceProfile( ...@@ -211,8 +212,8 @@ class VariantDeviceProfile(
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_bottom_padding) res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_bottom_padding)
hotseatBarSidePaddingPx = hotseatBarSidePaddingPx =
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_side_padding) res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_side_padding)
hotseatBarSizePx = hotseatBarSizePx = ResourceUtils.pxFromDp(inv.iconSize, dm) + (res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_extra_vertical_size)
res.getDimensionPixelSize(R.dimen.dynamic_grid_hotseat_size) + hotseatBarTopPaddingPx + hotseatBarBottomPaddingPx + hotseatBarTopPaddingPx + hotseatBarBottomPaddingPx)
workspacePageIndicatorHeight = workspacePageIndicatorHeight =
res.getDimensionPixelSize(R.dimen.dotSize) * 2 + res.getDimensionPixelSize(R.dimen.dotPadding) * 2 res.getDimensionPixelSize(R.dimen.dotSize) * 2 + res.getDimensionPixelSize(R.dimen.dotPadding) * 2
...@@ -467,10 +468,10 @@ class VariantDeviceProfile( ...@@ -467,10 +468,10 @@ class VariantDeviceProfile(
insets.top + availableHeightPx - hotseatBarSizePx - -edgeMarginPx insets.top + availableHeightPx - hotseatBarSizePx - -edgeMarginPx
) )
fun getCellHeight(containerType: Long): Int { fun getCellHeight(containerType: Int): Int {
return when (containerType) { return when (containerType) {
Constants.CONTAINER_DESKTOP -> cellHeightPx CellLayout.WORKSPACE -> cellHeightPx
Constants.CONTAINER_HOTSEAT -> hotseatCellHeightPx CellLayout.HOTSEAT -> hotseatCellHeightPx
else -> 0 else -> 0
} }
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
<dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen> <dimen name="dynamic_grid_hotseat_top_padding">8dp</dimen>
<dimen name="dynamic_grid_hotseat_bottom_padding">2dp</dimen> <dimen name="dynamic_grid_hotseat_bottom_padding">2dp</dimen>
<dimen name="dynamic_grid_hotseat_size">80dp</dimen> <dimen name="dynamic_grid_hotseat_size">80dp</dimen>
<dimen name="dynamic_grid_hotseat_extra_vertical_size">34dp</dimen>
<dimen name="dynamic_grid_hotseat_side_padding">0dp</dimen> <dimen name="dynamic_grid_hotseat_side_padding">0dp</dimen>
<dimen name="folder_cell_x_padding">9dp</dimen> <dimen name="folder_cell_x_padding">9dp</dimen>
......
...@@ -34,12 +34,13 @@ ...@@ -34,12 +34,13 @@
<item name="android:background">@color/white</item> <item name="android:background">@color/white</item>
</style> </style>
<style name="BaseIcon"> <style name="BaseIcon" parent="@android:style/TextAppearance.DeviceDefault">
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item> <item name="android:layout_height">match_parent</item>
<item name="android:layout_gravity">center</item> <item name="android:layout_gravity">center</item>
<item name="android:focusable">true</item> <item name="android:focusable">true</item>
<item name="android:gravity">center_horizontal</item> <item name="android:gravity">center_horizontal</item>
<item name="android:lines">1</item>
<item name="android:maxLines">2</item> <item name="android:maxLines">2</item>
<item name="android:textColor">?android:attr/textColorSecondary</item> <item name="android:textColor">?android:attr/textColorSecondary</item>
</style> </style>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment