-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge community with enterprise (#32)
* Mobileapps 830 (#30) * adjusted margins as per figma design * Mobileapps 832 (#31) * downloaded config from server, also mimic config json app bundle * Preview screen enhancement, fixed crash… (#32) Preview screen changes. * Mobileapps 835 (#33) * added drop down for the advance search filters * Mobileapps 868 (#34) * fixed string localisation * fixed localisation default * Mobileapps 871 (#35) * fixed retain selected value * Mobileapps 837 (#36) * created epoxy recyclerview for advance chips * added epoxy controller * inflate categories on the view * select and unselect chips while changing the filter * created chip for relative filters * added text component dialog for chips * merged community with enterprise * merged community with enterprise and resolved conflicts
- Loading branch information
1 parent
ef26410
commit 68976e8
Showing
11 changed files
with
351 additions
and
77 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
15 changes: 15 additions & 0 deletions
15
search/src/main/kotlin/com/alfresco/content/search/ChipComponentType.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,15 @@ | ||
package com.alfresco.content.search | ||
|
||
/** | ||
* This is chip component of various types | ||
*/ | ||
enum class ChipComponentType(val component: String) { | ||
|
||
TEXT("text"), | ||
CHECK_LIST("check-list"), | ||
SLIDER("slider"), | ||
NUMBER_RANGE("number-range"), | ||
DATE_RANGE("date-range"), | ||
RADIO("radio"), | ||
None("none") | ||
} |
65 changes: 65 additions & 0 deletions
65
search/src/main/kotlin/com/alfresco/content/search/ListViewFilterChips.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,65 @@ | ||
package com.alfresco.content.search | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.LayoutInflater | ||
import android.widget.CompoundButton | ||
import android.widget.FrameLayout | ||
import com.airbnb.epoxy.CallbackProp | ||
import com.airbnb.epoxy.ModelProp | ||
import com.airbnb.epoxy.ModelView | ||
import com.alfresco.content.data.SearchFilter | ||
import com.alfresco.content.search.databinding.ViewListFilterChipsBinding | ||
import java.lang.StringBuilder | ||
|
||
/** | ||
* Generated Model View for the Advance Filter Chips | ||
*/ | ||
@ModelView(autoLayout = ModelView.Size.WRAP_WIDTH_WRAP_HEIGHT) | ||
class ListViewFilterChips @JvmOverloads constructor( | ||
context: Context, | ||
attrs: AttributeSet? = null, | ||
defStyleAttr: Int = 0 | ||
) : FrameLayout(context, attrs, defStyleAttr) { | ||
|
||
private val binding = ViewListFilterChipsBinding.inflate(LayoutInflater.from(context), this) | ||
|
||
/** | ||
* Bind the capture item data to the view | ||
*/ | ||
@ModelProp | ||
fun setData(dataObj: SearchChipCategory) { | ||
println("ListViewFilterChips.setData ${dataObj.category.name}") | ||
binding.chip.uncheck(false) | ||
|
||
binding.chip.text = getChipName(dataObj) | ||
|
||
if (dataObj.category.id == SearchFilter.Contextual.toString()) { | ||
binding.chip.isChecked = true | ||
} | ||
|
||
binding.chip.isChecked = dataObj.isSelected | ||
} | ||
|
||
private fun getChipName(dataObj: SearchChipCategory): StringBuilder { | ||
|
||
val nameBuilder = StringBuilder() | ||
|
||
val chipTitle: String? = if (dataObj.selectedName.isNotEmpty()) | ||
"${dataObj.category.name}: " | ||
else dataObj.category.name | ||
|
||
nameBuilder.append(chipTitle) | ||
nameBuilder.append(dataObj.selectedName) | ||
|
||
return nameBuilder | ||
} | ||
|
||
/** | ||
* set clickListener to the list item | ||
*/ | ||
@CallbackProp | ||
fun setCheckedChangeListener(listener: CompoundButton.OnCheckedChangeListener?) { | ||
binding.chip.setOnCheckedChangeListener(listener) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
search/src/main/kotlin/com/alfresco/content/search/SearchChipCategory.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,13 @@ | ||
package com.alfresco.content.search | ||
|
||
import com.alfresco.content.models.CategoriesItem | ||
|
||
/** | ||
* SearchChipCategory type is used for listSearchChips | ||
*/ | ||
data class SearchChipCategory( | ||
var category: CategoriesItem, | ||
var isSelected: Boolean, | ||
var selectedName: String = "", | ||
var selectedQuery: String = "" | ||
) |
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
Oops, something went wrong.