Navigation voice changer app for Android
Revision | 8e70b2c02c9746d05b8f3cf52a13a344752b5afc (tree) |
---|---|
Time | 2013-08-05 21:13:33 |
Author | ![]() |
Commiter | HMML |
Show rating and download count on list.
@@ -53,4 +53,7 @@ | ||
53 | 53 | <string name="dlopt_order_dlcount">ダウンロード回数</string> |
54 | 54 | <string name="apply">適用</string> |
55 | 55 | <string name="dllist_opts_title">リストオプション</string> |
56 | + <string name="author_">作者:</string> | |
57 | + <string name="downloads_">ダウンロード数:</string> | |
58 | + <string name="anonymous">(匿名)</string> | |
56 | 59 | </resources> |
\ No newline at end of file |
@@ -55,5 +55,8 @@ | ||
55 | 55 | <string name="dlopt_order_dlcount">By download count</string> |
56 | 56 | <string name="apply">Apply</string> |
57 | 57 | <string name="dllist_opts_title">List options</string> |
58 | + <string name="author_">Author:</string> | |
59 | + <string name="downloads_">Downloads:</string> | |
60 | + <string name="anonymous">(Anonymous)</string> | |
58 | 61 | |
59 | 62 | </resources> |
@@ -34,6 +34,7 @@ import android.widget.EditText; | ||
34 | 34 | import android.widget.LinearLayout; |
35 | 35 | import android.widget.ListView; |
36 | 36 | import android.widget.RadioButton; |
37 | +import android.widget.RatingBar; | |
37 | 38 | import android.widget.RelativeLayout; |
38 | 39 | import android.widget.TextView; |
39 | 40 | import android.widget.Toast; |
@@ -198,38 +199,56 @@ public class DownloadActivity extends Activity { | ||
198 | 199 | title.setTextSize(16); |
199 | 200 | textlayout.addView(title); |
200 | 201 | |
201 | - TextView description = new TextView(context); | |
202 | - description.setTextSize(12); | |
203 | - description.setText(rvd.getDescription()); | |
204 | - textlayout.addView(description); | |
202 | + if (rvd.getAuthor() != null && !rvd.getAuthor().equals("")) { | |
203 | + TextView author = new TextView(context); | |
204 | + author.setTextSize(14); | |
205 | + author.setText(getResources().getString(R.string.author_)+" "+rvd.getAuthor()); | |
206 | + textlayout.addView(author); | |
207 | + } | |
208 | + | |
209 | + LinearLayout infoline = new LinearLayout(context); | |
210 | + infoline.setOrientation(LinearLayout.HORIZONTAL); | |
211 | + if (rvd.getRating() > 0) { | |
212 | + RatingBar rating = new RatingBar(context, null, android.R.attr.ratingBarStyleSmall); | |
213 | + rating.setMax(5); | |
214 | + rating.setNumStars(5); | |
215 | + rating.setRating(rvd.getRating()); | |
216 | + infoline.addView(rating); | |
217 | + } | |
218 | + | |
219 | + if (rvd.getDlcount() > 0) { | |
220 | + TextView downloads = new TextView(context); | |
221 | + downloads.setTextSize(12); | |
222 | + downloads.setText(getResources().getString(R.string.downloads_) + " " + Integer.toString(rvd.getDlcount())); | |
223 | + downloads.setPadding(10, 0, 0, 0); | |
224 | + infoline.addView(downloads); | |
225 | + } | |
226 | + | |
227 | + textlayout.addView(infoline); | |
228 | + | |
229 | + if (rvd.getDescription() != null && !rvd.getDescription().equals("")) { | |
230 | + TextView description = new TextView(context); | |
231 | + description.setTextSize(12); | |
232 | + description.setText(rvd.getDescription()); | |
233 | + textlayout.addView(description); | |
234 | + } | |
235 | + | |
205 | 236 | container.addView(textlayout); |
206 | 237 | |
207 | 238 | TextView downloaded = new TextView(context); |
208 | 239 | if (rvd.isDownloaded()) { |
209 | - Drawable dmark = getResources().getDrawable(android.R.drawable.checkbox_on_background); | |
240 | + Drawable dmark = getResources().getDrawable(android.R.drawable.stat_sys_download_done); | |
210 | 241 | dmark.setBounds(0, 0, 20, 20); |
211 | 242 | downloaded.setCompoundDrawables(dmark, null, null, null); |
212 | 243 | RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); |
213 | 244 | lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); |
214 | 245 | lp.addRule(RelativeLayout.ALIGN_PARENT_TOP); |
215 | 246 | downloaded.setLayoutParams(lp); |
247 | + downloaded.setBackgroundColor(Color.GRAY); | |
248 | + downloaded.setTextSize(1); | |
216 | 249 | container.addView(downloaded); |
217 | 250 | } |
218 | 251 | |
219 | - TextView author = new TextView(context); | |
220 | - if (rvd.getAuthor() != null && !rvd.getAuthor().equals("")) { | |
221 | - author.setTextSize(14); | |
222 | - author.setText("By "+rvd.getAuthor()); | |
223 | - RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); | |
224 | - lp.addRule(RelativeLayout.ALIGN_PARENT_TOP); | |
225 | - lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); | |
226 | - if (rvd.isDownloaded()) { | |
227 | - lp.setMargins(0, 0, 22, 0); | |
228 | - } | |
229 | - author.setLayoutParams(lp); | |
230 | - container.addView(author); | |
231 | - } | |
232 | - | |
233 | 252 | container.setPadding(0, 5, 0, 5); |
234 | 253 | return container; |
235 | 254 | } |
@@ -31,6 +31,7 @@ public class RemoteVoiceData { | ||
31 | 31 | private String author; |
32 | 32 | private String description; |
33 | 33 | private VoiceData voice_data; |
34 | + private int dlcount; | |
34 | 35 | |
35 | 36 | public VoiceData getVoiceData() { |
36 | 37 | return voice_data; |
@@ -179,4 +180,10 @@ public class RemoteVoiceData { | ||
179 | 180 | player.start(); |
180 | 181 | } |
181 | 182 | } |
183 | + public int getDlcount() { | |
184 | + return dlcount; | |
185 | + } | |
186 | + public void setDlcount(int dlcount) { | |
187 | + this.dlcount = dlcount; | |
188 | + } | |
182 | 189 | } |