couple ui corrections
This commit is contained in:
parent
d08e1cebd4
commit
b32298e305
|
@ -14,6 +14,7 @@ import android.widget.SeekBar
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.simplemobiletools.calendar.MonthlyCalendarImpl
|
import com.simplemobiletools.calendar.MonthlyCalendarImpl
|
||||||
import com.simplemobiletools.calendar.R
|
import com.simplemobiletools.calendar.R
|
||||||
|
import com.simplemobiletools.calendar.extensions.removeUnderlineFlag
|
||||||
import com.simplemobiletools.calendar.helpers.Config
|
import com.simplemobiletools.calendar.helpers.Config
|
||||||
import com.simplemobiletools.calendar.helpers.LOW_ALPHA
|
import com.simplemobiletools.calendar.helpers.LOW_ALPHA
|
||||||
import com.simplemobiletools.calendar.helpers.MyWidgetMonthlyProvider
|
import com.simplemobiletools.calendar.helpers.MyWidgetMonthlyProvider
|
||||||
|
@ -181,11 +182,8 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
|
||||||
text = day.value.toString()
|
text = day.value.toString()
|
||||||
setTextColor(curTextColor)
|
setTextColor(curTextColor)
|
||||||
|
|
||||||
if (day.hasEvent)
|
paintFlags = if (day.hasEvent) (paintFlags or Paint.UNDERLINE_TEXT_FLAG) else (paintFlags.removeUnderlineFlag())
|
||||||
paintFlags = paintFlags or Paint.UNDERLINE_TEXT_FLAG
|
background = if (day.isToday) todayCircle else null
|
||||||
|
|
||||||
if (day.isToday)
|
|
||||||
background = todayCircle
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.simplemobiletools.calendar.extensions
|
||||||
|
|
||||||
|
import android.graphics.Paint
|
||||||
|
|
||||||
|
// TODO: how to do "flags & ~Paint.UNDERLINE_TEXT_FLAG" in kotlin?
|
||||||
|
fun Int.removeUnderlineFlag(): Int {
|
||||||
|
return this - (if (this and Paint.UNDERLINE_TEXT_FLAG == Paint.UNDERLINE_TEXT_FLAG) Paint.UNDERLINE_TEXT_FLAG else 0)
|
||||||
|
}
|
|
@ -18,6 +18,7 @@ import com.simplemobiletools.calendar.R
|
||||||
import com.simplemobiletools.calendar.activities.DayActivity
|
import com.simplemobiletools.calendar.activities.DayActivity
|
||||||
import com.simplemobiletools.calendar.extensions.beVisibleIf
|
import com.simplemobiletools.calendar.extensions.beVisibleIf
|
||||||
import com.simplemobiletools.calendar.extensions.getAppropriateTheme
|
import com.simplemobiletools.calendar.extensions.getAppropriateTheme
|
||||||
|
import com.simplemobiletools.calendar.extensions.removeUnderlineFlag
|
||||||
import com.simplemobiletools.calendar.helpers.*
|
import com.simplemobiletools.calendar.helpers.*
|
||||||
import com.simplemobiletools.calendar.interfaces.MonthlyCalendar
|
import com.simplemobiletools.calendar.interfaces.MonthlyCalendar
|
||||||
import com.simplemobiletools.calendar.interfaces.NavigationListener
|
import com.simplemobiletools.calendar.interfaces.NavigationListener
|
||||||
|
@ -186,11 +187,8 @@ class MonthFragment : Fragment(), MonthlyCalendar {
|
||||||
setTextColor(curTextColor)
|
setTextColor(curTextColor)
|
||||||
setOnClickListener { openDay(day.code) }
|
setOnClickListener { openDay(day.code) }
|
||||||
|
|
||||||
if (day.hasEvent)
|
paintFlags = if (day.hasEvent) (paintFlags or Paint.UNDERLINE_TEXT_FLAG) else (paintFlags.removeUnderlineFlag())
|
||||||
paintFlags = paintFlags or Paint.UNDERLINE_TEXT_FLAG
|
background = if (day.isToday) todayCircle else null
|
||||||
|
|
||||||
if (day.isToday)
|
|
||||||
background = todayCircle
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:shape="ring"
|
android:shape="ring"
|
||||||
android:thicknessRatio="2"
|
android:thicknessRatio="1"
|
||||||
android:useLevel="false">
|
android:useLevel="false">
|
||||||
<solid android:color="@android:color/transparent"/>
|
<solid android:color="@android:color/transparent"/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue