Skip to content

Commit

Permalink
Sync
Browse files Browse the repository at this point in the history
  • Loading branch information
james_tan94 committed Oct 13, 2021
1 parent e2fcfa5 commit 0e939b8
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 114 deletions.
202 changes: 101 additions & 101 deletions app/src/main/java/com/example/countrypicker/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,107 +40,107 @@ class MainActivity : AppCompatActivity() {
rv.setVisibleCapital(true)
rv.setVisibleInfo(true)

//Position
rv.setPositionCheckbox(1)
rv.setPositionPrefix(1)
rv.setPositionIcon(1)
rv.setPositionName(1)
rv.setPositionNameShort(1)
rv.setPositionCurrency(1)
rv.setPositionCurrencyShort(1)
rv.setPositionCapital(1)

//Weight
rv.setWeightCheckbox(1f)
rv.setWeightPrefix(1f)
rv.setWeightIcon(1f)
rv.setWeightName(1f)
rv.setWeightNameShort(1f)
rv.setWeightCurrency(1f)
rv.setWeightCurrencyShort(1f)
rv.setWeightCapital(1f)
rv.setWeightInfo(1f)

//Spacing
rv.setSpacingCheckbox(0.2f)
rv.setSpacingPrefix(0.2f)
rv.setSpacingIcon(0.1f)
rv.setSpacingName(0.3f)
rv.setSpacingNameShort(0.2f)
rv.setSpacingCurrency(0.3f)
rv.setSpacingCurrencyShort(0.1f)
rv.setSpacingCapital(0.5f)
rv.setSpacingInfo(0.2f)

//Info
rv.setInfoMessageAll("All msg")
rv.setInfoMessageCustom(hm)
rv.setInfoHiddenOnly(hidden)
rv.setInfoShowOnly(showTemp)

//Hidden
rv.setHiddenOnlyWithName(hidden)
rv.setShowOnlyWithName(show)

//TextView
rv.setTextViewSizeName(20f)
rv.setTextViewSizeNameShort(12f)
rv.setTextViewSizePrefix(25f)
rv.setTextViewSizeCurrency(18f)
rv.setTextViewSizeCurrencyShort(30f)
rv.setTextViewSizeCapital(10f)
rv.setTextViewSizeAll(10f)

rv.setTextViewBoldName(true)
rv.setTextViewBoldNameShort(false)
rv.setTextViewBoldPrefix(true)
rv.setTextViewBoldCurrency(false)
rv.setTextViewBoldCurrencyShort(false)
rv.setTextViewBoldCapital(false)
rv.setTextViewBoldAll(true)

rv.setTextViewColorName(Color.BLUE)
rv.setTextViewColorNameShort(Color.BLUE)
rv.setTextViewColorPrefix(Color.BLUE)
rv.setTextViewColorCurrency(Color.BLUE)
rv.setTextViewColorCurrencyShort(Color.BLUE)
rv.setTextViewColorCapital(Color.BLUE)
rv.setTextViewColorAll(Color.BLUE)

//TextView Custom
rv.setTextViewPrefixSizeWithName(showSize, 15f)
rv.setTextViewNameSizeWithName(showSize, 30f)
rv.setTextViewNameShortSizeWithName(showSize, 25f)
rv.setTextViewCurrencySizeWithName(showSize, 10f)
rv.setTextViewCurrencyShortSizeWithName(showSize, 5f)
rv.setTextViewCapitalSizeWithName(showSize, 20f)

rv.setTextViewPrefixBoldWithName(show, true)
rv.setTextViewNameBoldWithName(show, true)
rv.setTextViewNameShortBoldWithName(show, true)
rv.setTextViewCurrencyBoldWithName(show, true)
rv.setTextViewCurrencyShortBoldWithName(show, true)
rv.setTextViewCapitalBoldWithName(show, true)

rv.setTextViewPrefixColorWithName(show, Color.RED)
rv.setTextViewNameColorWithName(show, Color.RED)
rv.setTextViewNameShortColorWithName(show, Color.RED)
rv.setTextViewCurrencyColorWithName(show, Color.RED)
rv.setTextViewCurrencyShortColorWithName(show, Color.RED)
rv.setTextViewCapitalColorWithName(show, Color.RED)

//Sort
rv.setSortByName()
rv.setSortByNameShort()
rv.setSortByCurrency()
rv.setSortByCurrencyShort()
rv.setSortByCapital()
rv.setSortPrioritizeByName(show)

//BG
rv.setBackgroundColor(Color.GRAY)
rv.setBackgroundListOddColor(Color.GREEN)
rv.setBackgroundListEvenColor(Color.CYAN)
// //Position
// rv.setPositionCheckbox(1)
// rv.setPositionPrefix(1)
// rv.setPositionIcon(1)
// rv.setPositionName(1)
// rv.setPositionNameShort(1)
// rv.setPositionCurrency(1)
// rv.setPositionCurrencyShort(1)
// rv.setPositionCapital(1)
//
// //Weight
// rv.setWeightCheckbox(1f)
// rv.setWeightPrefix(1f)
// rv.setWeightIcon(1f)
// rv.setWeightName(1f)
// rv.setWeightNameShort(1f)
// rv.setWeightCurrency(1f)
// rv.setWeightCurrencyShort(1f)
// rv.setWeightCapital(1f)
// rv.setWeightInfo(1f)
//
// //Spacing
// rv.setSpacingCheckbox(0.2f)
// rv.setSpacingPrefix(0.2f)
// rv.setSpacingIcon(0.1f)
// rv.setSpacingName(0.3f)
// rv.setSpacingNameShort(0.2f)
// rv.setSpacingCurrency(0.3f)
// rv.setSpacingCurrencyShort(0.1f)
// rv.setSpacingCapital(0.5f)
// rv.setSpacingInfo(0.2f)
//
// //Info
// rv.setInfoMessageAll("All msg")
// rv.setInfoMessageCustom(hm)
// rv.setInfoHiddenOnly(hidden)
// rv.setInfoShowOnly(showTemp)
//
// //Hidden
// rv.setHiddenOnlyWithName(hidden)
// rv.setShowOnlyWithName(show)
//
// //TextView
// rv.setTextViewSizeName(20f)
// rv.setTextViewSizeNameShort(12f)
// rv.setTextViewSizePrefix(25f)
// rv.setTextViewSizeCurrency(18f)
// rv.setTextViewSizeCurrencyShort(30f)
// rv.setTextViewSizeCapital(10f)
// rv.setTextViewSizeAll(10f)
//
// rv.setTextViewBoldName(true)
// rv.setTextViewBoldNameShort(false)
// rv.setTextViewBoldPrefix(true)
// rv.setTextViewBoldCurrency(false)
// rv.setTextViewBoldCurrencyShort(false)
// rv.setTextViewBoldCapital(false)
// rv.setTextViewBoldAll(true)
//
// rv.setTextViewColorName(Color.BLUE)
// rv.setTextViewColorNameShort(Color.BLUE)
// rv.setTextViewColorPrefix(Color.BLUE)
// rv.setTextViewColorCurrency(Color.BLUE)
// rv.setTextViewColorCurrencyShort(Color.BLUE)
// rv.setTextViewColorCapital(Color.BLUE)
// rv.setTextViewColorAll(Color.BLUE)
//
// //TextView Custom
// rv.setTextViewPrefixSizeWithName(showSize, 15f)
// rv.setTextViewNameSizeWithName(showSize, 30f)
// rv.setTextViewNameShortSizeWithName(showSize, 25f)
// rv.setTextViewCurrencySizeWithName(showSize, 10f)
// rv.setTextViewCurrencyShortSizeWithName(showSize, 5f)
// rv.setTextViewCapitalSizeWithName(showSize, 20f)
//
// rv.setTextViewPrefixBoldWithName(show, true)
// rv.setTextViewNameBoldWithName(show, true)
// rv.setTextViewNameShortBoldWithName(show, true)
// rv.setTextViewCurrencyBoldWithName(show, true)
// rv.setTextViewCurrencyShortBoldWithName(show, true)
// rv.setTextViewCapitalBoldWithName(show, true)
//
// rv.setTextViewPrefixColorWithName(show, Color.RED)
// rv.setTextViewNameColorWithName(show, Color.RED)
// rv.setTextViewNameShortColorWithName(show, Color.RED)
// rv.setTextViewCurrencyColorWithName(show, Color.RED)
// rv.setTextViewCurrencyShortColorWithName(show, Color.RED)
// rv.setTextViewCapitalColorWithName(show, Color.RED)
//
// //Sort
// rv.setSortByName()
// rv.setSortByNameShort()
// rv.setSortByCurrency()
// rv.setSortByCurrencyShort()
// rv.setSortByCapital()
// rv.setSortPrioritizeByName(show)
//
// //BG
// rv.setBackgroundColor(Color.GRAY)
// rv.setBackgroundListOddColor(Color.GREEN)
// rv.setBackgroundListEvenColor(Color.CYAN)

rv.setCategoryVisible(true)
rv.setCategoryColor(Color.BLUE)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
android:id="@+id/activity_main_rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"/>
android:visibility="visible"/>

<Button
android:id="@+id/activity_main_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:visibility="visible"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:
}

adapter = adapt
startSort()

}

Expand Down Expand Up @@ -748,7 +747,8 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:

private fun startSort(){
(adapter as adapterCountryRecyclerview).apply {
modelsFull.sortedBy(SortedPrioritize, SortedType)
val temp = modelsFull.sortedBy(SortedPrioritize, SortedType)
modelsFull = temp
submitList(modelsFull)

}
Expand Down Expand Up @@ -808,6 +808,8 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:

}

startSort()

}

fun setManualNameShortChange(hm : HashMap<String, String>){
Expand All @@ -816,6 +818,8 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:

}

startSort()

}

fun setManualPrefixChange(hm : HashMap<String, String>){
Expand All @@ -824,6 +828,8 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:

}

startSort()

}

fun setManualCurrencyChange(hm : HashMap<String, String>){
Expand All @@ -832,6 +838,8 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:

}

startSort()

}

fun setManualCurrencyShortChange(hm : HashMap<String, String>){
Expand All @@ -840,6 +848,8 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:

}

startSort()

}

fun setManualCapitalChange(hm : HashMap<String, String>){
Expand All @@ -848,6 +858,8 @@ class CountryRecyclerview(context: Context, attrs: AttributeSet?, defStyleAttr:

}

startSort()

}

override fun onResult(c: List<Country>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,6 @@ class adapterCountryRecyclerview constructor(val cseq : MutableList<CountrySeque
binding.sectiontextvisibility = if (secHeader) View.GONE else View.VISIBLE
binding.executePendingBindings()

if (secHeader) {
binding.cellDialogFilteringSection.visibility = View.GONE

} else {
binding.cellDialogFilteringSection.visibility = View.VISIBLE
binding.cellDialogFilteringSection.text = "A"

}

Glide.with(itemView.context).load(item.flag.getImage(itemView.context)).centerCrop().into(binding.cellDialogFilterFlag)

overrideSeq.onEach {
Expand Down

0 comments on commit 0e939b8

Please sign in to comment.