adjustments for layout. Use accent color to color current programme.
parent
81f53966f0
commit
691edeee17
|
|
@ -122,11 +122,12 @@ class MainActivity : BaseActivity() {
|
||||||
RadioAlarm.instance.setNextAlarm(c = this) // this checks the preferenceStore before actually setting an alarm, don't worry.
|
RadioAlarm.instance.setNextAlarm(c = this) // this checks the preferenceStore before actually setting an alarm, don't worry.
|
||||||
|
|
||||||
// initialize programmatically accessible colors
|
// initialize programmatically accessible colors
|
||||||
colorBlue = ResourcesCompat.getColor(resources, R.color.bluereq, null)
|
colorBlue = ResourcesCompat.getColor(resources, R.color.rblue, null)
|
||||||
colorWhited = ResourcesCompat.getColor(resources, R.color.whited, null)
|
colorWhited = ResourcesCompat.getColor(resources, R.color.whited, null)
|
||||||
colorGreenList = (ResourcesCompat.getColorStateList(resources, R.color.button_green, null))
|
colorGreenList = (ResourcesCompat.getColorStateList(resources, R.color.button_green, null))
|
||||||
colorRedList = (ResourcesCompat.getColorStateList(resources, R.color.button_red, null))
|
colorRedList = (ResourcesCompat.getColorStateList(resources, R.color.button_red, null))
|
||||||
colorGreenListCompat = (ResourcesCompat.getColorStateList(resources, R.color.button_green_compat, null))
|
colorGreenListCompat = (ResourcesCompat.getColorStateList(resources, R.color.button_green_compat, null))
|
||||||
|
colorAccent = (ResourcesCompat.getColor(resources, R.color.colorAccent, null))
|
||||||
|
|
||||||
// Post-UI Launch
|
// Post-UI Launch
|
||||||
if (PlayerStore.instance.isInitialized)
|
if (PlayerStore.instance.isInitialized)
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ val weekdaysSundayFirst = ArrayList<String>().apply {
|
||||||
|
|
||||||
var colorBlue: Int = 0
|
var colorBlue: Int = 0
|
||||||
var colorWhited: Int = 0
|
var colorWhited: Int = 0
|
||||||
|
var colorAccent : Int = 0
|
||||||
var colorGreenList: ColorStateList? = ColorStateList.valueOf(0)
|
var colorGreenList: ColorStateList? = ColorStateList.valueOf(0)
|
||||||
var colorRedList: ColorStateList? = ColorStateList.valueOf(0)
|
var colorRedList: ColorStateList? = ColorStateList.valueOf(0)
|
||||||
var colorGreenListCompat : ColorStateList? = ColorStateList.valueOf(0)
|
var colorGreenListCompat : ColorStateList? = ColorStateList.valueOf(0)
|
||||||
|
|
||||||
lateinit var preferenceStore : SharedPreferences
|
lateinit var preferenceStore : SharedPreferences
|
||||||
|
|
@ -1,17 +1,16 @@
|
||||||
package fr.forum_thalie.tsumugi.ui.programme
|
package fr.forum_thalie.tsumugi.ui.programme
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.util.TypedValue
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
import androidx.core.widget.TextViewCompat
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import fr.forum_thalie.tsumugi.R
|
import fr.forum_thalie.tsumugi.*
|
||||||
import fr.forum_thalie.tsumugi.colorBlue
|
|
||||||
import fr.forum_thalie.tsumugi.planning.Planning
|
import fr.forum_thalie.tsumugi.planning.Planning
|
||||||
import fr.forum_thalie.tsumugi.planning.Programme
|
import fr.forum_thalie.tsumugi.planning.Programme
|
||||||
import fr.forum_thalie.tsumugi.weekdays
|
|
||||||
import fr.forum_thalie.tsumugi.weekdaysSundayFirst
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.collections.ArrayList
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
|
|
@ -46,12 +45,17 @@ class ProgrammeAdapter(private val dataSet: ArrayList<Programme>, private val da
|
||||||
programmeName.text = dataSet[position].title
|
programmeName.text = dataSet[position].title
|
||||||
programmeEnd.text = dataSet[position].end()
|
programmeEnd.text = dataSet[position].end()
|
||||||
|
|
||||||
if (dataSet[position].isCurrent() && (Calendar.getInstance(Planning.instance.timeZone).get(Calendar.DAY_OF_WEEK) - 1 == weekdaysSundayFirst.indexOf(day)))
|
val color = if (dataSet[position].isCurrent() && (Calendar.getInstance(Planning.instance.timeZone).get(Calendar.DAY_OF_WEEK) - 1 == weekdaysSundayFirst.indexOf(day)))
|
||||||
{
|
colorAccent
|
||||||
programmeStart.setTextColor(colorBlue)
|
else
|
||||||
programmeEnd.setTextColor(colorBlue)
|
colorWhited
|
||||||
programmeName.setTextColor(colorBlue)
|
|
||||||
}
|
programmeStart.setTextColor(color)
|
||||||
|
programmeEnd.setTextColor(color)
|
||||||
|
programmeName.setTextColor(color)
|
||||||
|
|
||||||
|
//TextViewCompat.setAutoSizeTextTypeUniformWithConfiguration(
|
||||||
|
// programmeName,8, 16, 2, TypedValue.COMPLEX_UNIT_SP)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the size of your dataset (invoked by the layout manager)
|
// Return the size of your dataset (invoked by the layout manager)
|
||||||
|
|
|
||||||
|
|
@ -4,30 +4,32 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
android:orientation="vertical" android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginEnd="12dp">
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/hours"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
|
>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/programme_start"
|
android:id="@+id/programme_start"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/programme_end"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
/>
|
android:textColor="@color/whited"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
<TextView
|
|
||||||
android:id="@+id/programme_name"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/programme_start"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/programme_end"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/programme_start"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:gravity="center"
|
|
||||||
android:textAlignment="center"
|
|
||||||
android:textSize="16sp"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
@ -35,18 +37,42 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toBottomOf="@id/programme_start"
|
app:layout_constraintTop_toBottomOf="@id/programme_start"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="@id/programme_start"
|
app:layout_constraintStart_toStartOf="@id/programme_start"
|
||||||
android:gravity="start"
|
android:gravity="start"
|
||||||
|
android:textColor="@color/whited"
|
||||||
|
app:layout_constraintVertical_chainStyle="packed"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/programme_name"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minHeight="32sp"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/hours"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/hours"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/hours"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:layout_marginStart="32dp"
|
||||||
|
android:layout_marginLeft="32dp"
|
||||||
|
android:textColor="@color/whited"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/divider"
|
android:id="@+id/divider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:background="?android:attr/listDivider"
|
android:background="?android:attr/listDivider"
|
||||||
app:layout_constraintTop_toBottomOf="@id/programme_end"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"/>
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginEnd="12dp"
|
android:layout_marginEnd="8dp"
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
<color name="whited3">#999999</color>
|
<color name="whited3">#999999</color>
|
||||||
<color name="whited4">#999999</color>
|
<color name="whited4">#999999</color>
|
||||||
<color name="whited5">#7F7F7F</color>
|
<color name="whited5">#7F7F7F</color>
|
||||||
<color name="rblue">#3A7AAF</color>
|
<color name="rblue">#4FC3F7</color>
|
||||||
<color name="bluereq">#527a8e</color>
|
<color name="bluereq">#527a8e</color>
|
||||||
<color name="blueTitle">#527a8e</color>
|
<color name="blueTitle">#527a8e</color>
|
||||||
<color name="reqButtonPressed">#5cb85c</color>
|
<color name="reqButtonPressed">#5cb85c</color>
|
||||||
|
|
@ -19,12 +19,12 @@
|
||||||
<color name="reqButtonDisabled">#a15755</color>
|
<color name="reqButtonDisabled">#a15755</color>
|
||||||
|
|
||||||
<color name="seek_bar_background">#585858</color>
|
<color name="seek_bar_background">#585858</color>
|
||||||
<color name="seek_bar_progress">#DF4C3A</color>
|
<color name="seek_bar_progress">#f58b01</color>
|
||||||
<color name="seek_bar_secondary_progress">#3A7AAF</color>
|
<color name="seek_bar_secondary_progress">#4FC3F7</color>
|
||||||
|
|
||||||
<color name="progress_bar_background">#585858</color>
|
<color name="progress_bar_background">#585858</color>
|
||||||
<color name="progress_bar_progress">#3A7AAF</color>
|
<color name="progress_bar_progress">#4FC3F7</color>
|
||||||
<color name="progress_bar_secondary_progress">#DF4C3A</color>
|
<color name="progress_bar_secondary_progress">#f58b01</color>
|
||||||
|
|
||||||
<color name="white">#FFFFFF</color>
|
<color name="white">#FFFFFF</color>
|
||||||
<color name="black">#000000</color>
|
<color name="black">#000000</color>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue