-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'changes_1' into development
# Conflicts: # README.md # app/src/main/java/com/ss/smartfilter/MainActivity.kt # ss-smart-filter/src/main/java/com/ss/smartfilterlib/utils/Attributes.kt # ss-smart-filter/src/main/res/color/chip_text_selector.xml
- Loading branch information
Showing
70 changed files
with
1,297 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
app/src/main/java/com/ss/smartfilter/screens/ExpandableAmentiesType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package com.ss.smartfilter.screens | ||
|
||
import android.widget.LinearLayout | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.filled.KeyboardArrowDown | ||
import androidx.compose.material.icons.filled.KeyboardArrowUp | ||
import androidx.compose.material3.Icon | ||
import androidx.compose.material3.IconButton | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.runtime.setValue | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.TextStyle | ||
import androidx.compose.ui.text.font.FontWeight | ||
import androidx.compose.ui.tooling.data.UiToolingDataApi | ||
import androidx.compose.ui.unit.dp | ||
import androidx.compose.ui.unit.sp | ||
import androidx.compose.ui.viewinterop.AndroidView | ||
import com.ss.smartfilter.addMultiSelectionChipGroupAmenties | ||
import com.ss.smartfilterlib.SmartFilter | ||
|
||
/** | ||
* created by Mala Ruparel ON 16/05/24 | ||
*/ | ||
@OptIn(UiToolingDataApi::class) | ||
@Composable | ||
fun ExpandableAmentiesType(title: String) { | ||
var expanded by remember { mutableStateOf(false) } | ||
Column( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(8.dp) | ||
|
||
) { | ||
Row( | ||
modifier = Modifier.fillMaxWidth(), | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
|
||
Text( | ||
modifier = Modifier | ||
.weight(1f) | ||
.padding(16.dp), | ||
text = title, | ||
fontSize = 18.sp, | ||
style = TextStyle(fontWeight = FontWeight.Bold) | ||
) | ||
IconButton( | ||
onClick = { expanded = !expanded }, | ||
modifier = Modifier.size(36.dp) | ||
) { | ||
Icon( | ||
if (expanded) Icons.Default.KeyboardArrowUp else Icons.Default.KeyboardArrowDown, | ||
contentDescription = if (expanded) "Collapse" else "Expand" | ||
) | ||
} | ||
} | ||
|
||
if (expanded) { | ||
AndroidView(factory = { context -> | ||
LinearLayout(context).apply { | ||
layoutParams = LinearLayout.LayoutParams( | ||
LinearLayout.LayoutParams.MATCH_PARENT, | ||
LinearLayout.LayoutParams.WRAP_CONTENT | ||
) | ||
} | ||
}) { view -> | ||
|
||
SmartFilter.addChipGroupMultiSelection { | ||
addMultiSelectionChipGroupAmenties(view) { } | ||
} | ||
} | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.