couple text color changes

This commit is contained in:
tibbi 2017-01-02 20:53:33 +01:00
parent 4e3a63f147
commit 1982af9a52
6 changed files with 22 additions and 21 deletions

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.calendar.activities package com.simplemobiletools.calendar.activities
import android.content.Intent import android.content.Intent
import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.support.design.widget.Snackbar import android.support.design.widget.Snackbar
@ -12,6 +11,7 @@ import com.simplemobiletools.calendar.adapters.MyDayPagerAdapter
import com.simplemobiletools.calendar.fragments.DayFragment import com.simplemobiletools.calendar.fragments.DayFragment
import com.simplemobiletools.calendar.helpers.DAY_CODE import com.simplemobiletools.calendar.helpers.DAY_CODE
import com.simplemobiletools.calendar.helpers.Formatter import com.simplemobiletools.calendar.helpers.Formatter
import com.simplemobiletools.commons.extensions.updateTextColors
import kotlinx.android.synthetic.main.activity_day.* import kotlinx.android.synthetic.main.activity_day.*
import org.joda.time.DateTime import org.joda.time.DateTime
import java.util.* import java.util.*
@ -34,8 +34,8 @@ class DayActivity : SimpleActivity(), DayFragment.DeleteListener, ViewPager.OnPa
fillViewPager(mDayCode) fillViewPager(mDayCode)
day_fab.backgroundTintList = ColorStateList.valueOf(baseConfig.primaryColor)
day_fab.setOnClickListener { addNewEvent() } day_fab.setOnClickListener { addNewEvent() }
updateTextColors(day_coordinator)
} }
override fun onPause() { override fun onPause() {

View File

@ -14,10 +14,7 @@ import com.simplemobiletools.calendar.extensions.scheduleNotification
import com.simplemobiletools.calendar.helpers.* import com.simplemobiletools.calendar.helpers.*
import com.simplemobiletools.calendar.models.Event import com.simplemobiletools.calendar.models.Event
import com.simplemobiletools.commons.dialogs.ConfirmationDialog import com.simplemobiletools.commons.dialogs.ConfirmationDialog
import com.simplemobiletools.commons.extensions.hideKeyboard import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.extensions.showKeyboard
import com.simplemobiletools.commons.extensions.toast
import com.simplemobiletools.commons.extensions.value
import kotlinx.android.synthetic.main.activity_event.* import kotlinx.android.synthetic.main.activity_event.*
import org.joda.time.DateTime import org.joda.time.DateTime
import org.joda.time.DateTimeZone import org.joda.time.DateTimeZone
@ -79,6 +76,7 @@ class EventActivity : SimpleActivity(), DBHelper.EventUpdateListener {
reminderItemSelected() reminderItemSelected()
} }
} }
updateTextColors(event_scrollview)
} }
private fun setupEditEvent() { private fun setupEditEvent() {

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.calendar.activities package com.simplemobiletools.calendar.activities
import android.content.Intent import android.content.Intent
import android.content.res.ColorStateList
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.support.design.widget.Snackbar import android.support.design.widget.Snackbar
@ -18,6 +17,7 @@ import com.simplemobiletools.calendar.extensions.updateWidgets
import com.simplemobiletools.calendar.fragments.EventListFragment import com.simplemobiletools.calendar.fragments.EventListFragment
import com.simplemobiletools.calendar.helpers.* import com.simplemobiletools.calendar.helpers.*
import com.simplemobiletools.calendar.helpers.Formatter import com.simplemobiletools.calendar.helpers.Formatter
import com.simplemobiletools.commons.extensions.updateTextColors
import com.simplemobiletools.commons.helpers.LICENSE_AMBILWARNA import com.simplemobiletools.commons.helpers.LICENSE_AMBILWARNA
import com.simplemobiletools.commons.helpers.LICENSE_JODA import com.simplemobiletools.commons.helpers.LICENSE_JODA
import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN import com.simplemobiletools.commons.helpers.LICENSE_KOTLIN
@ -46,7 +46,7 @@ class MainActivity : SimpleActivity(), EventListFragment.DeleteListener {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
updateWidgets() updateWidgets()
calendar_fab.backgroundTintList = ColorStateList.valueOf(baseConfig.primaryColor) updateTextColors(calendar_coordinator)
} }
override fun onPause() { override fun onPause() {

View File

@ -169,16 +169,16 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
week_num.visibility = View.VISIBLE week_num.visibility = View.VISIBLE
for (i in 0..5) { for (i in 0..5) {
val weekIdTV = findViewById(mRes.getIdentifier("week_num_" + i, "id", mPackageName)) as TextView? (findViewById(mRes.getIdentifier("week_num_$i", "id", mPackageName)) as TextView).apply {
weekIdTV!!.text = mDays!![i * 7].weekOfYear.toString() + ":" text = "${mDays!![i * 7].weekOfYear}:"
weekIdTV.setTextColor(mWeakTextColor) setTextColor(mWeakTextColor)
weekIdTV.visibility = View.VISIBLE visibility = View.VISIBLE
}
} }
} }
for (i in 0..len - 1) { for (i in 0..len - 1) {
val day = mDays!![i] val day = mDays!![i]
val dayTV = findViewById(mRes.getIdentifier("day_" + i, "id", mPackageName)) as TextView?
var curTextColor = mWeakTextColor var curTextColor = mWeakTextColor
var curTextSize = mDayTextSize var curTextSize = mDayTextSize
@ -190,9 +190,11 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
curTextSize = mTodayTextSize curTextSize = mTodayTextSize
} }
dayTV!!.text = day.value.toString() (findViewById(mRes.getIdentifier("day_$i", "id", mPackageName)) as TextView).apply {
dayTV.setTextColor(curTextColor) text = day.value.toString()
dayTV.textSize = curTextSize setTextColor(curTextColor)
textSize = curTextSize
}
} }
} }
@ -225,9 +227,10 @@ class WidgetMonthlyConfigureActivity : AppCompatActivity(), MonthlyCalendar {
private fun updateLabels() { private fun updateLabels() {
for (i in 0..6) { for (i in 0..6) {
val dayTV = findViewById(mRes.getIdentifier("label_" + i, "id", mPackageName)) as TextView? (findViewById(mRes.getIdentifier("label_$i", "id", mPackageName)) as TextView).apply {
dayTV!!.textSize = mDayTextSize textSize = mDayTextSize
dayTV.setTextColor(mTextColor) setTextColor(mTextColor)
}
} }
} }
} }

View File

@ -12,7 +12,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="@dimen/activity_margin"/> android:layout_marginTop="@dimen/activity_margin"/>
<android.support.design.widget.FloatingActionButton <com.simplemobiletools.commons.views.MyFloatingActionButton
android:id="@+id/day_fab" android:id="@+id/day_fab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -17,7 +17,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone"/> android:visibility="gone"/>
<android.support.design.widget.FloatingActionButton <com.simplemobiletools.commons.views.MyFloatingActionButton
android:id="@+id/calendar_fab" android:id="@+id/calendar_fab"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"