Skip to content

Commit

Permalink
changes data from app and refactoring (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
MalaRuparel2023 authored May 27, 2024
1 parent 830cae0 commit 45f4edc
Show file tree
Hide file tree
Showing 59 changed files with 482 additions and 326 deletions.
211 changes: 159 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Smart Filter Library

<img src="media/test.gif" width="250" />
<img src="media/Smartfilter.gif.gif" width="250" />

This library provides a set of customizable filter components for Android applications. It supports both single and multi-selection filters in various formats such as radio groups, chip groups, and list views. The filters can be displayed either vertically or horizontally.

Expand Down Expand Up @@ -50,116 +50,223 @@ The library depends on the following libraries:
- **Verticle**


SmartFilter.addRadioGroupSingleSelection {
addRadioGroupSingleLineVertical(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") }}
SmartFilter.addRadioGroupSingleSelection {
addRadioGroupSingleLineVertical(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") }}

Or

<com.ss.smartfilterlib.singleselection.SingleSelectionRadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rg_sl_list_item="@array/array_android_version"
app:rg_sl_background="@drawable/rb_selector"
app:rg_sl_text_color="@color/text_selector"
app:rg_sl_orientation="1"/>

- **Horizontal**


SmartFilter.addRadioGroupSingleSelection {
SmartFilter.addRadioGroupSingleSelection {
addRadioGroupSingleLineHorizontal(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }
toast("name: ${radioGroupData.name} ") } }

Or

<com.ss.smartfilterlib.singleselection.SingleSelectionRadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rg_sl_list_item="@array/array_android_version"
app:rg_sl_background="@drawable/rb_selector"
app:rg_sl_text_color="@color/text_selector"
app:rg_sl_orientation="0"/>


### SingleSelectionMultiLine(MultiRaw)

SmartFilter.addRadioMultiRawSingleSelection {
addRadioMultiRow(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }
### SingleSelectionMultiLine(MultiRaw)

SmartFilter.addRadioMultiRawSingleSelection {
addRadioButtonMultiRow(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }

OR

<com.ss.smartfilterlib.singleselection.SingleSelectionMultiLineRadioButton
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rg_ml_list_item="@array/array_android_version"
app:rg_ml_background="@drawable/multiline_bg_selector"
app:rg_ml_text_selector="@color/multiline_text_selector"/>

### SingleSelectionRowItem(Verticle/Horizontal)

- **Verticle**

SmartFilter.addRadioRawItemSingleSelection {
addRadioGroupRowItemVertical(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }


SmartFilter.addRadioRawItemSingleSelection {
addRadioGroupRowItemVertical(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }

- **Horizontal**
Or

SmartFilter.addRadioRawItemSingleSelection {
addRadioGroupRowItemHorizontal(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }
<com.ss.smartfilterlib.singleselection.SingleSelectionItemRadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rg_ri_list_item="@array/array_android_version"
app:rg_ri_orientation="1"
app:rg_ri_text_selector="@color/text_selector"/>

- **Horizontal**

SmartFilter.addRadioRawItemSingleSelection {
addRadioGroupRowItemHorizontal(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }

Or

<com.ss.smartfilterlib.singleselection.SingleSelectionItemRadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:rg_ri_list_item="@array/array_android_version"
app:rg_ri_orientation="1"
app:rg_ri_text_selector="@color/text_selector"/>

### SingleSelectionChipGroup((Verticle/Horizontal))

SmartFilter.addChipGroupSingleSelection {
addSingleSelectionChipGroupVertical(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }
SmartFilter.addChipGroupSingleSelection {
addSingleSelectionChipGroupVertical(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }
Or

<com.ss.smartfilterlib.singleselection.SingleSelectionChipGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cg_sl_orientation="1"
app:cg_sl_background="@color/chip_bg_selector"
app:cg_sl_list_item="@array/array_android_version"
app:cg_sl_text_selector="@color/chip_text_selector" />

- **Horizontal**

SmartFilter.addChipGroupSingleSelection {
addSingleSelectionChipGroupHorizontal(binding.root) { radioGroupData ->
SmartFilter.addChipGroupSingleSelection {
addSingleSelectionChipGroupHorizontal(binding.root) { radioGroupData ->
toast("name: ${radioGroupData.name} ") } }

Or
<com.ss.smartfilterlib.singleselection.SingleSelectionChipGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cg_sl_orientation="0"
app:cg_sl_background="@color/chip_bg_selector"
app:cg_sl_list_item="@array/array_android_version"
app:cg_sl_text_selector="@color/chip_text_selector" />

### MultiSelectionChipGroup(MultiRaw - (Verticle/Horizontal))

- **Verticle**

SmartFilter.addChipGroupMultiSelection {
addMultiSelectionChipGroupVertical(binding.root) { radioGroupData ->
toast("Checked IDs: ${radioGroupData.joinToString(", ")}") } }
- **Horizontal**
SmartFilter.addChipGroupMultiSelection {
addMultiSelectionChipGroupVertical(binding.root) { radioGroupData ->
toast("Checked IDs: ${radioGroupData.joinToString(", ")}") } }

Or

<com.ss.smartfilterlib.multiselection.MultiselectionChipGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cg_sl_orientation="1"
app:cg_sl_background="@color/chip_bg_selector"
app:cg_sl_list_item="@array/array_android_version"
app:cg_sl_text_selector="@color/chip_text_selector" />

SmartFilter.addChipGroupMultiSelection {
addMultiSelectionChipGroupHorizontal(binding.root) { radioGroupData ->
toast("Checked IDs: ${radioGroupData.joinToString(", ")}")}}
- **Horizontal**

SmartFilter.addChipGroupMultiSelection {
addMultiSelectionChipGroupHorizontal(binding.root) { radioGroupData ->
toast("Checked IDs: ${radioGroupData.joinToString(", ")}")}}

Or

<com.ss.smartfilterlib.multiselection.MultiselectionChipGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cg_sl_orientation="1"
app:cg_sl_background="@color/chip_bg_selector"
app:cg_sl_list_item="@array/array_android_version"
app:cg_sl_text_selector="@color/chip_text_selector" />

### SingleSelectionListView((Verticle/Horizontal))

- **Verticle**

SmartFilter.addListViewSingleSelection {
addSingleSelectionListVertical(binding.root) { radioGroupData ->
toast("name: " + radioGroupData.name) } }

- **Horizontal**

SmartFilter.addListViewSingleSelection {
addSingleSelectionListHorizontal(binding.root) { radioGroupData ->
SmartFilter.addListViewSingleSelection {
addSingleSelectionListVertical(binding.root) { radioGroupData ->
toast("name: " + radioGroupData.name) } }

OR
<com.ss.smartfilterlib.singleselection.SingleSelectionListView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:ss_orientation="1"
app:ss_checked_selector="@drawable/multiline_bg_selector"
app:ss_list_item="@array/array_android_version"
app:ss_text_selector="@color/chip_text_selector" />
- **Horizontal**

SmartFilter.addListViewSingleSelection {
addSingleSelectionListHorizontal(binding.root) { radioGroupData ->
toast("name: " + radioGroupData.name) } }

OR

<com.ss.smartfilterlib.singleselection.SingleSelectionListView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:ss_orientation="0"
app:ss_checked_selector="@drawable/multiline_bg_selector"
app:ss_list_item="@array/array_android_version"
app:ss_text_selector="@color/chip_text_selector" />

### MultiSelectionListView((Verticle/Horizontal))

- **Verticle**

SmartFilter.addListViewMultiSelection{
addMultiSelectionListVertical(binding.root) { radioGroupData ->
toast("name: " + radioGroupData) } }


SmartFilter.addListViewMultiSelection{
addMultiSelectionListVertical(binding.root) { radioGroupData ->
toast("name: " + radioGroupData) } }
OR

<com.ss.smartfilterlib.multiselection.MultiSelectionListView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:ss_orientation="1"
app:ss_checked_selector="@drawable/multiline_bg_selector"
app:ss_list_item="@array/array_android_version"
app:ss_text_selector="@color/chip_text_selector" />

- **Horizontal**

SmartFilter.addListViewMultiSelection{
addMultiSelectionListHorizontal(binding.root) { radioGroupData ->
toast("name: " + radioGroupData) } }
SmartFilter.addListViewMultiSelection{
addMultiSelectionListHorizontal(binding.root) { radioGroupData ->
toast("name: " + radioGroupData) } }

OR

<com.ss.smartfilterlib.multiselection.MultiSelectionListView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:ss_orientation="1"
app:ss_checked_selector="@drawable/multiline_bg_selector"
app:ss_list_item="@array/array_android_version"
app:ss_text_selector="@color/chip_text_selector" />


<img src="media/test1.png" width="250" /> <img src="media/test2.png" width="250" />
<img src="media/test3.png" width="250" /> <img src="media/test4.png" width="250" />
<img src="media/Screenshot1.png" width="250" /> <img src="media/Screenshot2.png" width="250" />
<img src="media/Screenshot3.png" width="250" /> <img src="media/Screenshot4.png" width="250" />



Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/com/ss/smartfilter/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package com.ss.smartfilter
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import com.ss.smartfilter.databinding.ActivityMainBinding
import com.ss.smartfilter.screens.FilterScreen
import com.ss.smartfilterlib.SmartFilter
import com.ss.smartfilterlib.utils.toast


class MainActivity : ComponentActivity() {

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Loading

0 comments on commit 45f4edc

Please sign in to comment.