• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révisiond1cba97ef48b6d35fae95eee1b39d93b2d4d3024 (tree)
l'heure2013-05-06 20:09:51
AuteurMasahiko, SAWAI <say@user...>
CommiterMasahiko, SAWAI

Message de Log

いろいろ細かい修正

Change Summary

Modification

--- a/doc/ToDo.txt
+++ b/doc/ToDo.txt
@@ -1,16 +1,59 @@
11 ! ToDo
22
3-* IntentDetailActivity
4-** 保存処理実装
5-*** 保存処理
6-*** 変更済みチェックメソッド
7-*** この形式であれば onActivityResult で変更があった場合に保存してしまえばいい?
8-**** 編集途中でのキャンセルを可能にするか否かでどちらがいいかが変わる
9-**** この形式での編集だと編集途中でのキャンセルは現実的ではない
10-** ACTION_INSERT への対応
11-** 各項目の編集画面一覧の作成
12-
13-* ResolveInfoListActivity
14-** 各項目にデフォルト設定済みかどうかが分かるようにしたい
3+!! IntentListActivity
4+
5+#* List のコンテキストメニューから Edit Intent を削除
6+
7+!! IntentDetailActivity
8+
9+#* 保存処理実装
10+#** 保存処理
11+#** 変更済みチェックメソッド
12+#** この形式であれば onActivityResult で変更があった場合に保存してしまえばいい?
13+#*** 編集途中でのキャンセルを可能にするか否かでどちらがいいかが変わる
14+#*** この形式での編集だと編集途中でのキャンセルは現実的ではない
15+#*** -> キャンセル不可とする
16+#
17+#* タイトルを変更
18+#** Edit Intent -> Intent Detail
19+
20+* ACTION_INSERT への対応
21+
22+* OptionMenu に各種操作をつける
23+** Send Intent
24+** Test Intent
25+** Delete Intent
26+
27+* 編集機能
28+#** Name
29+#** Action
30+** Component Package
31+** Component Class
32+** Data Uri
33+** Data type
34+** Categories
35+** Flags
36+
37+!! ResolveInfoListActivity
38+
39+* 各項目にデフォルト設定済みかどうかが分かるようにしたい
1540 ** 可能かどうか調べる
1641
42+!! ActionEditActivity
43+
44+* EditTextActivity の右に ActionListActivity を呼び出すボタン
45+
46+!! ActionListActivity
47+
48+* 検索機能を実装する
49+
50+
51+!! ComponentPackageEditActivity
52+!! PackageListActivity
53+
54+!! ComponentClassEditActivity
55+
56+
57+!! アプリアイコンを作る
58+
59+
--- a/intent-lab/pom.xml
+++ b/intent-lab/pom.xml
@@ -123,6 +123,7 @@
123123 <source>1.5</source>
124124 <target>1.5</target>
125125 <encoding>UTF-8</encoding>
126+ <compilerArgument>-Xlint:unchecked</compilerArgument>
126127 </configuration>
127128 </plugin>
128129
--- a/intent-lab/res/layout/intent_detail_activity.xml
+++ b/intent-lab/res/layout/intent_detail_activity.xml
@@ -15,7 +15,7 @@
1515 />
1616 <TextView
1717 style="@style/actionbar_title"
18- android:text="@string/edit_intent"
18+ android:text="@string/intent_detail"
1919 />
2020 <!--
2121 <ImageButton
--- a/intent-lab/res/layout/intent_detail_item.xml
+++ b/intent-lab/res/layout/intent_detail_item.xml
@@ -44,19 +44,15 @@
4444 />
4545 </LinearLayout>
4646
47- <!-- Component -->
47+ <!-- Component Package -->
4848 <LinearLayout
49- android:id="@+id/intent_detail_item_component"
49+ android:id="@+id/intent_detail_item_component_package"
5050 android:layout_width="fill_parent"
5151 android:layout_height="wrap_content"
5252 android:orientation="vertical"
5353 >
5454 <TextView
5555 style="@style/key"
56- android:text="@string/component"
57- />
58- <TextView
59- style="@style/subkey"
6056 android:text="@string/component_package"
6157 />
6258 <TextView
@@ -64,8 +60,17 @@
6460 android:id="@+id/component_package_textview"
6561 android:hint="@string/component_package"
6662 />
63+ </LinearLayout>
64+
65+ <!-- Component Class -->
66+ <LinearLayout
67+ android:id="@+id/intent_detail_item_component_class"
68+ android:layout_width="fill_parent"
69+ android:layout_height="wrap_content"
70+ android:orientation="vertical"
71+ >
6772 <TextView
68- style="@style/subkey"
73+ style="@style/key"
6974 android:text="@string/component_class"
7075 />
7176 <TextView
--- a/intent-lab/res/menu/intent_list_menu.xml
+++ b/intent-lab/res/menu/intent_list_menu.xml
@@ -18,15 +18,8 @@
1818 android:id="@+id/view_intent_menuitem"
1919 android:title="@string/view_intent"
2020 android:icon="@android:drawable/ic_menu_view"
21- android:numericShortcut="5"
22- android:alphabeticShortcut="v"
23- />
24- <item
25- android:id="@+id/edit_intent_menuitem"
26- android:title="@string/edit_intent"
27- android:icon="@android:drawable/ic_menu_send"
2821 android:numericShortcut="3"
29- android:alphabeticShortcut="e"
22+ android:alphabeticShortcut="v"
3023 />
3124 <item
3225 android:id="@+id/delete_intent_menuitem"
--- a/intent-lab/res/values/strings.xml
+++ b/intent-lab/res/values/strings.xml
@@ -23,16 +23,15 @@
2323 <string name="send_intent">Send Intent</string>
2424 <string name="test_intent">Test Intent</string>
2525 <string name="view_intent">View Intent</string>
26- <string name="edit_intent">Edit Intent</string>
2726 <string name="delete_intent">Delete Intent</string>
2827
2928 <!-- Intent Detail -->
29+ <string name="intent_detail">Intent Detail</string>
3030 <string name="basic">Basic</string>
3131 <string name="action">Action</string>
3232 <string name="action_name">Name</string>
33- <string name="component">Component</string>
34- <string name="component_package">Package</string>
35- <string name="component_class">Class</string>
33+ <string name="component_package">Component Package</string>
34+ <string name="component_class">Component Class</string>
3635 <string name="data">Data</string>
3736 <string name="data_uri">Data URI</string>
3837 <string name="data_type">Data Type</string>
--- a/intent-lab/src/org/routine_work/intent_lab/action/ActionListActivity.java
+++ b/intent-lab/src/org/routine_work/intent_lab/action/ActionListActivity.java
@@ -44,6 +44,7 @@ public class ActionListActivity extends ListActivity
4444 private static final List<Map<String, String>> ACTION_DATA_LIST;
4545 private static final int ACTION_MODE_NORMAL = 0;
4646 private static final int ACTION_MODE_SEARCH = 1;
47+ @SuppressWarnings("unchecked")
4748 private static final Map<Integer, Boolean>[] ACTION_ITEM_VISIBILITY = new Map[]
4849 {
4950 new HashMap<Integer, Boolean>()
@@ -100,7 +101,7 @@ public class ActionListActivity extends ListActivity
100101 {
101102 String value = (String) field.get(null);
102103 // Log.d(LOG_TAG, name + " -> " + value);
103- Map<String, String> actionData = new HashMap();
104+ Map<String, String> actionData = new HashMap<String, String>();
104105 actionData.put(KEY_ACTION_NAME, name);
105106 actionData.put(KEY_ACTION_STRING, value);
106107 ACTION_DATA_LIST.add(actionData);
@@ -231,9 +232,9 @@ public class ActionListActivity extends ListActivity
231232 {
232233 actionMode = newActionMode;
233234 Log.d(LOG_TAG, "update actionMode => " + actionMode);
234-
235- // update visibility
236- for (Entry<Integer, Boolean> e : ACTION_ITEM_VISIBILITY[actionMode].entrySet())
235+ // update visibility
236+ Map<Integer, Boolean> actionItemVisibility = ACTION_ITEM_VISIBILITY[actionMode];
237+ for (Entry<Integer, Boolean> e : actionItemVisibility.entrySet())
237238 {
238239 View actionItemView = findViewById(e.getKey());
239240 if (actionItemView != null)
--- a/intent-lab/src/org/routine_work/intent_lab/intent/IntentDetailActivity.java
+++ b/intent-lab/src/org/routine_work/intent_lab/intent/IntentDetailActivity.java
@@ -31,20 +31,22 @@ public class IntentDetailActivity extends ListActivity
3131 private static final String LOG_TAG = "intent-lab";
3232 private static final int POSITION_NAME = 0;
3333 private static final int POSITION_ACTION = 1;
34- private static final int POSITION_COMPONENT = 2;
35- private static final int POSITION_DATA_URI = 3;
36- private static final int POSITION_DATA_TYPE = 4;
37- private static final int POSITION_CATEGORIES = 5;
38- private static final int POSITION_FLAGS = 6;
39- private static final int POSITION_EXTRAS = 7;
34+ private static final int POSITION_COMPONENT_PACKAGE = 2;
35+ private static final int POSITION_COMPONENT_CLASS = 3;
36+ private static final int POSITION_DATA_URI = 4;
37+ private static final int POSITION_DATA_TYPE = 5;
38+ private static final int POSITION_CATEGORIES = 6;
39+ private static final int POSITION_FLAGS = 7;
40+ private static final int POSITION_EXTRAS = 8;
4041 private static final int REQUEST_CODE_EDIT_INTENT_NAME = 101;
4142 private static final int REQUEST_CODE_EDIT_INTENT_ACTION = 102;
42- private static final int REQUEST_CODE_EDIT_INTENT_COMPONENT = 103;
43- private static final int REQUEST_CODE_EDIT_INTENT_DATA_URI = 104;
44- private static final int REQUEST_CODE_EDIT_INTENT_DATA_TYPE = 105;
45- private static final int REQUEST_CODE_EDIT_INTENT_CATEGORIES = 106;
46- private static final int REQUEST_CODE_EDIT_INTENT_FLAGS = 106;
47- private static final int REQUEST_CODE_EDIT_INTENT_EXTRAS = 108;
43+ private static final int REQUEST_CODE_EDIT_INTENT_COMPONENT_PACKAGE = 103;
44+ private static final int REQUEST_CODE_EDIT_INTENT_COMPONENT_CLASS = 104;
45+ private static final int REQUEST_CODE_EDIT_INTENT_DATA_URI = 105;
46+ private static final int REQUEST_CODE_EDIT_INTENT_DATA_TYPE = 106;
47+ private static final int REQUEST_CODE_EDIT_INTENT_CATEGORIES = 107;
48+ private static final int REQUEST_CODE_EDIT_INTENT_FLAGS = 108;
49+ private static final int REQUEST_CODE_EDIT_INTENT_EXTRAS = 109;
4850 // data
4951 private Uri currentIntentUri;
5052 private IntentModel currentIntentModel;
@@ -76,6 +78,18 @@ public class IntentDetailActivity extends ListActivity
7678 case POSITION_ACTION:
7779 startActionPickActivity();
7880 break;
81+ case POSITION_COMPONENT_PACKAGE:
82+ startComponentPackageEditActivity();
83+ break;
84+ case POSITION_COMPONENT_CLASS:
85+ startComponentClassEditActivity();
86+ break;
87+ case POSITION_DATA_URI:
88+ startDataUriEditActivity();
89+ break;
90+ case POSITION_DATA_TYPE:
91+ startDataTypeEditActivity();
92+ break;
7993 }
8094
8195 Log.d(LOG_TAG, "onItemClick() : Bye");
@@ -193,6 +207,26 @@ public class IntentDetailActivity extends ListActivity
193207 startActivityForResult(intent, REQUEST_CODE_EDIT_INTENT_ACTION);
194208 }
195209
210+ private void startComponentPackageEditActivity()
211+ {
212+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
213+ }
214+
215+ private void startDataUriEditActivity()
216+ {
217+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
218+ }
219+
220+ private void startDataTypeEditActivity()
221+ {
222+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
223+ }
224+
225+ private void startComponentClassEditActivity()
226+ {
227+ throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
228+ }
229+
196230 class IntentDetailListAdapter extends BaseAdapter
197231 {
198232
@@ -219,7 +253,10 @@ public class IntentDetailActivity extends ListActivity
219253 case POSITION_ACTION:
220254 result = currentIntentModel.getIntent().getAction();
221255 break;
222- case POSITION_COMPONENT:
256+ case POSITION_COMPONENT_PACKAGE:
257+ result = currentIntentModel.getIntent().getComponent();
258+ break;
259+ case POSITION_COMPONENT_CLASS:
223260 result = currentIntentModel.getIntent().getComponent();
224261 break;
225262 case POSITION_DATA_URI:
@@ -246,6 +283,7 @@ public class IntentDetailActivity extends ListActivity
246283 return position;
247284 }
248285
286+ @SuppressWarnings("unchecked")
249287 public View getView(int position, View convertView, ViewGroup parent)
250288 {
251289 View itemView;
@@ -261,7 +299,8 @@ public class IntentDetailActivity extends ListActivity
261299 }
262300 View nameView = itemView.findViewById(R.id.intent_detail_item_name);
263301 View actionView = itemView.findViewById(R.id.intent_detail_item_action);
264- View componentView = itemView.findViewById(R.id.intent_detail_item_component);
302+ View componentPackageView = itemView.findViewById(R.id.intent_detail_item_component_package);
303+ View componentClassView = itemView.findViewById(R.id.intent_detail_item_component_class);
265304 View dataUriView = itemView.findViewById(R.id.intent_detail_item_data_uri);
266305 View dataTypeView = itemView.findViewById(R.id.intent_detail_item_data_type);
267306 View categoriesView = itemView.findViewById(R.id.intent_detail_item_categories);
@@ -270,7 +309,8 @@ public class IntentDetailActivity extends ListActivity
270309
271310 nameView.setVisibility(View.GONE);
272311 actionView.setVisibility(View.GONE);
273- componentView.setVisibility(View.GONE);
312+ componentPackageView.setVisibility(View.GONE);
313+ componentClassView.setVisibility(View.GONE);
274314 dataUriView.setVisibility(View.GONE);
275315 dataTypeView.setVisibility(View.GONE);
276316 categoriesView.setVisibility(View.GONE);
@@ -300,21 +340,32 @@ public class IntentDetailActivity extends ListActivity
300340 titleTextView.setText(actionText);
301341 actionView.setVisibility(View.VISIBLE);
302342 break;
303- case POSITION_COMPONENT:
343+ case POSITION_COMPONENT_PACKAGE:
344+ {
304345 String componentPackageText = null;
305- String componentClassText = null;
306346 ComponentName componentName = (ComponentName) item;
307347 if (componentName != null)
308348 {
309349 componentPackageText = componentName.getPackageName();
310- componentClassText = componentName.getClassName();
311350 }
312- TextView componentPackageTextView = (TextView) componentView.findViewById(R.id.component_package_textview);
313- TextView componentClassTextView = (TextView) componentView.findViewById(R.id.component_class_textview);
351+ TextView componentPackageTextView = (TextView) componentPackageView.findViewById(R.id.component_package_textview);
314352 componentPackageTextView.setText(componentPackageText);
353+ componentPackageView.setVisibility(View.VISIBLE);
354+ break;
355+ }
356+ case POSITION_COMPONENT_CLASS:
357+ {
358+ String componentClassText = null;
359+ ComponentName componentName = (ComponentName) item;
360+ if (componentName != null)
361+ {
362+ componentClassText = componentName.getClassName();
363+ }
364+ TextView componentClassTextView = (TextView) componentClassView.findViewById(R.id.component_class_textview);
315365 componentClassTextView.setText(componentClassText);
316- componentView.setVisibility(View.VISIBLE);
366+ componentClassView.setVisibility(View.VISIBLE);
317367 break;
368+ }
318369 case POSITION_DATA_URI:
319370 String dataUriText = null;
320371 if (item instanceof Uri)
--- a/intent-lab/src/org/routine_work/intent_lab/intent/IntentListActivity.java
+++ b/intent-lab/src/org/routine_work/intent_lab/intent/IntentListActivity.java
@@ -162,10 +162,6 @@ public class IntentListActivity extends ListActivity
162162 viewIntent(intentId);
163163 result = true;
164164 break;
165- case R.id.edit_intent_menuitem:
166- editIntent(intentId);
167- result = true;
168- break;
169165 case R.id.delete_intent_menuitem:
170166 deleteIntent(intentId);
171167 result = true;
@@ -217,14 +213,6 @@ public class IntentListActivity extends ListActivity
217213 Log.v(LOG_TAG, "Bye");
218214 }
219215
220- private void editIntent(long intentId)
221- {
222- Log.d(LOG_TAG, "editIntent() Hello intentId => " + intentId);
223- Uri uri = ContentUris.withAppendedId(IntentStore.Intents.CONTENT_URI, intentId);
224- Intent intent = new Intent(Intent.ACTION_EDIT, uri);
225- startActivity(intent);
226- }
227-
228216 private void deleteIntent(long intentId)
229217 {
230218 Log.d(LOG_TAG, "deleteIntent() Hello intentId => " + intentId);
--- a/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentStore.java
+++ b/intent-lab/src/org/routine_work/intent_lab/intent/provider/IntentStore.java
@@ -1,7 +1,7 @@
11 /*
22 * The MIT License
33 *
4- * Copyright 2011-2012 Masahiko, SAWAI <masahiko.sawai@gmail.com>.
4+ * Copyright 2011-2013 Masahiko, SAWAI <masahiko.sawai@gmail.com>.
55 *
66 * Permission is hereby granted, free of charge, to any person obtaining a copy
77 * of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +26,6 @@ package org.routine_work.intent_lab.intent.provider;
2626 import android.content.ContentResolver;
2727 import android.content.ContentUris;
2828 import android.content.ContentValues;
29-import android.content.Context;
3029 import android.content.Intent;
3130 import android.database.Cursor;
3231 import android.net.Uri;
@@ -255,6 +254,11 @@ public class IntentStore
255254 long intentModified = cursor.getLong(modifiedColumnIndex);
256255 String intentAction = cursor.getString(actionColumnIndex);
257256 String intentDataUriString = cursor.getString(dataUriColumnIndex);
257+ Uri intentDataUri = null;
258+ if (intentDataUriString != null)
259+ {
260+ intentDataUri = Uri.parse(intentDataUriString);
261+ }
258262
259263 result = new IntentModel();
260264 result.setIntent(intentObject);
@@ -263,7 +267,7 @@ public class IntentStore
263267 result.setCreated(intentCreated);
264268 result.setModified(intentModified);
265269 result.setAction(intentAction);
266- result.setDataUri(Uri.parse(intentDataUriString));
270+ result.setDataUri(intentDataUri);
267271 }
268272 }
269273 finally
@@ -311,6 +315,7 @@ public class IntentStore
311315 {
312316 is.close();
313317 }
318+
314319 if (os != null)
315320 {
316321 os.close();