Added some text styles for the future.

This commit is contained in:
Robert Kolner committed 2011-09-21 17:43:06 +02:00
1 parent 3dfb28a80b
commit cdafbf2258
3 files changed
+22 -11

No files matched your search

-1
View File
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/ListItem"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
+11 -4
View File
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- EVENT VIEW STYLES: -->
<style name="BigHeader">
<item name="android:textSize">20sp</item>
<item name="android:gravity">center</item>
@@ -12,10 +13,16 @@
<item name="android:paddingBottom">5px</item>
</style>
<style name="ListItem">
<item name="android:textSize">12sp</item>
<!-- EVENT LIST STYLES: -->
<color name="ListItemBackgroundEven">#202020</color>
<style name="ListItemTextEven" parent="@android:style/TextAppearance">
<item name="android:textColor">#cccccc</item>
</style>
<color name="ListItemEven">#202020</color>
<color name="ListItemOdd">#000000</color>
<color name="ListItemBackgroundOdd">#000000</color>
<style name="ListItemTextOdd" parent="@android:style/TextAppearance">
<item name="android:textColor">#cccccc</item>
</style>
</resources>
@@ -67,12 +67,6 @@ public class ProgramListActivity extends BaseDnsActivity {
} else {
row = convertView;
}
/* Apply styles: */
if (position % 2 == 0)
row.setBackgroundResource(R.color.ListItemEven);
else
row.setBackgroundResource(R.color.ListItemOdd);
final Event e = getItem(position);
@@ -92,6 +86,17 @@ public class ProgramListActivity extends BaseDnsActivity {
}
});
/* Apply styles: */
if (position % 2 == 0) {
row.setBackgroundResource(R.color.ListItemBackgroundEven);
titleView.setTextAppearance(ProgramListActivity.this, R.style.ListItemTextEven);
dateView.setTextAppearance(ProgramListActivity.this, R.style.ListItemTextEven);
} else {
row.setBackgroundResource(R.color.ListItemBackgroundOdd);
titleView.setTextAppearance(ProgramListActivity.this, R.style.ListItemTextOdd);
dateView.setTextAppearance(ProgramListActivity.this, R.style.ListItemTextOdd);
}
return row;
}
};