diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2017-01-28 22:29:46 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2017-01-28 22:29:46 +0900 |
commit | 5dcfe02b8b9214c3e15131bd15d025d33787cde5 (patch) | |
tree | 4ab088888a5d8a15979286c0aae038dd2a07908d | |
parent | 7461aa7513f57c80c06bce0828c450deceb30785 (diff) | |
download | SmileEssence-5dcfe02b8b9214c3e15131bd15d025d33787cde5.tar.gz |
Set themed color in XML
Only content text and footer text which aren't affected by other
conditions.
4 files changed, 4 insertions, 14 deletions
diff --git a/app/src/main/java/net/lacolaco/smileessence/viewmodel/EventViewModel.java b/app/src/main/java/net/lacolaco/smileessence/viewmodel/EventViewModel.java index 4ee609d1..6aa800a8 100644 --- a/app/src/main/java/net/lacolaco/smileessence/viewmodel/EventViewModel.java +++ b/app/src/main/java/net/lacolaco/smileessence/viewmodel/EventViewModel.java @@ -124,13 +124,9 @@ public class EventViewModel implements IViewModel { TextView content = (TextView) convertedView.findViewById(R.id.textview_status_text); content.setTextSize(textSize); - int colorNormal = Themes.getStyledColor(activity, R.attr.color_status_text_normal); - content.setTextColor(colorNormal); content.setText(isStatusEvent() ? targetObject.getText() : ""); TextView footer = (TextView) convertedView.findViewById(R.id.textview_status_footer); footer.setTextSize(textSize - 2); - int colorFooter = Themes.getStyledColor(activity, R.attr.color_status_text_footer); - footer.setTextColor(colorFooter); footer.setText(StringUtils.dateToString(getCreatedAt())); ImageView favorited = (ImageView) convertedView.findViewById(R.id.imageview_status_favorited); favorited.setVisibility(View.GONE); diff --git a/app/src/main/java/net/lacolaco/smileessence/viewmodel/MessageViewModel.java b/app/src/main/java/net/lacolaco/smileessence/viewmodel/MessageViewModel.java index 8f8927f0..5f3f083d 100644 --- a/app/src/main/java/net/lacolaco/smileessence/viewmodel/MessageViewModel.java +++ b/app/src/main/java/net/lacolaco/smileessence/viewmodel/MessageViewModel.java @@ -149,13 +149,9 @@ public class MessageViewModel implements IViewModel, IdObject { TextView content = (TextView) convertedView.findViewById(R.id.textview_status_text); content.setTextSize(textSize); - int colorNormal = Themes.getStyledColor(activity, R.attr.color_status_text_normal); - content.setTextColor(colorNormal); content.setText(directMessage.getText()); TextView footer = (TextView) convertedView.findViewById(R.id.textview_status_footer); footer.setTextSize(textSize - 2); - int colorFooter = Themes.getStyledColor(activity, R.attr.color_status_text_footer); - footer.setTextColor(colorFooter); footer.setText(getFooterText(Application.getInstance().getCurrentAccount())); } } diff --git a/app/src/main/java/net/lacolaco/smileessence/viewmodel/StatusViewModel.java b/app/src/main/java/net/lacolaco/smileessence/viewmodel/StatusViewModel.java index 36ce559e..a3cb8ec6 100644 --- a/app/src/main/java/net/lacolaco/smileessence/viewmodel/StatusViewModel.java +++ b/app/src/main/java/net/lacolaco/smileessence/viewmodel/StatusViewModel.java @@ -155,14 +155,10 @@ public class StatusViewModel implements IViewModel, IdObject { TextView content = (TextView) convertedView.findViewById(R.id.textview_status_text); content.setTextSize(textSize); - int colorNormal = Themes.getStyledColor(activity, R.attr.color_status_text_normal); - content.setTextColor(colorNormal); String rawText = tweet.getOriginalTweet().getText(); content.setText(rawText); TextView footer = (TextView) convertedView.findViewById(R.id.textview_status_footer); footer.setTextSize(textSize - 2); - int colorFooter = Themes.getStyledColor(activity, R.attr.color_status_text_footer); - footer.setTextColor(colorFooter); footer.setText(getFooterText()); diff --git a/app/src/main/res/layout/list_item_status.xml b/app/src/main/res/layout/list_item_status.xml index 81bc771b..e6d7fecd 100644 --- a/app/src/main/res/layout/list_item_status.xml +++ b/app/src/main/res/layout/list_item_status.xml @@ -53,7 +53,8 @@ android:layout_alignParentRight="true" android:layout_below="@+id/textview_status_header" android:layout_marginBottom="3dp" - android:layout_marginTop="1dp" /> + android:layout_marginTop="1dp" + android:textColor="?attr/color_status_text_normal" /> <TextView android:id="@+id/textview_status_footer" @@ -81,5 +82,6 @@ android:layout_alignLeft="@+id/textview_status_text" android:layout_below="@+id/textview_status_footer" android:layout_marginRight="1dp" - android:layout_marginTop="3dp" /> + android:layout_marginTop="3dp" + android:textColor="?attr/color_status_text_footer" /> </RelativeLayout>
\ No newline at end of file |