• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqtwindows誰得cocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Navigation voice changer app for Android


Commit MetaInfo

Revision3364084a4eaf04a31a07edcef04ba3c23886e3d2 (tree)
Time2013-07-31 05:21:11
AuthorHMML <hmml3939@gmai...>
CommiterHMML

Log Message

Improve list formatting.

Change Summary

Incremental Difference

--- a/assets/voicedata/test/voicedata.ini
+++ b/assets/voicedata/test/voicedata.ini
@@ -1,7 +1,8 @@
11 id=0
22 title=初音ミク (動作検証版)
3-description=動作検証用データです
3+description=動作検証用データです。
44 archive_md5=09678f469da207f29dd9803ba868fdc1
55 lang=ja
66 unit=metric
77 version=1
8+author=@gull08
--- a/src/jp/nekoteki/android/navivoicechanger/DownloadActivity.java
+++ b/src/jp/nekoteki/android/navivoicechanger/DownloadActivity.java
@@ -14,8 +14,10 @@ import android.net.http.AndroidHttpClient;
1414 import android.os.AsyncTask;
1515 import android.os.Bundle;
1616 import android.app.Activity;
17+import android.text.style.ImageSpan;
1718 import android.util.Log;
1819 import android.view.ContextMenu;
20+import android.view.Gravity;
1921 import android.view.Menu;
2022 import android.view.MenuItem;
2123 import android.view.View;
@@ -37,6 +39,7 @@ import android.annotation.TargetApi;
3739 import android.content.Context;
3840 import android.content.Intent;
3941 import android.graphics.Color;
42+import android.graphics.drawable.Drawable;
4043 import android.os.Build;
4144
4245 public class DownloadActivity extends Activity {
@@ -172,20 +175,44 @@ public class DownloadActivity extends Activity {
172175 textlayout.setFocusableInTouchMode(false);
173176
174177 TextView title = new TextView(context);
175- title.setText(rvd.getTitle() + (rvd.isDownloaded() ? " [L]" : " [R]")); // TODO: fix design downloaded marker.
178+ title.setText(rvd.getTitle());
176179 title.setTextColor(Color.BLACK);
177180 title.setTextSize(16);
178181 textlayout.addView(title);
179182
180183 TextView description = new TextView(context);
181- description.setTextSize(13);
184+ description.setTextSize(12);
182185 description.setText(rvd.getDescription());
183186 textlayout.addView(description);
184-
185187 container.addView(textlayout);
186-
187- convertView = container;
188- return convertView;
188+
189+ TextView downloaded = new TextView(context);
190+ if (rvd.isDownloaded()) {
191+ Drawable dmark = getResources().getDrawable(android.R.drawable.checkbox_on_background);
192+ dmark.setBounds(0, 0, 20, 20);
193+ downloaded.setCompoundDrawables(dmark, null, null, null);
194+ RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
195+ lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
196+ lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
197+ downloaded.setLayoutParams(lp);
198+ container.addView(downloaded);
199+ }
200+
201+ TextView author = new TextView(context);
202+ if (rvd.getAuthor() != null && !rvd.getAuthor().equals("")) {
203+ author.setTextSize(14);
204+ author.setText("By "+rvd.getAuthor());
205+ RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
206+ lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
207+ lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
208+ if (rvd.isDownloaded()) {
209+ lp.setMargins(0, 0, 22, 0);
210+ }
211+ author.setLayoutParams(lp);
212+ container.addView(author);
213+ }
214+
215+ return container;
189216 }
190217
191218 }
--- a/src/jp/nekoteki/android/navivoicechanger/InstallListActivity.java
+++ b/src/jp/nekoteki/android/navivoicechanger/InstallListActivity.java
@@ -87,14 +87,25 @@ public class InstallListActivity extends Activity {
8787 textlayout.addView(title);
8888
8989 TextView description = new TextView(context);
90- description.setTextSize(13);
90+ description.setTextSize(12);
9191 description.setText(vd.getDescription());
9292 textlayout.addView(description);
9393
9494 container.addView(textlayout);
9595
96- convertView = container;
97- return convertView;
96+ TextView author = new TextView(context);
97+ if (vd.getAuthor() != null && !vd.getAuthor().equals("")) {
98+ author.setTextSize(14);
99+ author.setText("By "+vd.getAuthor());
100+ RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
101+ lp.addRule(RelativeLayout.ALIGN_PARENT_TOP);
102+ lp.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
103+ author.setLayoutParams(lp);
104+ container.addView(author);
105+ }
106+
107+
108+ return container;
98109 }
99110
100111 }
--- a/src/jp/nekoteki/android/navivoicechanger/VoiceData.java
+++ b/src/jp/nekoteki/android/navivoicechanger/VoiceData.java
@@ -62,6 +62,7 @@ public class VoiceData {
6262 protected String lang;
6363 protected String path;
6464 protected int version;
65+ protected String author;
6566 protected Context context;
6667
6768 static List<VoiceData> scanVoiceData(Context context) {
@@ -268,6 +269,7 @@ public class VoiceData {
268269 this.description = prop.getProperty("description");
269270 this.lang = prop.getProperty("lang");
270271 this.unit = prop.getProperty("unit");
272+ this.author = prop.getProperty("author");
271273 try {
272274 this.rating = Float.parseFloat(prop.getProperty("rating"));
273275 } catch (Exception e) {
@@ -359,6 +361,14 @@ public class VoiceData {
359361 public void setVersion(int version) {
360362 this.version = version;
361363 }
364+
365+ public void setAuthor(String a) {
366+ this.author = a;
367+ }
368+
369+ public String getAuthor() {
370+ return author;
371+ }
362372
363373 public void validate() throws BrokenArchive {
364374 this.checkDigest(this.getPath() + "/" + ARCHIVE_FILENAME, this.getArchiveMD5());