Skip to content

Commit

Permalink
Add subtract remove icons moved to QuantityIcons
Browse files Browse the repository at this point in the history
  • Loading branch information
burak.ozturk1 committed Oct 17, 2024
1 parent e8123b7 commit e2f810a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion libraries/quantity-picker-compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies {

You can add **QuantityPicker** wherever you want with your modifier


| Attribute | Type | Description |
| ------------------- | ----------------------- | ------------------------------------------------------------ |
| modifier | Modifier | Compose modifier for QuantityPicker |
Expand Down Expand Up @@ -87,6 +86,10 @@ QuantityPicker(
)
```

# Repository From

[https://github.com/selimtoksal/QuantityPicker](https://github.com/selimtoksal/QuantityPicker)

# Contributors

This library is maintained mainly by Trendyol Android Team members but also other Android lovers contributes.
Expand All @@ -98,3 +101,4 @@ Copyright 2023 Trendyol.com Licensed under the Apache License, Version 2.0 (t
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
```

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.trendyol.uicomponents.quantitypicker

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -133,11 +134,12 @@ internal fun HorizontalQuantityPicker(
.background(
color = quantityShape.backgroundColor,
shape = quantityShape.shape
),
)
.animateContentSize(),
verticalAlignment = Alignment.CenterVertically
) {

AnimatedVisibility(visible = quantityData.currentQuantity > 0 || showLoading) {
if (quantityData.currentQuantity > 0 || showLoading) {
Row(verticalAlignment = Alignment.CenterVertically) {
QuantitySubtractIcon(
icons = icons,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.trendyol.uicomponents.quantitypicker

import androidx.compose.animation.Crossfade
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.size
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Text
Expand Down Expand Up @@ -59,6 +60,7 @@ internal fun QuantityText(
text = text,
style = textStyle,
modifier = Modifier
.clickable(enabled = false) {}
.background(
shape.backgroundColor,
shape.shape
Expand Down

0 comments on commit e2f810a

Please sign in to comment.