From f9c3bc6bf6cee930f32ef0fa1dc1573bd45304a7 Mon Sep 17 00:00:00 2001 From: Zukero Date: Mon, 6 Nov 2017 23:53:40 +0100 Subject: [PATCH] Color palette in resources. Conversation activity uses it now. Preferences category headers fixed. --- .../color/ui_blue_textbutton_textcolor.xml | 16 +- AndorsTrail/res/values-v14/ui_styles.xml | 123 ++--- AndorsTrail/res/values/ui_colors.xml | 46 +- AndorsTrail/res/values/ui_styles.xml | 422 +++++++++--------- .../activity/ConversationActivity.java | 30 +- 5 files changed, 352 insertions(+), 285 deletions(-) diff --git a/AndorsTrail/res/color/ui_blue_textbutton_textcolor.xml b/AndorsTrail/res/color/ui_blue_textbutton_textcolor.xml index 602b946b6..3e34505be 100644 --- a/AndorsTrail/res/color/ui_blue_textbutton_textcolor.xml +++ b/AndorsTrail/res/color/ui_blue_textbutton_textcolor.xml @@ -1,8 +1,8 @@ - - - - - - - - + + + + + + + + diff --git a/AndorsTrail/res/values-v14/ui_styles.xml b/AndorsTrail/res/values-v14/ui_styles.xml index 7d3b6454c..0a5904f4e 100644 --- a/AndorsTrail/res/values-v14/ui_styles.xml +++ b/AndorsTrail/res/values-v14/ui_styles.xml @@ -1,55 +1,70 @@ - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/AndorsTrail/res/values/ui_colors.xml b/AndorsTrail/res/values/ui_colors.xml index aa4019bd2..186ef15d1 100644 --- a/AndorsTrail/res/values/ui_colors.xml +++ b/AndorsTrail/res/values/ui_colors.xml @@ -1,5 +1,47 @@ - #122438 - #122438 + + + + + #122438 + #2e4464 + #4a6390 + + #5e5e5e + #8c8c8c + #b9b9b9 + + #b0b0b0 + #dadada + #ededed + #fcfcfc + + #c98e00 + #ffb400 + + #a2a21d + #bbbb22 + + #1e8f9c + #5ee3f1 + + + + @color/ui_blue_palette_blue_dark + @color/ui_blue_palette_blue_dark + + + + @color/ui_blue_palette_orange_dark + @color/ui_blue_palette_orange_light + + @color/ui_blue_palette_mustard_dark + @color/ui_blue_palette_mustard_light + + @color/ui_blue_palette_cyan_dark + @color/ui_blue_palette_cyan_light + + @color/ui_blue_palette_text_gray_mid + @color/ui_blue_palette_text_gray_light diff --git a/AndorsTrail/res/values/ui_styles.xml b/AndorsTrail/res/values/ui_styles.xml index 4b3687b87..26fb5c33b 100644 --- a/AndorsTrail/res/values/ui_styles.xml +++ b/AndorsTrail/res/values/ui_styles.xml @@ -1,204 +1,220 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/ConversationActivity.java b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/ConversationActivity.java index ad08e7a72..0b0d87819 100644 --- a/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/ConversationActivity.java +++ b/AndorsTrail/src/com/gpl/rpg/AndorsTrail/activity/ConversationActivity.java @@ -48,16 +48,6 @@ public final class ConversationActivity implements OnKeyListener , ConversationController.ConversationStatemachine.ConversationStateListener { - private static final int playerNameColor = Color.argb(255, 0xbb, 0x22, 0x22); - private static final int NPCNameColor = Color.argb(255, 0xbb, 0xbb, 0x22); - private static final int playerPhraseColor = Color.argb(255, 0xff, 0xff, 0xff); - private static final int NPCPhraseColor = Color.argb(255, 0xff, 0xff, 0xff); - private static final int rewardColor = Color.argb(255, 0x99, 0x99, 0x55); - private static final int oldPhraseColor = Color.argb(255, 0xb0, 0xb0, 0xb0); - private static final int oldPlayerNameColor = Color.argb(255, 0x89, 0x19, 0x19); - private static final int oldNPCNameColor = Color.argb(255, 0xa2, 0xa2, 0x1d); - private static final int oldRewardColor = Color.argb(255, 0x7a, 0x7a, 0x44); - private WorldContext world; private Player player; private final ArrayList conversationHistory = new ArrayList(); @@ -223,14 +213,14 @@ public final class ConversationActivity while(numberOfNewMessage != 0){ ConversationStatement conversation = conversationHistory.get(numberOfMessage - numberOfNewMessage); if(conversation.hasActor()){ - conversation.textColor = oldPhraseColor; + conversation.textColor = getSpanColor(R.color.ui_blue_dialogue_dark); if(conversation.isPlayerActor){ - conversation.nameColor = oldPlayerNameColor; + conversation.nameColor = getSpanColor(R.color.ui_blue_playername_light); } else { - conversation.nameColor = oldNPCNameColor; + conversation.nameColor = getSpanColor(R.color.ui_blue_npcname_dark); } }else{ - conversation.textColor = oldRewardColor; + conversation.textColor = getSpanColor(R.color.ui_blue_reward_light); } numberOfNewMessage--; } @@ -246,7 +236,7 @@ public final class ConversationActivity } else { if (rb == null) return; Reply r = (Reply) rb.getTag(); - addConversationStatement(player, rb.getText().toString(), playerPhraseColor); + addConversationStatement(player, rb.getText().toString(), getSpanColor(R.color.ui_blue_dialogue_light)); conversationState.playerSelectedReply(getResources(), r); } } @@ -260,7 +250,7 @@ public final class ConversationActivity s.iconID = ConversationStatement.NO_ICON; } s.text = text; - s.nameColor = actor == player ? playerNameColor : NPCNameColor; + s.nameColor = actor == player ? getSpanColor(R.color.ui_blue_playername_light) : getSpanColor(R.color.ui_blue_npcname_light); s.textColor = textColor; s.isPlayerActor = actor != null && actor == player; conversationHistory.add(s); @@ -381,7 +371,7 @@ public final class ConversationActivity @Override public void onTextPhraseReached(String message, Actor actor, String phraseID) { - addConversationStatement(actor, message, NPCPhraseColor); + addConversationStatement(actor, message, getSpanColor(R.color.ui_blue_dialogue_light)); } @Override @@ -417,7 +407,7 @@ public final class ConversationActivity } private void addRewardMessage(String text) { - addConversationStatement(null, text, rewardColor); + addConversationStatement(null, text, getSpanColor(R.color.ui_blue_reward_light)); } @Override @@ -461,4 +451,8 @@ public final class ConversationActivity rb.setFocusableInTouchMode(false); replyGroup.addView(rb, layoutParams); } + + private int getSpanColor(int resId) { + return getResources().getColor(resId); + } }