• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Revisionbc6d8580ac41df7a1c6642547911c0b84bdb5642 (tree)
Time2013-02-04 18:10:52
AuthorMasahiko, SAWAI <say@user...>
CommiterMasahiko, SAWAI

Log Message

Added action bar in ResolveInfoListActivity

Change Summary

Incremental Difference

--- a/doc/ToDo.txt
+++ b/doc/ToDo.txt
@@ -10,4 +10,6 @@
1010 ** ACTION_INSERT への対応
1111 ** 各項目の編集画面一覧の作成
1212
13+* ResolveInfoListActivity
14+** 各項目にデフォルト設定済みかどうかが分かるようにしたい
1315
--- a/intent-lab/AndroidManifest.xml
+++ b/intent-lab/AndroidManifest.xml
@@ -20,8 +20,9 @@
2020 -->
2121
2222 <!-- Intent List -->
23- <activity android:name=".intent.IntentListActivity"
24- android:label="@string/app_name"
23+ <activity
24+ android:name=".intent.IntentListActivity"
25+ android:label="@string/app_name"
2526 >
2627 <intent-filter>
2728 <action android:name="android.intent.action.MAIN" />
@@ -39,8 +40,9 @@
3940 </activity>
4041
4142 <!-- Action List -->
42- <activity android:name=".action.ActionListActivity"
43- android:label="Action List"
43+ <activity
44+ android:name=".action.ActionListActivity"
45+ android:label="Action List"
4446 >
4547 <intent-filter>
4648 <action android:name="android.intent.action.MAIN" />
@@ -49,10 +51,10 @@
4951 </activity>
5052
5153 <!-- Activity List Viewer -->
52- <activity android:name=".ResolveInfoListActivity" />
53- <!--
54- android:theme="@android:style/Theme.Dialog"
55- -->
54+ <activity
55+ android:name=".ResolveInfoListActivity"
56+ android:label="@string/activity_list"
57+ />
5658
5759 <!-- Common Activity -->
5860 <activity android:name=".common.EditTextActivity" />
--- a/intent-lab/res/layout/intent_detail_activity.xml
+++ b/intent-lab/res/layout/intent_detail_activity.xml
@@ -24,156 +24,7 @@
2424 />
2525 </LinearLayout>
2626
27- <!-- content -->
28- <ScrollView
29- android:layout_width="fill_parent"
30- android:layout_height="fill_parent"
31- >
32- <LinearLayout
33- android:layout_width="fill_parent"
34- android:layout_height="fill_parent"
35- android:orientation="vertical"
36- >
37- <!-- Title -->
38- <TextView
39- style="@style/header"
40- android:text="@string/title"
41- />
42- <LinearLayout style="@style/section" android:focusable="true" android:clickable="true" >
43- <TextView
44- android:id="@+id/title_textview"
45- android:layout_width="fill_parent"
46- android:layout_height="wrap_content"
47- android:layout_margin="6dip"
48- android:textSize="20sp"
49- android:textColor="?android:textColorPrimary"
50- />
51- </LinearLayout>
52-
53- <!-- Section Action -->
54- <TextView
55- style="@style/header"
56- android:text="@string/action"
57- />
58-
59- <LinearLayout style="@style/section" android:focusable="true" android:clickable="true" >
60- <TextView
61- style="@style/key"
62- android:text="@string/action_name"
63- />
64- <TextView
65- style="@style/value"
66- android:id="@+id/action_textview"
67- />
68- </LinearLayout>
69-
70- <!-- Component -->
71- <TextView
72- style="@style/header"
73- android:text="@string/component"
74- />
75-
76- <LinearLayout style="@style/section" android:focusable="true" android:clickable="true" >
77- <TextView
78- style="@style/key"
79- android:text="@string/component_package"
80- />
81- <TextView
82- style="@style/value"
83- android:id="@+id/component_package_textview"
84- />
85-
86- <TextView
87- style="@style/key"
88- android:text="@string/component_class"
89- />
90- <TextView
91- style="@style/value"
92- android:id="@+id/component_class_textview"
93- />
94- </LinearLayout>
95-
96- <!-- Data -->
97- <TextView
98- style="@style/header"
99- android:text="@string/data"
100- />
101-
102- <LinearLayout style="@style/section" android:focusable="true" android:clickable="true" >
103- <TextView
104- style="@style/key"
105- android:text="@string/data_uri"
106- />
107- <TextView
108- style="@style/value"
109- android:id="@+id/data_uri_textview"
110- />
111-
112- <TextView
113- style="@style/key"
114- android:text="@string/data_type"
115- />
116- <TextView
117- style="@style/value"
118- android:id="@+id/data_type_textview"
119- />
120- </LinearLayout>
121-
122- <!-- Category -->
123- <TextView
124- style="@style/header"
125- android:text="@string/categories"
126- />
127- <LinearLayout
128- style="@style/section"
129- android:id="@+id/categories_section"
130- >
131- <TextView
132- android:layout_width="wrap_content"
133- android:layout_height="wrap_content"
134- android:layout_gravity="center"
135- android:text="@string/no_category"
136- android:textSize="20sp"
137- />
138- </LinearLayout>
139-
140- <!-- Extras -->
141- <TextView
142- style="@style/header"
143- android:text="@string/extras"
144- />
145- <LinearLayout
146- style="@style/section"
147- android:id="@+id/extras_section"
148- >
149- <TextView
150- android:layout_width="wrap_content"
151- android:layout_height="wrap_content"
152- android:layout_gravity="center"
153- android:text="@string/no_extra"
154- android:textSize="20sp"
155- />
156- </LinearLayout>
157-
158- <!-- Flags -->
159- <TextView
160- style="@style/header"
161- android:text="@string/flags"
162- />
163- <LinearLayout
164- style="@style/section"
165- android:id="@+id/flags_section"
166- >
167- <TextView
168- android:layout_width="wrap_content"
169- android:layout_height="wrap_content"
170- android:layout_gravity="center"
171- android:text="@string/no_flag"
172- android:textSize="20sp"
173- />
174- </LinearLayout>
175-
176- </LinearLayout>
177- </ScrollView>
27+ <!-- list -->
28+ <include layout="@layout/simple_list" />
17829
17930 </LinearLayout>
\ No newline at end of file
--- a/intent-lab/res/layout/intent_detail_activity2.xml
+++ /dev/null
@@ -1,30 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3- android:layout_width="fill_parent"
4- android:layout_height="fill_parent"
5- android:orientation="vertical"
6->
7- <!-- action bar -->
8- <LinearLayout
9- style="@style/actionbar"
10- >
11- <ImageButton
12- style="@style/actionbar_left_button"
13- android:id="@+id/home_button"
14- android:src="?attr/ic_home"
15- />
16- <TextView
17- style="@style/actionbar_title"
18- android:text="@string/edit_intent"
19- />
20- <ImageButton
21- style="@style/actionbar_right_button"
22- android:id="@+id/ok_button"
23- android:src="?attr/ic_ok"
24- />
25- </LinearLayout>
26-
27- <!-- list -->
28- <include layout="@layout/simple_list" />
29-
30-</LinearLayout>
\ No newline at end of file
--- a/intent-lab/res/layout/resolve_info_list_activity.xml
+++ b/intent-lab/res/layout/resolve_info_list_activity.xml
@@ -1,9 +1,29 @@
11 <?xml version="1.0" encoding="utf-8"?>
22 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3- android:layout_width="fill_parent"
4- android:layout_height="fill_parent"
5- android:orientation="vertical"
3+ android:layout_width="fill_parent"
4+ android:layout_height="fill_parent"
5+ android:orientation="vertical"
66 >
7+ <!-- action bar -->
8+ <LinearLayout
9+ style="@style/actionbar"
10+ >
11+ <ImageButton
12+ style="@style/actionbar_left_button"
13+ android:id="@+id/home_button"
14+ android:src="?attr/ic_home"
15+ />
16+ <TextView
17+ style="@style/actionbar_title"
18+ android:text="@string/activity_list"
19+ />
20+ <ImageButton
21+ style="@style/actionbar_right_button"
22+ android:id="@+id/ok_button"
23+ android:src="?attr/ic_ok"
24+ />
25+ </LinearLayout>
26+
727 <!-- list -->
828 <include layout="@layout/simple_list" />
929 </LinearLayout>
\ No newline at end of file
--- a/intent-lab/res/values/strings.xml
+++ b/intent-lab/res/values/strings.xml
@@ -43,6 +43,9 @@
4343 <string name="extras">Extras</string>
4444 <string name="no_extra">No extra data</string>
4545
46+ <!-- ActivityList -->
47+ <string name="activity_list">Activity List</string>
48+
4649 <!-- ActionList -->
4750 <string name="action_list">Action List</string>
4851 <string name="select_action">Select Action</string>
--- a/intent-lab/src/org/routine_work/intent_lab/ResolveInfoListActivity.java
+++ b/intent-lab/src/org/routine_work/intent_lab/ResolveInfoListActivity.java
@@ -9,6 +9,7 @@ import android.os.Parcelable;
99 import android.view.View;
1010 import android.widget.AdapterView;
1111 import android.widget.AdapterView.OnItemClickListener;
12+import android.widget.ImageButton;
1213 import android.widget.ListView;
1314 import android.widget.TextView;
1415 import android.widget.Toast;
@@ -16,21 +17,64 @@ import java.util.List;
1617 import org.routine_work.utils.Log;
1718
1819 public class ResolveInfoListActivity extends ListActivity
19- implements OnItemClickListener
20+ implements OnItemClickListener, View.OnClickListener
2021 {
2122
2223 private static final String LOG_TAG = "intent-lab";
2324 private Intent targetIntent;
2425
25- /** Called when the activity is first created. */
26+ public void onClick(View v)
27+ {
28+ Log.v(LOG_TAG, "Hello");
29+
30+ switch (v.getId())
31+ {
32+ case R.id.home_button:
33+ Log.d(LOG_TAG, "home_button is clicked.");
34+ finish();
35+ break;
36+ case R.id.ok_button:
37+ Log.d(LOG_TAG, "ok_button is clicked.");
38+ finish();
39+ break;
40+ }
41+
42+ Log.v(LOG_TAG, "Bye");
43+ }
44+
45+ public void onItemClick(AdapterView<?> adapterView, View view, int position, long id)
46+ {
47+ Log.v(LOG_TAG, "Hello");
48+
49+ TextView packageTextView = (TextView) view.findViewById(R.id.package_textview);
50+ TextView nameTextView = (TextView) view.findViewById(R.id.name_textview);
51+ String packageName = packageTextView.getText().toString();
52+ String className = nameTextView.getText().toString();
53+
54+ Intent intent = new Intent(targetIntent);
55+ intent.setClassName(packageName, className);
56+ startActivity(intent);
57+
58+ Log.v(LOG_TAG, "Bye");
59+ }
60+
2661 @Override
27- public void onCreate(Bundle savedInstanceState)
62+ protected void onCreate(Bundle savedInstanceState)
2863 {
2964 Log.v(LOG_TAG, "Hello");
3065
3166 super.onCreate(savedInstanceState);
3267 setContentView(R.layout.resolve_info_list_activity);
3368
69+ // init listeners
70+ ImageButton homeButton = (ImageButton) findViewById(R.id.home_button);
71+ ImageButton okButton = (ImageButton) findViewById(R.id.ok_button);
72+ homeButton.setOnClickListener(this);
73+ okButton.setOnClickListener(this);
74+
75+ ListView listView = getListView();
76+ listView.setOnItemClickListener(this);
77+
3478 // get target intent
3579 Parcelable parcelableExtra = getIntent().getParcelableExtra(Intent.EXTRA_INTENT);
3680 if (parcelableExtra instanceof Intent)
@@ -71,24 +115,6 @@ public class ResolveInfoListActivity extends ListActivity
71115 ResolveInfoAdapter resolveInfoAdapter = new ResolveInfoAdapter(this, activities);
72116 setListAdapter(resolveInfoAdapter);
73117
74- ListView listView = getListView();
75- listView.setOnItemClickListener(this);
76-
77- Log.v(LOG_TAG, "Bye");
78- }
79-
80- public void onItemClick(AdapterView<?> adapterView, View view, int position, long id)
81- {
82- Log.v(LOG_TAG, "Hello");
83-
84- TextView packageTextView = (TextView) view.findViewById(R.id.package_textview);
85- TextView nameTextView = (TextView) view.findViewById(R.id.name_textview);
86- String packageName = packageTextView.getText().toString();
87- String className = nameTextView.getText().toString();
88-
89- Intent intent = new Intent(targetIntent);
90- intent.setClassName(packageName, className);
91- startActivity(intent);
92118
93119 Log.v(LOG_TAG, "Bye");
94120 }
--- a/intent-lab/src/org/routine_work/intent_lab/intent/IntentDetailActivity.java
+++ b/intent-lab/src/org/routine_work/intent_lab/intent/IntentDetailActivity.java
@@ -81,7 +81,7 @@ public class IntentDetailActivity extends ListActivity
8181 Log.v(LOG_TAG, "Hello");
8282
8383 super.onCreate(savedInstanceState);
84- setContentView(R.layout.intent_detail_activity2);
84+ setContentView(R.layout.intent_detail_activity);
8585
8686 ImageButton homeButton = (ImageButton) findViewById(R.id.home_button);
8787 homeButton.setOnClickListener(this);