aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/ui/CacheDetailsCreator.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2012-12-19 13:09:17 -0800
committerSamuel Tardieu <sam@rfc1149.net>2012-12-19 13:09:17 -0800
commitf14a6ed137407a347873b7e4860064e761d47708 (patch)
tree30f520418e24936b441cbb3f892ca1a97818300f /main/src/cgeo/geocaching/ui/CacheDetailsCreator.java
parentdf330315f2a5af1950f56f647a8c94c9c606b4a3 (diff)
parent5b2bcc270c832f8ab76b0243e43bdeaf52b2294d (diff)
downloadcgeo-f14a6ed137407a347873b7e4860064e761d47708.zip
cgeo-f14a6ed137407a347873b7e4860064e761d47708.tar.gz
cgeo-f14a6ed137407a347873b7e4860064e761d47708.tar.bz2
Merge pull request #2279 from samueltardieu/better-attributes
Use better aligned attributes in cache description
Diffstat (limited to 'main/src/cgeo/geocaching/ui/CacheDetailsCreator.java')
-rw-r--r--main/src/cgeo/geocaching/ui/CacheDetailsCreator.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/main/src/cgeo/geocaching/ui/CacheDetailsCreator.java b/main/src/cgeo/geocaching/ui/CacheDetailsCreator.java
index 2a83ddc..9745d63 100644
--- a/main/src/cgeo/geocaching/ui/CacheDetailsCreator.java
+++ b/main/src/cgeo/geocaching/ui/CacheDetailsCreator.java
@@ -35,7 +35,7 @@ public final class CacheDetailsCreator {
}
public TextView add(final int nameId, final CharSequence value) {
- final RelativeLayout layout = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.cache_item, null);
+ final RelativeLayout layout = (RelativeLayout) activity.getLayoutInflater().inflate(R.layout.cache_layout, null);
final TextView nameView = (TextView) layout.findViewById(R.id.name);
nameView.setText(res.getString(nameId));
lastValueView = (TextView) layout.findViewById(R.id.value);
@@ -56,16 +56,15 @@ public final class CacheDetailsCreator {
nameView.setText(activity.getResources().getString(nameId));
lastValueView.setText(String.format("%.1f", value) + ' ' + activity.getResources().getString(R.string.cache_rating_of) + " 5");
- layoutStars.addView(createStarImages(value), 1);
+ createStarImages(layoutStars, value);
+ layoutStars.setVisibility(View.VISIBLE);
parentView.addView(layout);
return layout;
}
- private LinearLayout createStarImages(final float value) {
+ private void createStarImages(final ViewGroup starsContainer, final float value) {
final LayoutInflater inflater = LayoutInflater.from(activity);
- final LinearLayout starsContainer = new LinearLayout(activity);
- starsContainer.setOrientation(LinearLayout.HORIZONTAL);
for (int i = 0; i < 5; i++) {
ImageView star = (ImageView) inflater.inflate(R.layout.star, null);
@@ -78,8 +77,6 @@ public final class CacheDetailsCreator {
}
starsContainer.addView(star);
}
-
- return starsContainer;
}
public void addCacheState(cgCache cache) {