Skip to content

Commit

Permalink
fix theming on CalendarListAdapter
Browse files Browse the repository at this point in the history
remove disabled fragment
  • Loading branch information
newhinton committed Dec 13, 2023
1 parent 3517243 commit 1ebbea1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/de/felixnuesse/timedsilence/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class MainActivity : AppCompatActivity(), TimerInterface {
*/
private inner class ScreenSlidePagerAdapter(fm: FragmentManager) : FragmentPagerAdapter(fm) {

override fun getCount(): Int = 5
override fun getCount(): Int = 4

override fun getItem(position: Int): Fragment {

Expand All @@ -367,7 +367,7 @@ class MainActivity : AppCompatActivity(), TimerInterface {
1 -> return ScheduleFragment()
2 -> return CalendarFragment()
3 -> return KeywordFragment()
4 -> return WifiConnectedFragment()
//4 -> return WifiConnectedFragment()
else -> return ScheduleFragment()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,9 @@ class CalendarListAdapter(private var myDataset: ArrayList<CalendarObject>, priv
applyTextfieldStyle(holder.calendarView.textViewCalendarRowTitle)

if(Color.luminance(color) > 0.55) {

val typedValue = TypedValue()
val theme: Theme = context.theme
theme.resolveAttribute(R.attr.colorOnPrimary, typedValue, true)
holder.calendarView.textViewCalendarRowTitle.setTextColor(typedValue.data)
holder.calendarView.volumeState.imageTintList = ColorStateList.valueOf(typedValue.data)
val color = context.getColor(R.color.md_theme_dark_onPrimary)
holder.calendarView.textViewCalendarRowTitle.setTextColor(color)
holder.calendarView.volumeState.imageTintList = ColorStateList.valueOf(color)
}


Expand Down

0 comments on commit 1ebbea1

Please sign in to comment.