• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Navigation voice changer app for Android


Commit MetaInfo

Revision8e70b2c02c9746d05b8f3cf52a13a344752b5afc (tree)
Time2013-08-05 21:13:33
AuthorHMML <hmml3939@gmai...>
CommiterHMML

Log Message

Show rating and download count on list.

Change Summary

Incremental Difference

--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -53,4 +53,7 @@
5353 <string name="dlopt_order_dlcount">ダウンロード回数</string>
5454 <string name="apply">適用</string>
5555 <string name="dllist_opts_title">リストオプション</string>
56+ <string name="author_">作者:</string>
57+ <string name="downloads_">ダウンロード数:</string>
58+ <string name="anonymous">(匿名)</string>
5659 </resources>
\ No newline at end of file
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -55,5 +55,8 @@
5555 <string name="dlopt_order_dlcount">By download count</string>
5656 <string name="apply">Apply</string>
5757 <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>
5861
5962 </resources>
--- a/src/jp/nekoteki/android/navivoicechanger/DownloadActivity.java
+++ b/src/jp/nekoteki/android/navivoicechanger/DownloadActivity.java
@@ -34,6 +34,7 @@ import android.widget.EditText;
3434 import android.widget.LinearLayout;
3535 import android.widget.ListView;
3636 import android.widget.RadioButton;
37+import android.widget.RatingBar;
3738 import android.widget.RelativeLayout;
3839 import android.widget.TextView;
3940 import android.widget.Toast;
@@ -198,38 +199,56 @@ public class DownloadActivity extends Activity {
198199 title.setTextSize(16);
199200 textlayout.addView(title);
200201
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+
205236 container.addView(textlayout);
206237
207238 TextView downloaded = new TextView(context);
208239 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);
210241 dmark.setBounds(0, 0, 20, 20);
211242 downloaded.setCompoundDrawables(dmark, null, null, null);
212243 RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
213244 lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
214245 lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
215246 downloaded.setLayoutParams(lp);
247+ downloaded.setBackgroundColor(Color.GRAY);
248+ downloaded.setTextSize(1);
216249 container.addView(downloaded);
217250 }
218251
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-
233252 container.setPadding(0, 5, 0, 5);
234253 return container;
235254 }
--- a/src/jp/nekoteki/android/navivoicechanger/RemoteVoiceData.java
+++ b/src/jp/nekoteki/android/navivoicechanger/RemoteVoiceData.java
@@ -31,6 +31,7 @@ public class RemoteVoiceData {
3131 private String author;
3232 private String description;
3333 private VoiceData voice_data;
34+ private int dlcount;
3435
3536 public VoiceData getVoiceData() {
3637 return voice_data;
@@ -179,4 +180,10 @@ public class RemoteVoiceData {
179180 player.start();
180181 }
181182 }
183+ public int getDlcount() {
184+ return dlcount;
185+ }
186+ public void setDlcount(int dlcount) {
187+ this.dlcount = dlcount;
188+ }
182189 }