mirror of https://github.com/tuskyapp/Tusky.git
Browse Source
Follow up to https://github.com/tuskyapp/Tusky/pull/3921 - no more hardcoded `tusky_blue`, instead the `colorPrimary` attribute is used. This will help us when adding more themes, e.g a dynamic color one. - The `colorPrimary` of the dark theme is now lighter for more contrast and subsequently the `colorOnPrimary` is now dark grey instead of white. - `tusky_red_lighter` is now a bit more red than before - Tweaked color usage in a few places for better contrast I think this looks a bit unfamiliar but overall better and the higher contrast makes things noticeably easier to read. <img src="https://github.com/tuskyapp/Tusky/assets/10157047/4cbb92d8-b772-4e94-bc15-c4baf0e5473f" width="260"/>pull/4525/head
68 changed files with 271 additions and 232 deletions
@ -0,0 +1,37 @@
|
||||
/* Copyright 2024 Tusky contributors |
||||
* |
||||
* This file is a part of Tusky. |
||||
* |
||||
* This program is free software; you can redistribute it and/or modify it under the terms of the |
||||
* GNU General Public License as published by the Free Software Foundation; either version 3 of the |
||||
* License, or (at your option) any later version. |
||||
* |
||||
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
||||
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
||||
* Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License along with Tusky; if not, |
||||
* see <http://www.gnu.org/licenses>. */ |
||||
package com.keylesspalace.tusky.view |
||||
|
||||
import android.content.Context |
||||
import android.util.AttributeSet |
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout |
||||
import com.google.android.material.R as materialR |
||||
import com.google.android.material.color.MaterialColors |
||||
|
||||
/** |
||||
* SwipeRefreshLayout does not allow theming of the color scheme, |
||||
* so we use this class to still have a single point to change its colors. |
||||
*/ |
||||
class TuskySwipeRefreshLayout @JvmOverloads constructor( |
||||
context: Context, |
||||
attrs: AttributeSet? = null |
||||
) : SwipeRefreshLayout(context, attrs) { |
||||
|
||||
init { |
||||
setColorSchemeColors( |
||||
MaterialColors.getColor(this, materialR.attr.colorPrimary) |
||||
) |
||||
} |
||||
} |
||||
@ -1,6 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<!-- attr not working here for Android 5? --> |
||||
<item android:state_checked="false" android:color="@color/textColorTertiary"/> |
||||
<item android:state_checked="true" android:color="@color/tusky_blue"/> |
||||
</selector> |
||||
<item android:state_checked="false" android:color="?android:attr/textColorTertiary"/> |
||||
<item android:state_checked="true" android:color="?attr/colorPrimary"/> |
||||
</selector> |
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<item android:state_focused="false" android:color="?android:attr/textColorTertiary"/> |
||||
<item android:state_focused="true" android:color="@color/tusky_blue"/> |
||||
</selector> |
||||
<item android:state_focused="true" android:color="?attr/colorPrimary"/> |
||||
</selector> |
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> |
||||
<solid android:color="@color/tusky_blue" /> |
||||
</shape> |
||||
<solid android:color="?attr/colorPrimary" /> |
||||
</shape> |
||||
|
||||
Loading…
Reference in new issue