Created
July 21, 2016 09:27
-
-
Save vmax/fa9dea7e5ee6b92fef9971ee79b546df to your computer and use it in GitHub Desktop.
Class that helps converting Moscow Subway line names (in Russian) to their colors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import android.graphics.Color; | |
import android.support.annotation.ColorInt; | |
/** | |
* Class that helps converting Moscow Subway line names (in Russian) to their colors | |
* Based on https://en.wikipedia.org/wiki/Moscow_Metro#Lines | |
*/ | |
public class MoscowSubwayLineUtil { | |
static HashMap<String, Integer> colors; | |
static | |
{ | |
colors = new HashMap<>(); | |
colors.put("Сокольническая", Color.parseColor("#ED1B35")); | |
colors.put("Замоскворецкая", Color.parseColor("#44B85C")); | |
colors.put("Арбатско-Покровская",Color.parseColor("#0078BF")); | |
colors.put("Филевская",Color.parseColor("#19C1F3")); | |
colors.put("Кольцевая",Color.parseColor("#894E35")); | |
colors.put("Калужско-Рижская",Color.parseColor("#F58631")); | |
colors.put("Таганско-Краснопресненская",Color.parseColor("#8E479C")); | |
colors.put("Калининско-Солнцевская",Color.parseColor("#FFCB31")); | |
colors.put("Серпуховско-Тимирязевская",Color.parseColor("#A1A2A3")); | |
colors.put("Люблинско-Дмитровская",Color.parseColor("#B3D445")); | |
colors.put("Каховская",Color.parseColor("#79CDCD")); | |
colors.put("Бутовская",Color.parseColor("#ACBFE1")); | |
colors.put("Монорельс",Color.parseColor("#2C87C5")); | |
} | |
/** | |
* Get the line's color on scheme | |
* @param lineName Subway line name in Russian | |
* @return color of the line | |
*/ | |
@ColorInt | |
public static int lineToColor(String lineName) | |
{ | |
return colors.get(lineName); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment