• 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

Revisione7beb68afe0dff6cb716187f1f9180e07b8d0cd3 (tree)
Time2013-07-30 07:33:21
AuthorHMML <hmml3939@gmai...>
CommiterHMML

Log Message

Fix deletion and redraw list.

Change Summary

Incremental Difference

--- a/src/jp/nekoteki/android/navivoicechanger/InstallListActivity.java
+++ b/src/jp/nekoteki/android/navivoicechanger/InstallListActivity.java
@@ -18,7 +18,6 @@ import android.view.ViewGroup.LayoutParams;
1818 import android.widget.AdapterView;
1919 import android.widget.AdapterView.AdapterContextMenuInfo;
2020 import android.widget.BaseAdapter;
21-import android.widget.ImageView;
2221 import android.widget.LinearLayout;
2322 import android.widget.ListView;
2423 import android.widget.RelativeLayout;
@@ -50,6 +49,7 @@ public class InstallListActivity extends Activity {
5049
5150 public void rescan() {
5251 this.list = VoiceData.scanVoiceData(context);
52+ this.notifyDataSetChanged();
5353 }
5454
5555 @Override
@@ -98,6 +98,7 @@ public class InstallListActivity extends Activity {
9898
9999 }
100100
101+ protected ListView list_view;
101102
102103 @Override
103104 protected void onCreate(Bundle savedInstanceState) {
@@ -109,6 +110,7 @@ public class InstallListActivity extends Activity {
109110 VoiceData.copyVoiceAssets(this);
110111
111112 ListView lv = (ListView) findViewById(R.id.voice_list);
113+ this.list_view = lv;
112114 lv.setAdapter(new ListVoiceDataAdapter(this));
113115 lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
114116 @Override
@@ -188,7 +190,7 @@ public class InstallListActivity extends Activity {
188190 break;
189191 case C_MENU_DELETE:
190192 vd.delete();
191- // TODO: remove item from list.
193+ ((ListVoiceDataAdapter) this.list_view.getAdapter()).rescan(); // TODO: slow...
192194 Toast.makeText(this, R.string.voice_deleted, Toast.LENGTH_SHORT).show();
193195 break;
194196 case C_MENU_RATE: