-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi selction chip group #8
Merged
Merged
Changes from 68 commits
Commits
Show all changes
72 commits
Select commit
Hold shift + click to select a range
f42bc32
#Singal Selection - Radio Group , MultiRow Radio group
MalaRuparel2023 b806733
#Singal Selection - radio group row item implimented and refactor
MalaRuparel2023 4e9181d
#Singal Selection - refactor for radio group
MalaRuparel2023 b551bcf
#Singal Selection - refactor for radio group
MalaRuparel2023 b275fb1
#Singal Selection - refactor for radio group
MalaRuparel2023 ef9bffd
#Singal Selection - refactor for radio group
MalaRuparel2023 dd7fb78
#Singal Selection -Single line modified
MalaRuparel2023 911775c
#Singal Selection - refactor for radio group
MalaRuparel2023 c3ff9af
#Singal Selection - refactor for radio group
MalaRuparel2023 75cbdd2
#Singal Selection - refactor code
MalaRuparel2023 b773ad5
#Singal Selection - refactor code
MalaRuparel2023 539ba0b
#Update README.md
MalaRuparel2023 ed31a24
#Single selectoin change
MalaRuparel2023 332ea4f
#Single selectoin change
MalaRuparel2023 421b9e7
#Single selectoin - Chip Group added
MalaRuparel2023 db141f0
#Single Selection - chip group added
MalaRuparel2023 9d2ccea
#Single Selection - solve sonar error
MalaRuparel2023 0075266
#Single Selection - solve sonar error
MalaRuparel2023 96057a9
Merge branch 'development' into singal_selction_radio_group
MalaRuparel2023 365f54e
Merge branch 'singal_selction_radio_group' into singal_selction_chip_…
MalaRuparel2023 3c8e1bd
#Single Selection - Chip group implementation
MalaRuparel2023 4a7e92c
#Single Selection - chip group reformat
MalaRuparel2023 6f168ba
Update README.md
MalaRuparel2023 b8b1c5a
#Single Selection - chip group reformat
MalaRuparel2023 8eef7d9
#multi selection - chip group
MalaRuparel2023 39440f5
#multi selection - chip group
MalaRuparel2023 c98cdd9
#multi selection - chip group
MalaRuparel2023 8691166
#multi selection - chip group
MalaRuparel2023 74aec38
#multi selection - chip group
MalaRuparel2023 fbe0546
#multi selection - chip group
MalaRuparel2023 4b933ee
#multi selection - chip group
MalaRuparel2023 9269499
#Update README.md
MalaRuparel2023 afbed90
#Update Resolve Pull Request Comments issue
MalaRuparel2023 b434ef8
#Update Resolve Pull Request Comments issue
MalaRuparel2023 fe11eb2
Merge remote-tracking branch 'origin/singal_selction_radio_group' int…
MalaRuparel2023 081462a
#Update Resolve Pull Request Comments issue
MalaRuparel2023 e1d4d13
#Update Resolve Pull Request Comments issue
MalaRuparel2023 bd99b5c
#Update Resolve Pull Request Comments issue
MalaRuparel2023 86d071a
#Update Resolve Pull Request Comments issue
MalaRuparel2023 f9a799a
Merge branch 'singal_selction_radio_group' into singal_selction_chip_…
MalaRuparel2023 3225ad0
#single radio group - row item, multi raw basic changes
MalaRuparel2023 629a9c4
Merge branch 'singal_selction_radio_group' into singal_selction_chip_…
MalaRuparel2023 7e18e96
#resolve git-merge issue
MalaRuparel2023 14532bf
#resolve git-merge issue
MalaRuparel2023 a00a0bc
Merge branch 'singal_selction_radio_group' into singal_selction_chip_…
MalaRuparel2023 daf0a93
#resolve git-merge issue
MalaRuparel2023 abcc761
Merge branch 'singal_selction_chip_group' into multi_selction_chip_group
MalaRuparel2023 5c233a5
#resolve git-merge issue
MalaRuparel2023 d50e654
#Single Selection Chip group implementation
MalaRuparel2023 064dc0c
Merge branch 'singal_selction_chip_group' into multi_selction_chip_group
MalaRuparel2023 69fbc1e
#Multi Selection Chip group implementation
MalaRuparel2023 ad6b3df
#correct the name ic_rg to ic_rb_unchecked.xml
MalaRuparel2023 58149cb
#add ext function for toast in Context.kt
MalaRuparel2023 8ec3670
#corrected file name
MalaRuparel2023 64d5989
#corrected file name
MalaRuparel2023 f102b4f
#replace with lamda function
MalaRuparel2023 e67a9bd
#corrected file name
MalaRuparel2023 f286d05
#handle nullable data
MalaRuparel2023 a22f5df
#corrected file name
MalaRuparel2023 5c975e5
#implemented lamda and sealed class
MalaRuparel2023 dceb522
Update README.md
MalaRuparel2023 e519b51
Update README.md
MalaRuparel2023 58c9a42
#corrected read me
MalaRuparel2023 6904c59
#implement lamda
MalaRuparel2023 cc29803
#correct array name
MalaRuparel2023 94c98e5
#correct data
MalaRuparel2023 fffb3a9
#correct file name
MalaRuparel2023 4be4dea
#correct style name change
MalaRuparel2023 10e6567
#change
MalaRuparel2023 28947fd
#change gitignore
MalaRuparel2023 ed4ec96
Merge branch 'development' into multi_selction_chip_group
MalaRuparel2023 ed9b593
#merge conflit resolve
MalaRuparel2023 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,32 +1,124 @@ | ||
# Smart Filter Library | ||
|
||
This is a library for creating and managing radio groups in Android. It provides support for single line, multi line and row item radio groups. | ||
This is a library for creating and managing .... | ||
|
||
## Features | ||
|
||
- Single Line Radio Group: A radio group that displays its items in a single line. | ||
- Multi Line Radio Group: A radio group that displays its items in multiple lines. | ||
- Row Item Radio Group: A radio group that displays its items in a row. | ||
|
||
- Single Line Radio Group(Verticle/Horizontal) | ||
- Multi Line Radio Group | ||
- Row Item Radio Group(Verticle/Horizontal) | ||
- Range Selection | ||
- Chip Group Single Selection(Verticle/Horizontal) | ||
- Chip Group Multi Selection(Verticle/Horizontal) | ||
- Checked Single Selection(Verticle/Horizontal) | ||
- Checked multi Selection(Verticle/Horizontal) | ||
|
||
## Getting Started | ||
|
||
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. | ||
These instructions will get you a copy of the project up and running on your local machine | ||
|
||
## Prerequisites | ||
|
||
|
||
|
||
## Installing | ||
|
||
- **Clone the repository: `git clone https://github.com/smartSenseSolutions/smart-filter-library.git`** | ||
- **Open the project in Android Studio.** | ||
- **Build and run the project on an emulator or device.** | ||
|
||
|
||
## SingleSelection | ||
|
||
### SingleSelectionRadioGroup(Verticle/Horizontal) | ||
|
||
- **Verticle** | ||
|
||
|
||
SmartFilter.addRadioGroupSingleSelection { | ||
addRadioGroupSingleLineVertical(binding.root) { radioGroupData -> | ||
toast("name: ${radioGroupData.name} ") }} | ||
|
||
<img src="media/single_selection_vertical.png" width="250" /> | ||
|
||
|
||
- **Horizontal** | ||
|
||
|
||
SmartFilter.addRadioGroupSingleSelection { | ||
addRadioGroupSingleLineHorizontal(binding.root) { radioGroupData -> | ||
toast("name: ${radioGroupData.name} ") } } | ||
|
||
|
||
<img src="media/single_selection_horizontal.png" width="250" /> | ||
|
||
|
||
### SingleSelectionMultiLine(MultiRaw) | ||
|
||
SmartFilter.addRadioMultiRawSingleSelection { | ||
addRadioMultiRow(binding.root) { radioGroupData -> | ||
toast("name: ${radioGroupData.name} ") } } | ||
|
||
|
||
<img src="media/single_selection_multiline.png" width="250" /> | ||
|
||
|
||
### SingleSelectionRowItem(Verticle/Horizontal) | ||
|
||
- **Verticle** | ||
|
||
SmartFilter.addRadioRawItemSingleSelection { | ||
addRadioGroupRowItemVertical(binding.root) { radioGroupData -> | ||
toast("name: ${radioGroupData.name} ") } } | ||
|
||
|
||
<img src="media/single_selection_row_item_vertical.png" width="250" /> | ||
|
||
- **Horizontal** | ||
|
||
SmartFilter.addRadioRawItemSingleSelection { | ||
addRadioGroupRowItemHorizontal(binding.root) { radioGroupData -> | ||
toast("name: ${radioGroupData.name} ") } } | ||
|
||
|
||
<img src="media/single_selection_row_item_horizontal.png" width="250" /> | ||
|
||
### Prerequisites | ||
### SingleSelectionChipGroup((Verticle/Horizontal)) | ||
|
||
- Android Studio Iguana | 2023.2.1 Patch 2 or later | ||
- JDK 8 | ||
- Android SDK 24 or later | ||
SmartFilter.addChipGroupSingleSelection { | ||
addSingleSelectionChipGroup(binding.root) { radioGroupData -> | ||
toast("name: ${radioGroupData.name} ") } } | ||
|
||
|
||
<img src="media/single_selection_chip.png" width="250" /> | ||
|
||
### MultiSelectionChipGroup(MultiRaw) | ||
|
||
SmartFilter.addChipGroupMultiSelection { | ||
addMultiSelectionChipGroup(binding.root) { radioGroupData -> | ||
toast("Checked IDs: ${radioGroupData.joinToString(", ")}") } } | ||
|
||
|
||
<img src="media/multiselect_chip.png" width="250" /> | ||
|
||
### Installing | ||
|
||
1. Clone the repository: `git clone https://github.com/smartSenseSolutions/smart-filter-library.git` | ||
2. Open the project in Android Studio. | ||
3. Build and run the project on an emulator or device. | ||
### Attribute | ||
|
||
| Attribute | Description | Type | Default Value | | ||
| --- | --- | --- | --- | | ||
| rootView | The root view of the radio group. | ViewGroup | - | | ||
| singleGroupSubType | The type of the radio group. | SingleGroupSubType | - | | ||
| orientation | The orientation of the radio group. | Orientation | VERTICAL | | ||
| mData | The list of radio group items. | List<RadioGroupData> | - | | ||
| callbacks | The event listener for the radio group. | BaseEventListener | - | | ||
| bgSelector | The background selector for the radio group items. | Int | - | | ||
| textSelector | The text color selector for the radio group items. | Int | - | | ||
|
||
## Usage | ||
### Usage | ||
|
||
To use the Smart Filter library in your Android application, you need to include it in your project's dependencies. Add the following line to your `build.gradle` file: | ||
- **To use the Smart Filter library in your Android application, you need to include it in your project's dependencies. Add the following line to your `build.gradle` file:** | ||
|
||
### Dependency | ||
|
||
```kotlin | ||
implementation 'com.ss:smartfilterlib:1.0.0' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
package com.ss.smartfilter | ||
|
||
import android.view.ViewGroup | ||
import com.ss.smartfilterlib.R | ||
import com.ss.smartfilterlib.data.MultiSelectionParams | ||
import com.ss.smartfilterlib.data.RadioGroupData | ||
import com.ss.smartfilterlib.data.SingleChipSelectionParams | ||
import com.ss.smartfilterlib.data.SingleSelectionMultiRawParams | ||
import com.ss.smartfilterlib.data.SingleSelectionParams | ||
import com.ss.smartfilterlib.data.mRadioGroupData | ||
import com.ss.smartfilterlib.utils.MultiChipType | ||
import com.ss.smartfilterlib.utils.Orientation | ||
import com.ss.smartfilterlib.utils.Params | ||
import com.ss.smartfilterlib.utils.SingleChipType | ||
import com.ss.smartfilterlib.utils.SingleGroupSubType | ||
|
||
/** | ||
* created by Mala Ruparel ON 23/04/24 | ||
*/ | ||
fun addRadioGroupSingleLineVertical( | ||
rootView: ViewGroup, | ||
radioGroupCallback: (RadioGroupData) -> Unit | ||
) = | ||
Params.SingleSelection( | ||
SingleSelectionParams( | ||
rootView = rootView, | ||
singleGroupSubType = SingleGroupSubType.SINGLE_LINE, | ||
chipType = SingleChipType.NONE, | ||
orientation = Orientation.VERTICAL, | ||
mData = mRadioGroupData(), | ||
callbacks = radioGroupCallback, | ||
bgSelector = R.drawable.singleline_rb_selector, | ||
textSelector = R.color.single_text_color_selector | ||
) | ||
) | ||
|
||
fun addRadioGroupSingleLineHorizontal( | ||
rootView: ViewGroup, | ||
radioGroupCallback: (RadioGroupData) -> Unit | ||
) = | ||
Params.SingleSelection( | ||
SingleSelectionParams( | ||
rootView = rootView, | ||
singleGroupSubType = SingleGroupSubType.SINGLE_LINE, | ||
chipType = SingleChipType.NONE, | ||
orientation = Orientation.HORIZONTAL, | ||
mData = mRadioGroupData(), | ||
callbacks = radioGroupCallback, | ||
bgSelector = R.drawable.singleline_rb_selector, | ||
textSelector = R.color.single_text_color_selector | ||
) | ||
) | ||
|
||
fun addRadioMultiRow(rootView: ViewGroup, radioGroupCallback: (RadioGroupData) -> Unit) = | ||
Params.SingleSelectionMultiRaw( | ||
SingleSelectionMultiRawParams( | ||
rootView = rootView, | ||
singleGroupSubType = SingleGroupSubType.MULTI_LINE, | ||
chipType = SingleChipType.NONE, | ||
orientation = Orientation.VERTICAL, | ||
mData = mRadioGroupData(), | ||
callbacks = radioGroupCallback, | ||
bgSelector = R.drawable.multiline_bg_selector, | ||
textSelector = R.color.multiline_text_selector | ||
) | ||
) | ||
|
||
|
||
fun addRadioGroupRowItemHorizontal( | ||
rootView: ViewGroup, | ||
radioGroupCallback: (RadioGroupData) -> Unit | ||
) = Params.SingleSelection( | ||
SingleSelectionParams( | ||
rootView = rootView, | ||
singleGroupSubType = SingleGroupSubType.ROW_ITEM, | ||
chipType = SingleChipType.NONE, | ||
orientation = Orientation.HORIZONTAL, | ||
mData = mRadioGroupData(), | ||
callbacks = radioGroupCallback, | ||
bgSelector = R.drawable.row_item_selector, | ||
textSelector = R.color.single_text_color_selector | ||
|
||
) | ||
) | ||
fun addRadioGroupRowItemVertical( | ||
rootView: ViewGroup, | ||
radioGroupCallback: (RadioGroupData) -> Unit | ||
) = Params.SingleSelection( | ||
SingleSelectionParams( | ||
rootView = rootView, | ||
singleGroupSubType = SingleGroupSubType.ROW_ITEM, | ||
chipType = SingleChipType.NONE, | ||
orientation = Orientation.VERTICAL, | ||
mData = mRadioGroupData(), | ||
callbacks = radioGroupCallback, | ||
bgSelector = R.drawable.row_item_selector, | ||
textSelector = R.color.single_text_color_selector | ||
|
||
) | ||
) | ||
fun addSingleSelectionChipGroup(rootView: ViewGroup, radioGroupCallback: (RadioGroupData) -> Unit) = | ||
|
||
SingleChipSelectionParams( | ||
rootView = rootView, | ||
singleGroupSubType = SingleGroupSubType.CHIP_GROUP, | ||
chipType = SingleChipType.CHOICE_CHIP, | ||
orientation = Orientation.VERTICAL, | ||
mData = mRadioGroupData(), | ||
callbacks = radioGroupCallback, | ||
bgSelector = R.color.chip_bg_selector, | ||
textSelector = R.color.chip_text_selector | ||
) | ||
|
||
fun addMultiSelectionChipGroup(rootView: ViewGroup, radioGroupCallback: (List<Int>) -> Unit) = | ||
MultiSelectionParams( | ||
rootView = rootView, | ||
chipType = MultiChipType.FILTER_CHIP, | ||
orientation = Orientation.VERTICAL, | ||
mData = mRadioGroupData(), | ||
callbacks = radioGroupCallback, | ||
bgSelector = R.color.chip_bg_selector, | ||
textSelector = R.color.chip_text_selector | ||
) | ||
|
||
|
||
|
||
|
||
|
||
|
2 changes: 1 addition & 1 deletion
2
...java/com/ss/smartfilter/ui/theme/Color.kt → ...in/java/com/ss/smartfilter/theme/Color.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.ss.smartfilter.ui.theme | ||
package com.ss.smartfilter.theme | ||
|
||
import androidx.compose.ui.graphics.Color | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move toast code into extension of context file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done