fedilab-Android-App/app/src/main/java/app/fedilab/android/helper/ThemeHelper.java

31 lines
1.1 KiB
Java
Raw Normal View History

2019-11-07 18:57:05 +01:00
package app.fedilab.android.helper;
2020-05-16 11:32:09 +02:00
/* Copyright 2019 Thomas Schneider
*
* This file is a part of Fedilab
*
* 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.
*
* Fedilab 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 Fedilab; if not,
* see <http://www.gnu.org/licenses>. */
2019-11-08 18:05:35 +01:00
2019-11-07 19:07:19 +01:00
import android.content.Context;
import android.content.res.Resources;
import android.util.TypedValue;
2019-11-07 18:57:05 +01:00
public class ThemeHelper {
2019-11-15 16:32:25 +01:00
public static int getAttColor(Context context, int attColor) {
2019-11-07 19:07:19 +01:00
TypedValue typedValue = new TypedValue();
Resources.Theme theme = context.getTheme();
theme.resolveAttribute(attColor, typedValue, true);
return typedValue.data;
2019-11-07 18:57:05 +01:00
}
}