• R/O
  • SSH
  • HTTPS

nikocale: Commit


Commit MetaInfo

Revision305 (tree)
Zeit2010-12-12 17:21:01
Autortakezoe

Log Message

SQLiteを使ってクライアントだけで動くようにしました。

Ändern Zusammenfassung

  • modified: nikocale_android/trunk/nikocale_android/AndroidManifest.xml (diff)
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/Config.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/RecentActivity.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/ConfigActivity.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/CommentActivity.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/DetailActivity.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/StatusActivity.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData1.json
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData2.json
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/AccessorFactory.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessorImpl.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getRecentEntries.json
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessorMock.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getStatus.json
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetEntryDataTask.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/SaveEntryTask.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/ResultBean.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/CommentTask.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/AbstractTask.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetStatusTask.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/IDataReceiver.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetUserDataTask.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetRecentEntriesTask.java
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task
  • delete: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/adapter/CommentAdapter.java
  • modified: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/adapter/EntryAdapter.java (diff)
  • modified: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/MainActivity.java (diff)
  • modified: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/CalendarActivity.java (diff)
  • modified: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/Constants.java (diff)
  • added: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/util/NikocaleSQLiteOpenHelper.java (diff)
  • modified: nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/EntryActivity.java (diff)
  • modified: nikocale_android/trunk/nikocale_android/gen/jp/sf/amateras/nikocale/android/R.java (diff)
  • delete: nikocale_android/trunk/nikocale_android/res/layout/recent.xml
  • delete: nikocale_android/trunk/nikocale_android/res/layout/config.xml
  • delete: nikocale_android/trunk/nikocale_android/res/layout/detail.xml
  • delete: nikocale_android/trunk/nikocale_android/res/layout/status.xml
  • delete: nikocale_android/trunk/nikocale_android/res/layout/comment.xml
  • delete: nikocale_android/trunk/nikocale_android/res/layout/commentdata.xml
  • modified: nikocale_android/trunk/nikocale_android/res/layout/rowdata.xml (diff)

Diff

--- nikocale_android/trunk/nikocale_android/AndroidManifest.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/AndroidManifest.xml (revision 305)
@@ -13,25 +13,9 @@
1313 <activity android:name="EntryActivity" android:label="ニコカレの入力"
1414 android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
1515 </activity>
16- <activity android:name="ConfigActivity" android:label="設定"
17- android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
18- </activity>
1916 <activity android:name="CalendarActivity" android:label="カレンダ表示"
2017 android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
2118 </activity>
22- <activity android:name="StatusActivity" android:label="ステータス"
23- android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
24- </activity>
25- <activity android:name="RecentActivity" android:label="最近のニコカレ"
26- android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
27- </activity>
28- <activity android:name="DetailActivity" android:label="詳細表示"
29- android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
30- </activity>
31- <activity android:name="CommentActivity" android:label="コメント投稿"
32- android:screenOrientation="portrait" android:configChanges="orientation|keyboardHidden">
33- </activity>
34-
3519 </application>
3620
3721 <uses-permission android:name="android.permission.INTERNET"></uses-permission>
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/Config.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/Config.java (nonexistent)
@@ -1,91 +0,0 @@
1-package jp.sf.amateras.nikocale.android;
2-
3-import jp.sf.amateras.nikocale.android.util.StringUtils;
4-import android.content.SharedPreferences;
5-import android.content.SharedPreferences.Editor;
6-
7-/**
8- * ニコカレアプリの設定情報を保持するシングルトンクラスです。
9- *
10- * @author Naoki Takezoe
11- */
12-public class Config {
13-
14- public static final String PREF_NAME = "COMMON_PREF";
15-
16- private static final String KEY_ADDRESS = "ADDRESS";
17- private static final String KEY_PASSWORD = "PASSWORD";
18-
19- private static Config config;
20- private boolean requiresReload = true;
21-
22- public static void init(SharedPreferences preferences){
23- Config.preferences = preferences;
24- }
25-
26- public static Config getInstance(){
27- if(config == null){
28- config = new Config();
29- }
30- return config;
31- }
32-
33- private static SharedPreferences preferences;
34-
35- /**
36- * ニコカレデータのリロードが必要かどうかを取得します。
37- * 一度取得するとfalseに戻ります。
38- */
39- public boolean requiresReload(){
40- boolean result = requiresReload;
41- requiresReload = false;
42- return result;
43- }
44-
45- /**
46- * ニコカレデータのリロードが必要かどうかを取得します。
47- * 取得してもfalseに戻りません。
48- */
49- public boolean requiredReload2(){
50- return requiresReload;
51- }
52-
53- public String getAddress() {
54- return preferences.getString(KEY_ADDRESS, "");
55- }
56-
57- public void setAddress(String address) {
58- if(!getAddress().equals(address)){
59- Editor editor = preferences.edit();
60- editor.putString(KEY_ADDRESS, address);
61- editor.commit();
62- requiresReload = true;
63- }
64- }
65-
66- public String getPassword() {
67- return preferences.getString(KEY_PASSWORD, "");
68- }
69-
70- public void setPassword(String password) {
71- if(!getPassword().equals(password)){
72- Editor editor = preferences.edit();
73- editor.putString(KEY_PASSWORD, password);
74- editor.commit();
75- requiresReload = true;
76- }
77- }
78-
79- public void setRequiresReload(){
80- this.requiresReload = true;
81- }
82-
83- /**
84- * アプリケーションが利用可能な状態かどうかを返します。
85- * 設定が行われていない場合はfalseを返します。
86- */
87- public boolean isEnable(){
88- return StringUtils.isNotEmpty(getAddress()) && StringUtils.isNotEmpty(getPassword());
89- }
90-
91-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/RecentActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/RecentActivity.java (nonexistent)
@@ -1,61 +0,0 @@
1-package jp.sf.amateras.nikocale.android;
2-
3-import java.util.List;
4-import java.util.Map;
5-
6-import jp.sf.amateras.nikocale.android.adapter.EntryAdapter;
7-import jp.sf.amateras.nikocale.android.task.GetRecentEntriesTask;
8-import jp.sf.amateras.nikocale.android.task.IDataReceiver;
9-import android.app.Activity;
10-import android.os.Bundle;
11-import android.widget.ListView;
12-
13-/**
14- * 最近のニコカレを表示します。
15- *
16- * @author Naoki Takezoe
17- */
18-public class RecentActivity extends Activity implements IDataReceiver {
19-
20- private EntryAdapter arrayAdapter;
21-
22- /** Called when the activity is first created. */
23- @Override
24- public void onCreate(Bundle savedInstanceState) {
25- super.onCreate(savedInstanceState);
26- setContentView(R.layout.recent);
27-
28- arrayAdapter = new EntryAdapter(this, R.layout.rowdata, getResources(), false);
29-
30- ListView list = (ListView) findViewById(R.id.ListView01);
31- list.setAdapter(arrayAdapter);
32-
33- GetRecentEntriesTask task = new GetRecentEntriesTask(this);
34- task.setDataReceiver(this);
35- task.execute((Void[]) null);
36- }
37-
38- @Override
39- public void onStart(){
40- super.onStart();
41-
42- if(Config.getInstance().isEnable() && Config.getInstance().requiresReload()){
43- GetRecentEntriesTask task = new GetRecentEntriesTask(this);
44- task.setDataReceiver(this);
45- task.execute((Void[]) null);
46- }
47- }
48-
49- @Override
50- public void setData(Object data) {
51- @SuppressWarnings("unchecked")
52- List<Map<String, Object>> result = (List<Map<String, Object>>) data;
53-
54- arrayAdapter.clear();
55-
56- for(Map<String, Object> map: result){
57- arrayAdapter.add(map);
58- }
59- }
60-
61-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/ConfigActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/ConfigActivity.java (nonexistent)
@@ -1,81 +0,0 @@
1-package jp.sf.amateras.nikocale.android;
2-
3-import jp.sf.amateras.nikocale.android.util.StringUtils;
4-import jp.sf.amateras.nikocale.android.widget.Text;
5-import android.app.Activity;
6-import android.os.Bundle;
7-import android.text.Editable;
8-import android.text.TextWatcher;
9-import android.view.View;
10-import android.view.View.OnClickListener;
11-import android.widget.Button;
12-import android.widget.EditText;
13-
14-/**
15- * アプリの設定を行う画面を表示します。
16- *
17- * @author Naoki Takezoe
18- */
19-public class ConfigActivity extends Activity {
20-
21- /** Called when the activity is first created. */
22- @Override
23- public void onCreate(Bundle savedInstanceState) {
24- super.onCreate(savedInstanceState);
25- setContentView(R.layout.config);
26-
27- Text editText1 = (Text) findViewById(R.id.EditText01);
28- editText1.setText(Config.getInstance().getAddress());
29- editText1.setRequired(true);
30-
31- Text editText2 = (Text) findViewById(R.id.EditText02);
32- editText2.setText(Config.getInstance().getPassword());
33- editText2.setRequired(true);
34-
35- Button button = (Button) findViewById(R.id.Button01);
36-
37- button.setOnClickListener(new OnClickListener() {
38- @Override
39- public void onClick(View v) {
40- EditText editText1 = (EditText) findViewById(R.id.EditText01);
41- EditText editText2 = (EditText) findViewById(R.id.EditText02);
42- Config.getInstance().setAddress(editText1.getText().toString());
43- Config.getInstance().setPassword(editText2.getText().toString());
44- finish();
45- }
46- });
47-
48- updateButtonStatus();
49- editText1.addTextChangedListener(new UpdateButtonStatusListener());
50- editText2.addTextChangedListener(new UpdateButtonStatusListener());
51- }
52-
53- private class UpdateButtonStatusListener implements TextWatcher {
54-
55- @Override
56- public void afterTextChanged(Editable s) {
57- updateButtonStatus();
58- }
59-
60- @Override
61- public void beforeTextChanged(CharSequence s, int start, int count, int after) {
62- }
63-
64- @Override
65- public void onTextChanged(CharSequence s, int start, int before, int count) {
66- }
67-
68- }
69-
70- private void updateButtonStatus(){
71- Text editText1 = (Text) findViewById(R.id.EditText01);
72- Text editText2 = (Text) findViewById(R.id.EditText02);
73- Button button = (Button) findViewById(R.id.Button01);
74-
75- String text1 = editText1.getText().toString();
76- String text2 = editText2.getText().toString();
77-
78- button.setEnabled(StringUtils.isNotEmpty(text1) && StringUtils.isNotEmpty(text2));
79- }
80-
81-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/CommentActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/CommentActivity.java (nonexistent)
@@ -1,87 +0,0 @@
1-package jp.sf.amateras.nikocale.android;
2-
3-import jp.sf.amateras.nikocale.android.task.CommentTask;
4-import jp.sf.amateras.nikocale.android.util.DialogUtils;
5-import android.app.Activity;
6-import android.os.Bundle;
7-import android.view.View;
8-import android.view.View.OnClickListener;
9-import android.widget.Button;
10-import android.widget.EditText;
11-
12-/**
13- * コメントを投稿するための画面です。
14- *
15- * @author Naoki Takezoe
16- */
17-public class CommentActivity extends Activity {
18-
19- private String email;
20- private int year;
21- private int month;
22- private int day;
23-
24- /**
25- * このエントリの年を返します。
26- */
27- public int getYear(){
28- return this.year;
29- }
30-
31- /**
32- * このエントリの月を返します。
33- */
34- public int getMonth(){
35- return this.month;
36- }
37-
38- /**
39- * このエントリの日を返します。
40- */
41- public int getDay(){
42- return this.day;
43- }
44-
45- /**
46- * このエントリのユーザのメールアドレスを返します。
47- */
48- public String getEmail(){
49- return this.email;
50- }
51-
52- @Override
53- public void onCreate(Bundle savedInstanceState) {
54- super.onCreate(savedInstanceState);
55- setContentView(R.layout.comment);
56-
57- email = getIntent().getStringExtra("email");
58- year = getIntent().getIntExtra("year" , -1);
59- month = getIntent().getIntExtra("month" , -1);
60- day = getIntent().getIntExtra("day" , -1);
61-
62- Button button = (Button) findViewById(R.id.SendComment);
63- button.setOnClickListener(new OnClickListener() {
64- @Override
65- public void onClick(View v) {
66- try {
67- EditText commentText = (EditText) findViewById(R.id.CommentText);
68- if(commentText.getText().toString().length() == 0){
69- DialogUtils.showDialog(email + "へのコメントを入力してください。", CommentActivity.this);
70- return;
71- }
72-
73- CommentTask task = new CommentTask(CommentActivity.this);
74- task.execute((Void[]) null);
75-
76- } catch (Exception ex) {
77- DialogUtils.showDialog(ex.toString(), CommentActivity.this);
78- }
79- }
80- });
81- }
82-
83-
84-
85-
86-
87-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/DetailActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/DetailActivity.java (nonexistent)
@@ -1,149 +0,0 @@
1-package jp.sf.amateras.nikocale.android;
2-
3-import java.util.List;
4-import java.util.Map;
5-
6-import jp.sf.amateras.nikocale.android.adapter.CommentAdapter;
7-import jp.sf.amateras.nikocale.android.task.GetEntryDataTask;
8-import jp.sf.amateras.nikocale.android.task.IDataReceiver;
9-import jp.sf.amateras.nikocale.android.util.DialogUtils;
10-import jp.sf.amateras.nikocale.android.util.StringUtils;
11-import net.arnx.jsonic.JSON;
12-import android.app.Activity;
13-import android.content.Intent;
14-import android.graphics.Bitmap;
15-import android.graphics.BitmapFactory;
16-import android.os.Bundle;
17-import android.view.View;
18-import android.view.View.OnClickListener;
19-import android.widget.Button;
20-import android.widget.ImageView;
21-import android.widget.ListView;
22-import android.widget.TextView;
23-
24-/**
25- * ニコカレの詳細画面。
26- *
27- * @author Naoki Takezoe
28- */
29-public class DetailActivity extends Activity {
30-
31- private String email;
32- private int year;
33- private int month;
34- private int day;
35-
36- private Bitmap good32;
37- private Bitmap normal32;
38- private Bitmap bad32;
39-
40- private CommentAdapter commentAdapter;
41-
42- /** Called when the activity is first created. */
43- @Override
44- public void onCreate(Bundle savedInstanceState) {
45- super.onCreate(savedInstanceState);
46- setContentView(R.layout.detail);
47-
48- Intent intent = getIntent();
49- email = intent.getStringExtra("email");
50- year = intent.getIntExtra("year" , -1);
51- month = intent.getIntExtra("month" , -1);
52- day = intent.getIntExtra("day" , -1);
53-
54- setTitle(String.format("%d年%d月%d日", year, month, day));
55-
56- good32 = BitmapFactory.decodeResource(getResources(), R.drawable.good32);
57- normal32 = BitmapFactory.decodeResource(getResources(), R.drawable.normal32);
58- bad32 = BitmapFactory.decodeResource(getResources(), R.drawable.bad32);
59-
60- commentAdapter = new CommentAdapter(this, R.layout.commentdata, getResources());
61- ListView list = (ListView) findViewById(R.id.CommentList_list);
62- list.setAdapter(commentAdapter);
63-
64- Button button = (Button) findViewById(R.id.SendComment);
65- button.setOnClickListener(new OnClickListener() {
66- @Override
67- public void onClick(View v) {
68- Intent intent = new Intent(DetailActivity.this, CommentActivity.class);
69- intent.putExtra("email", email);
70- intent.putExtra("year", year);
71- intent.putExtra("month", month);
72- intent.putExtra("day", day);
73- DetailActivity.this.startActivity(intent);
74- }
75- });
76-
77- refreshData();
78- Config.getInstance().requiresReload();
79- }
80-
81- @Override
82- public void onStart(){
83- super.onStart();
84-
85- if(Config.getInstance().requiredReload2()){
86- refreshData();
87- }
88- }
89-
90- private void refreshData(){
91- try {
92- GetEntryDataTask task = new GetEntryDataTask(this, email, year, month, day, false);
93- task.setDataReceiver(new IDataReceiver() {
94- @Override
95- @SuppressWarnings("unchecked")
96- public void setData(Object data) {
97- Map<String, Object> map = (Map<String, Object>) JSON.decode((String) data);
98- DetailActivity.this.setData(map);
99- }
100- });
101- task.execute((Void[]) null);
102-
103- } catch (Exception ex) {
104- DialogUtils.showDialog(ex.toString(), this);
105- }
106- }
107-
108- private void setData(Map<String, Object> entry){
109- if(entry == null){
110- return;
111- }
112- if(entry.containsKey("status")){
113- ImageView imageView = (ImageView) findViewById(R.id.ImageView01);
114- int status = Integer.parseInt(entry.get("status").toString());
115- if(status == Constants.STATUS_GOOD){
116- imageView.setImageBitmap(good32);
117-
118- } else if(status == Constants.STATUS_NORMAL){
119- imageView.setImageBitmap(normal32);
120-
121- } else if(status == Constants.STATUS_BAD){
122- imageView.setImageBitmap(bad32);
123- }
124- }
125-
126- TextView message = (TextView) findViewById(R.id.TextView01);
127- String messageText = (String) entry.get("message");
128- if(StringUtils.isNotEmpty(messageText)){
129- message.setText("「" + messageText + "」");
130- } else {
131- message.setText("");
132- }
133-
134- // コメントを表示
135- @SuppressWarnings("unchecked")
136- List<Map<String, Object>> commentList = (List<Map<String, Object>>) entry.get("commentList");
137- commentAdapter.clear();
138- for(Map<String, Object> comment: commentList){
139- commentAdapter.add(comment);
140- }
141- if(!commentList.isEmpty()){
142- TextView emptyLabel = (TextView) findViewById(R.id.CommentList_empty);
143- emptyLabel.setVisibility(View.INVISIBLE);
144- }
145- }
146-
147-
148-
149-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/StatusActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/StatusActivity.java (nonexistent)
@@ -1,24 +0,0 @@
1-package jp.sf.amateras.nikocale.android;
2-
3-import jp.sf.amateras.nikocale.android.task.GetStatusTask;
4-import android.app.Activity;
5-import android.os.Bundle;
6-
7-/**
8- * ユーザのステータスを表示します。
9- *
10- * @author Naoki Takezoe
11- */
12-public class StatusActivity extends Activity {
13-
14- /** Called when the activity is first created. */
15- @Override
16- public void onCreate(Bundle savedInstanceState) {
17- super.onCreate(savedInstanceState);
18- setContentView(R.layout.status);
19-
20- GetStatusTask task = new GetStatusTask(this);
21- task.execute((Void[]) null);
22- }
23-
24-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData2.json (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData2.json (nonexistent)
@@ -1 +0,0 @@
1-{"addDate":1276379346941,"commentCount":null,"commentList":[],"day":12,"id":103,"member":{"formatPoint":"20.00","id":99,"image":false,"name":"test@example.com","point":20.0,"profile":"","status0":1,"status1":2,"status2":0},"message":"aaaa","month":6,"status":0,"updateDate":1276379756296,"userId":99,"year":2010}
\ No newline at end of file
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/AccessorFactory.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/AccessorFactory.java (nonexistent)
@@ -1,18 +0,0 @@
1-package jp.sf.amateras.nikocale.android.accessor;
2-
3-/**
4- * ニコカレのWeb APIにアクセスするためのアクセサのインスタンスを生成するファクトリです。
5- *
6- * @author Naoki Takezoe
7- */
8-public class AccessorFactory {
9-
10- /**
11- * ニコカレのWeb APIにアクセスするための{@link NikoCaleAccessor}の実装を返却します。
12- */
13- public static NikoCaleAccessor getAccessor(){
14-// return new NikoCaleAccessorMock();
15- return new NikoCaleAccessorImpl();
16- }
17-
18-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessorImpl.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessorImpl.java (nonexistent)
@@ -1,99 +0,0 @@
1-package jp.sf.amateras.nikocale.android.accessor;
2-
3-import java.io.IOException;
4-import java.io.InputStream;
5-import java.net.URL;
6-import java.net.URLEncoder;
7-import java.util.HashMap;
8-import java.util.Map;
9-
10-import jp.sf.amateras.nikocale.android.Config;
11-import jp.sf.amateras.nikocale.android.util.StringUtils;
12-
13-/**
14- * {@link NikoCaleAccessor}の実装です。
15- *
16- * @author Naoki Takezoe
17- */
18-public class NikoCaleAccessorImpl implements NikoCaleAccessor {
19-
20- private static final String API_URL = "http://niko2cal.appspot.com/api/";
21-
22- private static Map<String, String> userDataCache = new HashMap<String, String>();
23-
24- public boolean hasCache(String email, int year, int month){
25- String key = email + "_" + year + "_" + month;
26- return userDataCache.containsKey(key);
27- }
28-
29- @Override
30- public String getUserData(String email, int year, int month, boolean reload) throws IOException {
31- String key = email + "_" + year + "_" + month;
32-
33- if(userDataCache.containsKey(key) && reload == false){
34- return userDataCache.get(key);
35- }
36-
37- URL url = new URL(
38- API_URL + "getUserData.do?email=" + email + "&year=" + year + "&month=" + month);
39-
40- InputStream in = url.openStream();
41- String json = StringUtils.readString(in);
42-
43- userDataCache.put(key, json);
44-
45- return json;
46- }
47-
48- @Override
49- public String getUserData(String email, int year, int month, int day) throws IOException {
50- URL url = new URL(
51- API_URL + "getUserData.do?email=" + email + "&year=" + year + "&month=" + month + "&day=" + day);
52-
53- InputStream in = url.openStream();
54- return StringUtils.readString(in);
55- }
56-
57- @Override
58- public String saveEntry(String email, int year, int month, int day,
59- int status, String message) throws IOException {
60- URL url = new URL(
61- API_URL + "saveEntry.do?email=" + email +
62- "&year=" + year + "&month=" + month + "&day=" + day +
63- "&status=" + status + "&message=" + URLEncoder.encode(message, "UTF-8") +
64- "&password=" + URLEncoder.encode(Config.getInstance().getPassword(), "UTF-8"));
65-
66- InputStream in = url.openStream();
67- return StringUtils.readString(in);
68- }
69-
70- @Override
71- public String getStatus(String email) throws IOException {
72- URL url = new URL(API_URL + "getStatus.do?email=" + email);
73-
74- InputStream in = url.openStream();
75- return StringUtils.readString(in);
76- }
77-
78- @Override
79- public String getRecentEntries() throws IOException {
80- URL url = new URL(API_URL + "getRecent.do");
81-
82- InputStream in = url.openStream();
83- return StringUtils.readString(in);
84- }
85-
86- @Override
87- public String saveComment(String email, String target, int year, int month,
88- int day, String comment) throws IOException {
89- URL url = new URL(
90- API_URL + "comment.do?email=" + email +"&target=" + target +
91- "&year=" + year + "&month=" + month + "&day=" + day +
92- "&comment=" + URLEncoder.encode(comment, "UTF-8") +
93- "&password=" + URLEncoder.encode(Config.getInstance().getPassword(), "UTF-8"));
94-
95- InputStream in = url.openStream();
96- return StringUtils.readString(in);
97- }
98-
99-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getRecentEntries.json (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getRecentEntries.json (nonexistent)
@@ -1 +0,0 @@
1-[{"member":{"formatPoint":"20.00","id":99,"image":false,"name":"test@example.com","point":20.0,"profile":"","status0":1,"status1":2,"status2":0},"message":"aaaa","status":0,"userId":99,"month":6,"year":2010,"day":12,"commentCount":null,"rssDate":"2010-06-12T21:55:56+00:00","date":"2010/06/12"},{"member":{"formatPoint":"20.00","id":99,"image":false,"name":"test@example.com","point":20.0,"profile":"","status0":1,"status1":2,"status2":0},"message":"あああ","status":1,"userId":99,"month":4,"year":2010,"day":4,"commentCount":null,"rssDate":"2010-04-04T14:36:53+00:00","date":"2010/04/04"},{"member":{"formatPoint":"20.00","id":99,"image":false,"name":"test@example.com","point":20.0,"profile":"","status0":1,"status1":2,"status2":0},"message":"テスト","status":1,"userId":99,"month":3,"year":2010,"day":6,"commentCount":null,"rssDate":"2010-03-06T14:58:29+00:00","date":"2010/03/06"}]
\ No newline at end of file
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessorMock.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessorMock.java (nonexistent)
@@ -1,68 +0,0 @@
1-package jp.sf.amateras.nikocale.android.accessor;
2-
3-import java.io.IOException;
4-import java.io.InputStream;
5-
6-import jp.sf.amateras.nikocale.android.util.StringUtils;
7-
8-/**
9- * 開発用の{@link NikoCaleAccessor}のモック実装です。
10- *
11- * @author Naoki Takezoe
12- */
13-public class NikoCaleAccessorMock implements NikoCaleAccessor {
14-
15- @Override
16- public String getUserData(String email, int year, int month, boolean reload) throws IOException {
17- ClassLoader cl = getClass().getClassLoader();
18- InputStream in = cl.getResourceAsStream(
19- "jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData1.json");
20-
21- return StringUtils.readString(in);
22- }
23-
24- @Override
25- public String getUserData(String email, int year, int month, int day) throws IOException {
26- ClassLoader cl = getClass().getClassLoader();
27- InputStream in = cl.getResourceAsStream(
28- "jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData2.json");
29-
30- return StringUtils.readString(in);
31- }
32-
33- @Override
34- public String saveEntry(String email, int year, int month, int day,
35- int status, String message) {
36- return "";
37- }
38-
39- @Override
40- public String getStatus(String email) throws IOException {
41- ClassLoader cl = getClass().getClassLoader();
42- InputStream in = cl.getResourceAsStream(
43- "jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getStatus.json");
44-
45- return StringUtils.readString(in);
46- }
47-
48- @Override
49- public boolean hasCache(String email, int year, int month) {
50- return false;
51- }
52-
53- @Override
54- public String getRecentEntries() throws IOException {
55- ClassLoader cl = getClass().getClassLoader();
56- InputStream in = cl.getResourceAsStream(
57- "jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getRecentEntries.json");
58-
59- return StringUtils.readString(in);
60- }
61-
62- @Override
63- public String saveComment(String email, String target, int year, int month,
64- int day, String comment) throws IOException {
65- return "";
66- }
67-
68-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getStatus.json (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getStatus.json (nonexistent)
@@ -1 +0,0 @@
1-{"point":"50.00","latestDate":"2010/07/23","firstDate":"2009/06/01","count":381,"status1":140,"status2":204,"status0":37}
\ No newline at end of file
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor.java (nonexistent)
@@ -1,47 +0,0 @@
1-package jp.sf.amateras.nikocale.android.accessor;
2-
3-import java.io.IOException;
4-
5-/**
6- * ニコカレのWeb APIにアクセスするためのインターフェースです。
7- *
8- * @author Naoki Takezoe
9- */
10-public interface NikoCaleAccessor {
11-
12- /**
13- * 指定した年月のデータがローカルにキャッシュされているかどうかを取得します。
14- */
15- public boolean hasCache(String email, int year, int month);
16-
17- /**
18- * 指定したユーザの一ヶ月分のデータを取得します。
19- */
20- public String getUserData(String email, int year, int month, boolean reload) throws IOException ;
21-
22- /**
23- * 指定したユーザ、年月日のエントリを取得します。
24- */
25- public String getUserData(String email, int year, int month, int day) throws IOException ;
26-
27- /**
28- * エントリを保存します。
29- */
30- public String saveEntry(String email, int year, int month, int day, int status, String message) throws IOException;
31-
32- /**
33- * コメントを保存します。
34- */
35- public String saveComment(String email, String target, int year, int month, int day, String comment) throws IOException;
36-
37- /**
38- * ユーザのステータスを取得します。
39- */
40- public String getStatus(String email) throws IOException;
41-
42- /**
43- * 最近更新されたニコカレを取得します。
44- */
45- public String getRecentEntries() throws IOException;
46-
47-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData1.json (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/accessor/NikoCaleAccessor_getUserData1.json (nonexistent)
@@ -1 +0,0 @@
1-[{"month":4,"year":2010,"day":1},{"month":4,"year":2010,"day":2},{"month":4,"year":2010,"day":3},{"addDate":1270391792989,"commentCount":null,"commentList":[],"day":4,"id":102,"member":{"formatPoint":"10.00","id":99,"image":false,"name":"test@example.com","point":10.0,"profile":null,"status0":0,"status1":2,"status2":0},"message":"あああ","month":4,"status":1,"updateDate":1270391813199,"userId":99,"year":2010},{"month":4,"year":2010,"day":5},{"month":4,"year":2010,"day":6},{"month":4,"year":2010,"day":7},{"month":4,"year":2010,"day":8},{"month":4,"year":2010,"day":9},{"month":4,"year":2010,"day":10},{"month":4,"year":2010,"day":11},{"month":4,"year":2010,"day":12},{"month":4,"year":2010,"day":13},{"month":4,"year":2010,"day":14},{"month":4,"year":2010,"day":15},{"month":4,"year":2010,"day":16},{"month":4,"year":2010,"day":17},{"month":4,"year":2010,"day":18},{"month":4,"year":2010,"day":19},{"month":4,"year":2010,"day":20},{"month":4,"year":2010,"day":21},{"month":4,"year":2010,"day":22},{"month":4,"year":2010,"day":23},{"month":4,"year":2010,"day":24},{"month":4,"year":2010,"day":25},{"month":4,"year":2010,"day":26},{"month":4,"year":2010,"day":27},{"month":4,"year":2010,"day":28},{"month":4,"year":2010,"day":29},{"month":4,"year":2010,"day":30}]
\ No newline at end of file
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/ResultBean.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/ResultBean.java (nonexistent)
@@ -1,21 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-/**
4- * 通信結果を格納するJavaBeanです。
5- *
6- * @author Naoki Takezoe
7- */
8-public class ResultBean {
9-
10- /**
11- * エラーがある場合、エラーメッセージがセットされます。
12- * エラーがない場合はnullです。
13- */
14- public String error = null;
15-
16- /**
17- * 通信結果のJSONがセットされます。
18- */
19- public String json = null;
20-
21-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/CommentTask.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/CommentTask.java (nonexistent)
@@ -1,50 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-import jp.sf.amateras.nikocale.android.CommentActivity;
4-import jp.sf.amateras.nikocale.android.Config;
5-import jp.sf.amateras.nikocale.android.R;
6-import jp.sf.amateras.nikocale.android.accessor.AccessorFactory;
7-import android.widget.EditText;
8-
9-/**
10- * コメントを投稿するためのタスクです。
11- *
12- * @author Naoki Takezoe
13- */
14-public class CommentTask extends AbstractTask {
15-
16- public CommentTask(CommentActivity commentActivity){
17- this.activity = commentActivity;
18- }
19-
20- @Override
21- protected String execute() throws Exception {
22- CommentActivity commentActivity = CommentActivity.class.cast(activity);
23-
24- Config config = Config.getInstance();
25- String email = config.getAddress();
26-
27- EditText commentText = (EditText) commentActivity.findViewById(R.id.CommentText);
28- String comment = commentText.getText().toString();
29- String target = commentActivity.getEmail();
30-
31- int year = commentActivity.getYear();
32- int month = commentActivity.getMonth();
33- int day = commentActivity.getDay();
34-
35- return AccessorFactory.getAccessor().saveComment(email,target, year, month, day, comment);
36- }
37-
38- @Override
39- protected void onPostExecute(ResultBean result) {
40- super.onPostExecute(result);
41-
42- if(result.error == null){
43- Config.getInstance().setRequiresReload();
44- }
45-
46- activity.finish();
47- }
48-
49-
50-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/AbstractTask.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/AbstractTask.java (nonexistent)
@@ -1,64 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-import jp.sf.amateras.nikocale.android.Constants;
4-import jp.sf.amateras.nikocale.android.util.DialogUtils;
5-import android.app.Activity;
6-import android.app.AlertDialog;
7-import android.os.AsyncTask;
8-
9-public abstract class AbstractTask extends AsyncTask<Void, Void, ResultBean>{
10-
11- protected AlertDialog alertDialog;
12- protected Activity activity;
13- protected IDataReceiver receiver;
14-
15- @Override
16- protected ResultBean doInBackground(Void... args) {
17- ResultBean resultBean = new ResultBean();
18- try {
19- String result = execute();
20- if(result.startsWith(Constants.ERROR_PREFIX)){
21- resultBean.error = result.substring(Constants.ERROR_PREFIX.length());
22- } else {
23- resultBean.json = result;
24- }
25- } catch(Exception ex){
26- resultBean.error = ex.toString();
27- }
28- return resultBean;
29- }
30-
31- protected abstract String execute() throws Exception;
32-
33- public void setDataReceiver(IDataReceiver receiver){
34- this.receiver = receiver;
35- }
36-
37- @Override
38- protected void onPreExecute() {
39- super.onPreExecute();
40- if(showDialog()){
41- alertDialog = DialogUtils.showBlockDialog("通信中です...", activity);
42- }
43- }
44-
45- @Override
46- protected void onPostExecute(ResultBean result) {
47- if(alertDialog != null){
48- alertDialog.cancel();
49- }
50- if(result.error != null){
51- DialogUtils.showDialog((String) result.error, activity, finishOnError());
52- }
53- }
54-
55- protected boolean showDialog(){
56- return true;
57- }
58-
59- protected boolean finishOnError(){
60- return false;
61- }
62-
63-
64-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetStatusTask.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetStatusTask.java (nonexistent)
@@ -1,71 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-import java.util.Map;
4-
5-import jp.sf.amateras.nikocale.android.Config;
6-import jp.sf.amateras.nikocale.android.R;
7-import jp.sf.amateras.nikocale.android.StatusActivity;
8-import jp.sf.amateras.nikocale.android.accessor.AccessorFactory;
9-import net.arnx.jsonic.JSON;
10-import android.widget.TextView;
11-
12-public class GetStatusTask extends AbstractTask {
13-
14- public GetStatusTask(StatusActivity statusActivity){
15- this.activity = statusActivity;
16- }
17-
18- @Override
19- protected void onPostExecute(ResultBean resultBean) {
20- super.onPostExecute(resultBean);
21-
22- if(resultBean.error != null){
23- return;
24- }
25-
26- @SuppressWarnings("unchecked")
27- Map<String, Object> result = (Map<String, Object>) JSON.decode(resultBean.json);
28-
29- if(result.containsKey("count")){
30- TextView count = (TextView) activity.findViewById(R.id.Count);
31- count.setText(result.get("count").toString() + "日");
32- }
33- if(result.containsKey("firstDate")){
34- TextView count = (TextView) activity.findViewById(R.id.FirstDate);
35- count.setText(result.get("firstDate").toString());
36- }
37- if(result.containsKey("latestDate")){
38- TextView count = (TextView) activity.findViewById(R.id.LatestDate);
39- count.setText(result.get("latestDate").toString());
40- }
41- if(result.containsKey("status0")){
42- TextView count = (TextView) activity.findViewById(R.id.Status0);
43- count.setText(result.get("status0").toString() + "日");
44- }
45- if(result.containsKey("status1")){
46- TextView count = (TextView) activity.findViewById(R.id.Status1);
47- count.setText(result.get("status1").toString() + "日");
48- }
49- if(result.containsKey("status2")){
50- TextView count = (TextView) activity.findViewById(R.id.Status2);
51- count.setText(result.get("status2").toString() + "日");
52- }
53- if(result.containsKey("point")){
54- TextView count = (TextView) activity.findViewById(R.id.Point);
55- count.setText(result.get("point").toString() + "pts");
56- }
57- }
58-
59- @Override
60- protected String execute() throws Exception {
61- Config config = Config.getInstance();
62- String email = config.getAddress();
63- return AccessorFactory.getAccessor().getStatus(email);
64- }
65-
66- @Override
67- protected boolean finishOnError() {
68- return true;
69- }
70-
71-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/IDataReceiver.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/IDataReceiver.java (nonexistent)
@@ -1,7 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-public interface IDataReceiver {
4-
5- public void setData(Object data);
6-
7-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetUserDataTask.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetUserDataTask.java (nonexistent)
@@ -1,64 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-import java.util.List;
4-import java.util.Map;
5-
6-import jp.sf.amateras.nikocale.android.CalendarActivity;
7-import jp.sf.amateras.nikocale.android.Config;
8-import jp.sf.amateras.nikocale.android.accessor.AccessorFactory;
9-import net.arnx.jsonic.JSON;
10-import android.app.Activity;
11-
12-/**
13- * ユーザの一ヶ月分のニコカレを取得するタスクです。
14- *
15- * @author Naoki Takezoe
16- */
17-public class GetUserDataTask extends AbstractTask {
18-
19- private int year;
20- private int month;
21- private boolean reload;
22-
23- public GetUserDataTask(IDataReceiver receiver, int year, int month, boolean reload){
24- this.activity = Activity.class.cast(receiver);
25- this.receiver = receiver;
26- this.year = year;
27- this.month = month;
28- this.reload = reload;
29- }
30-
31- @Override
32- protected void onPostExecute(ResultBean result) {
33- super.onPostExecute(result);
34- if(result.error == null && receiver != null){
35- @SuppressWarnings("unchecked")
36- List<Map<String, Object>> data = (List<Map<String, Object>>) JSON.decode(result.json);
37- receiver.setData(data);
38- }
39- }
40-
41- @Override
42- protected String execute() throws Exception {
43- String email = Config.getInstance().getAddress();
44- return AccessorFactory.getAccessor().getUserData(email, year, month, reload);
45- }
46-
47- @Override
48- protected boolean showDialog() {
49- if(reload == true){
50- return true;
51- }
52-
53- return !AccessorFactory.getAccessor().hasCache(Config.getInstance().getAddress(), year, month);
54- }
55-
56- @Override
57- protected boolean finishOnError() {
58- if(activity instanceof CalendarActivity){
59- return true;
60- }
61- return false;
62- }
63-
64-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetRecentEntriesTask.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetRecentEntriesTask.java (nonexistent)
@@ -1,32 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-import java.util.List;
4-import java.util.Map;
5-
6-import jp.sf.amateras.nikocale.android.RecentActivity;
7-import jp.sf.amateras.nikocale.android.accessor.AccessorFactory;
8-import net.arnx.jsonic.JSON;
9-
10-public class GetRecentEntriesTask extends AbstractTask {
11-
12- public GetRecentEntriesTask(RecentActivity recentActivity){
13- this.activity = recentActivity;
14- }
15-
16- @Override
17- protected String execute() throws Exception {
18- return AccessorFactory.getAccessor().getRecentEntries();
19- }
20-
21- @Override
22- protected void onPostExecute(ResultBean result) {
23- super.onPostExecute(result);
24- if(result.error == null && receiver != null){
25- @SuppressWarnings("unchecked")
26- List<Map<String, Object>> data = (List<Map<String, Object>>) JSON.decode(result.json);
27- receiver.setData(data);
28- }
29- }
30-
31-
32-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetEntryDataTask.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/GetEntryDataTask.java (nonexistent)
@@ -1,65 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-import jp.sf.amateras.nikocale.android.Config;
4-import jp.sf.amateras.nikocale.android.accessor.AccessorFactory;
5-import jp.sf.amateras.nikocale.android.util.StringUtils;
6-import android.app.Activity;
7-
8-/**
9- * ユーザの一日分のニコカレを取得するタスクです。
10- *
11- * @author Naoki Takezoe
12- */
13-public class GetEntryDataTask extends AbstractTask {
14-
15- private int year;
16- private int month;
17- private int day;
18- private boolean finishOnError;
19- private String email;
20-
21- public GetEntryDataTask(Activity activity, int year, int month, int day, boolean finishOnError){
22- this(activity, null, year, month, day, finishOnError);
23- }
24-
25- public GetEntryDataTask(Activity activity, String email, int year, int month, int day, boolean finishOnError){
26- this.activity = activity;
27- this.year = year;
28- this.month = month;
29- this.day = day;
30- this.finishOnError = finishOnError;
31- this.email = email;
32- }
33-
34- @Override
35- protected void onPostExecute(ResultBean result) {
36- boolean skipFlag = false;
37-
38- if(result.error != null || StringUtils.isEmpty(result.json)){
39- result.error = null;
40- skipFlag = true;
41- }
42-
43- super.onPostExecute(result);
44-
45- if(skipFlag == false && result.error == null && receiver != null){
46- receiver.setData(result.json);
47- }
48- }
49-
50- @Override
51- protected String execute() throws Exception {
52- if(email == null){
53- return AccessorFactory.getAccessor().getUserData(
54- Config.getInstance().getAddress(), year, month, day);
55- } else {
56- return AccessorFactory.getAccessor().getUserData(email, year, month, day);
57- }
58- }
59-
60- @Override
61- protected boolean finishOnError() {
62- return finishOnError;
63- }
64-
65-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/SaveEntryTask.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/task/SaveEntryTask.java (nonexistent)
@@ -1,66 +0,0 @@
1-package jp.sf.amateras.nikocale.android.task;
2-
3-import jp.sf.amateras.nikocale.android.Config;
4-import jp.sf.amateras.nikocale.android.Constants;
5-import jp.sf.amateras.nikocale.android.EntryActivity;
6-import jp.sf.amateras.nikocale.android.R;
7-import jp.sf.amateras.nikocale.android.accessor.AccessorFactory;
8-import android.widget.EditText;
9-import android.widget.RadioButton;
10-
11-/**
12- * エントリの保存を行うタスクです。
13- *
14- * @author Naoki Takezoe
15- */
16-public class SaveEntryTask extends AbstractTask {
17-
18- public SaveEntryTask(EntryActivity entryActivity){
19- this.activity = entryActivity;
20- }
21-
22- @Override
23- protected String execute() throws Exception {
24-
25- EntryActivity entryActivity = EntryActivity.class.cast(activity);
26-
27- Config config = Config.getInstance();
28- String email = config.getAddress();
29-
30- EditText messageText = (EditText) entryActivity.findViewById(R.id.EntryMessageText);
31- String message = messageText.getText().toString();
32-
33- RadioButton statusRadio1 = (RadioButton) entryActivity.findViewById(R.id.StatusRadio01);
34- RadioButton statusRadio2 = (RadioButton) entryActivity.findViewById(R.id.StatusRadio02);
35- RadioButton statusRadio3 = (RadioButton) entryActivity.findViewById(R.id.StatusRadio03);
36-
37- int status = 0;
38-
39- if(statusRadio1.isChecked()){
40- status = Constants.STATUS_GOOD;
41- } else if(statusRadio2.isChecked()){
42- status = Constants.STATUS_NORMAL;
43- } else if(statusRadio3.isChecked()){
44- status = Constants.STATUS_BAD;
45- }
46-
47- int year = entryActivity.getYear();
48- int month = entryActivity.getMonth();
49- int day = entryActivity.getDay();
50-
51- return AccessorFactory.getAccessor().saveEntry(email, year, month, day, status, message);
52- }
53-
54- @Override
55- protected void onPostExecute(ResultBean result) {
56- super.onPostExecute(result);
57-
58- if(result.error == null){
59- Config.getInstance().setRequiresReload();
60- }
61-
62- activity.finish();
63- }
64-
65-
66-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/adapter/CommentAdapter.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/adapter/CommentAdapter.java (nonexistent)
@@ -1,66 +0,0 @@
1-package jp.sf.amateras.nikocale.android.adapter;
2-
3-import java.text.SimpleDateFormat;
4-import java.util.Date;
5-import java.util.Map;
6-
7-import jp.sf.amateras.nikocale.android.R;
8-import android.content.Context;
9-import android.content.res.Resources;
10-import android.view.LayoutInflater;
11-import android.view.View;
12-import android.view.ViewGroup;
13-import android.widget.ArrayAdapter;
14-import android.widget.TextView;
15-
16-/**
17- * コメント一覧表示用のアダプタです。
18- *
19- * @author Naoki Takezoe
20- */
21-public class CommentAdapter extends ArrayAdapter<Map<String, Object>> {
22-
23- private LayoutInflater inflater;
24-
25- public CommentAdapter(Context context, int textViewResourceId, Resources r) {
26- super(context, textViewResourceId);
27- this.inflater = (LayoutInflater) context
28- .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
29- }
30-
31- @Override
32- public View getView(int position, View convertView, ViewGroup parent) {
33- // ビューを受け取る
34- View view = convertView;
35-
36- if (view == null) {
37- // 受け取ったビューがnullなら新しくビューを生成
38- view = inflater.inflate(R.layout.commentdata, null);
39- }
40-
41- // 表示すべきデータの取得
42- Map<String, Object> item = (Map<String, Object>) getItem(position);
43- if (item != null) {
44- TextView name = (TextView) view.findViewById(R.id.Name);
45- name.setText(item.get("userName").toString());
46-
47- long commentTime = Long.parseLong(item.get("commentDate").toString());
48- Date commentDate = new Date(commentTime);
49-
50- TextView comment = (TextView) view.findViewById(R.id.Comment);
51- comment.setText("「" + item.get("comment").toString() + "」 ");
52-
53- TextView dateTime = (TextView) view.findViewById(R.id.DateTime);
54- dateTime.setText(formatDate(commentDate));
55- }
56-
57- return view;
58- }
59-
60- private static SimpleDateFormat format = new SimpleDateFormat("yyyy/MM/dd HH:mm:SS");
61-
62- private static String formatDate(Date date){
63- return format.format(date);
64- }
65-
66-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/adapter/EntryAdapter.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/adapter/EntryAdapter.java (revision 305)
@@ -4,7 +4,6 @@
44 import java.util.Map;
55
66 import jp.sf.amateras.nikocale.android.Constants;
7-import jp.sf.amateras.nikocale.android.DetailActivity;
87 import jp.sf.amateras.nikocale.android.EntryActivity;
98 import jp.sf.amateras.nikocale.android.R;
109 import android.content.Context;
@@ -18,11 +17,10 @@
1817 import android.view.LayoutInflater;
1918 import android.view.MotionEvent;
2019 import android.view.View;
21-import android.view.ViewGroup;
2220 import android.view.View.OnClickListener;
2321 import android.view.View.OnTouchListener;
22+import android.view.ViewGroup;
2423 import android.widget.ArrayAdapter;
25-import android.widget.ImageButton;
2624 import android.widget.ImageView;
2725 import android.widget.TextView;
2826
@@ -98,6 +96,10 @@
9896 view.setOnClickListener(new OnClickListener() {
9997 @Override
10098 public void onClick(View v) {
99+ if(!editable){
100+ return;
101+ }
102+
101103 TextView textView = (TextView) v.findViewById(R.id.TextView01);
102104 String text = textView.getText().toString();
103105 String[] dim = text.split("/");
@@ -106,20 +108,12 @@
106108 selectedMonth = Integer.parseInt(dim[1]);
107109 selectedDay = Integer.parseInt(dim[2]);
108110
109- @SuppressWarnings("unchecked")
110- Map<String, Object> member = (Map<String, Object>) item.get("member");
111- String email = null;
112- if(member != null){
113- email = (String) member.get("email");
114- } else {
115- return;
116- }
111+ // エントリの入力・編集画面に遷移します
112+ Intent intent = new Intent(getContext(), EntryActivity.class);
113+ intent.putExtra("YEAR", selectedYear);
114+ intent.putExtra("MONTH", selectedMonth);
115+ intent.putExtra("DAY", selectedDay);
117116
118- Intent intent = new Intent(getContext(), DetailActivity.class);
119- intent.putExtra("email", email);
120- intent.putExtra("year", selectedYear);
121- intent.putExtra("month", selectedMonth);
122- intent.putExtra("day", selectedDay);
123117 getContext().startActivity(intent);
124118 }
125119 });
@@ -153,39 +147,11 @@
153147 weekText.setTextColor(ColorStateList.valueOf(Color.LTGRAY));
154148 }
155149
156- TextView textView = (TextView) view.findViewById(R.id.Name);
157- ImageButton button = (ImageButton) view.findViewById(R.id.InputButton);
158-
159- if(item.containsKey("member") && ! editable){
160- @SuppressWarnings("unchecked")
161- Map<String, Object> member = (Map<String, Object>) item.get("member");
162- textView.setText((String) member.get("name"));
163- button.setVisibility(View.GONE);
164-
165- } else {
166- textView.setText("");
167- button.setOnClickListener(new OnClickListener() {
168- @Override
169- public void onClick(View v) {
170- // エントリの入力・編集画面に遷移します
171- Intent intent = new Intent(v.getContext(), EntryActivity.class);
172- intent.putExtra("YEAR", year);
173- intent.putExtra("MONTH", month);
174- intent.putExtra("DAY", day);
175-
176- v.getContext().startActivity(intent);
177- }
178- });
179- }
180-
181150 String message = "";
182151 if(item.containsKey("message")){
183152 message = (String) item.get("message");
184153 }
185- if(item.get("commentCount") != null){
186- message = message + String.format(
187- " (%s件のコメントがあります)", item.get("commentCount").toString());
188- }
154+
189155 TextView messageText = (TextView)view.findViewById(R.id.TextView02);
190156 messageText.setText(message);
191157
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/MainActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/MainActivity.java (revision 305)
@@ -1,15 +1,18 @@
11 package jp.sf.amateras.nikocale.android;
22
3+import java.util.ArrayList;
34 import java.util.Calendar;
5+import java.util.HashMap;
46 import java.util.List;
57 import java.util.Map;
68
79 import jp.sf.amateras.nikocale.android.adapter.EntryAdapter;
8-import jp.sf.amateras.nikocale.android.task.GetUserDataTask;
9-import jp.sf.amateras.nikocale.android.task.IDataReceiver;
1010 import jp.sf.amateras.nikocale.android.util.DialogUtils;
11+import jp.sf.amateras.nikocale.android.util.NikocaleSQLiteOpenHelper;
1112 import android.app.Activity;
1213 import android.content.Intent;
14+import android.database.Cursor;
15+import android.database.sqlite.SQLiteDatabase;
1316 import android.os.Bundle;
1417 import android.view.Menu;
1518 import android.view.MenuItem;
@@ -23,24 +26,26 @@
2326 *
2427 * @author Naoki Takezoe
2528 */
26-public class MainActivity extends Activity implements IDataReceiver {
29+public class MainActivity extends Activity {
2730
2831 private int year;
2932 private int month;
3033 private EntryAdapter arrayAdapter;
3134
35+ public static NikocaleSQLiteOpenHelper engine;
36+
3237 /** Called when the activity is first created. */
3338 @Override
3439 public void onCreate(Bundle savedInstanceState) {
3540 super.onCreate(savedInstanceState);
3641
42+ // データベースの準備
43+ engine = new NikocaleSQLiteOpenHelper(getApplicationContext());
44+
3745 Calendar cal = Calendar.getInstance();
3846 year = cal.get(Calendar.YEAR);
3947 month = cal.get(Calendar.MONTH) + 1;
4048
41- Config.init(getSharedPreferences(
42- Config.PREF_NAME, MODE_WORLD_READABLE | MODE_WORLD_WRITEABLE));
43-
4449 setContentView(R.layout.main);
4550
4651 Button button1 = (Button) findViewById(R.id.Button01);
@@ -86,25 +91,13 @@
8691 ListView list = (ListView) findViewById(R.id.ListView01);
8792 list.setAdapter(arrayAdapter);
8893
89- // 未設定の場合は設定画面を表示
90- if(!Config.getInstance().isEnable()){
91- Intent intent = new Intent(getApplicationContext(), ConfigActivity.class);
92- startActivity(intent);
93- } else {
94- Config.getInstance().requiresReload();
95- refleshList(true);
96- }
94+ refleshList(true);
9795 }
9896
9997 @Override
10098 public void onStart(){
10199 super.onStart();
102-
103- if(Config.getInstance().isEnable() && Config.getInstance().requiresReload()){
104- refleshList(true);
105- } else {
106- refleshList(false);
107- }
100+ refleshList(true);
108101 }
109102
110103 /**
@@ -112,9 +105,50 @@
112105 */
113106 public void refleshList(boolean reload) {
114107 try {
115- GetUserDataTask task = new GetUserDataTask(this, year, month, reload);
116- task.execute((Void[]) null);
117108 setTitle(String.format("%d年%d月のニコカレ", year, month));
109+
110+ SQLiteDatabase db = engine.getReadableDatabase();
111+ List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
112+
113+ Calendar cal = Calendar.getInstance();
114+ cal.set(Calendar.YEAR, year);
115+ cal.set(Calendar.MONTH, month - 1);
116+ cal.set(Calendar.DAY_OF_MONTH, 1);
117+
118+ while(month == cal.get(Calendar.MONTH) + 1){
119+ Cursor cursor = db.rawQuery("SELECT YEAR, MONTH, DAY, STATUS, MESSAGE " +
120+ "FROM CALENDAR WHERE YEAR=? AND MONTH=? AND DAY=? ORDER BY DAY",
121+ new String[]{
122+ String.valueOf(year),
123+ String.valueOf(month),
124+ String.valueOf(cal.get(Calendar.DAY_OF_MONTH))});
125+
126+ cursor.moveToFirst();
127+
128+ if (cursor.getCount() > 0) {
129+ Map<String, Object> map = new HashMap<String, Object>();
130+ map.put("year", cursor.getInt(0));
131+ map.put("month", cursor.getInt(1));
132+ map.put("day", cursor.getInt(2));
133+ map.put("status", cursor.getInt(3));
134+ map.put("message", cursor.getString(4));
135+ data.add(map);
136+
137+ } else {
138+ Map<String, Object> map = new HashMap<String, Object>();
139+ map.put("year", year);
140+ map.put("month", month);
141+ map.put("day", cal.get(Calendar.DAY_OF_MONTH));
142+ data.add(map);
143+ }
144+
145+ cursor.close();
146+
147+ cal.add(Calendar.DAY_OF_MONTH, 1);
148+ }
149+
150+ setData(data);
151+
118152 } catch (Exception ex) {
119153 DialogUtils.showDialog(ex.toString(), this);
120154 }
@@ -123,56 +157,28 @@
123157 @Override
124158 public boolean onCreateOptionsMenu(Menu menu) {
125159 boolean result = super.onCreateOptionsMenu(menu);
126- menu.add(Menu.NONE, Constants.MENU_CONFIG, Menu.NONE, "アカウント設定").setIcon(android.R.drawable.ic_menu_manage);
127160 menu.add(Menu.NONE, Constants.MENU_ENTRY, Menu.NONE, "今日のニコカレ").setIcon(android.R.drawable.ic_menu_edit);
128161 menu.add(Menu.NONE, Constants.MENU_CALENDAR, Menu.NONE, "カレンダ表示").setIcon(android.R.drawable.ic_menu_my_calendar);
129- menu.add(Menu.NONE, Constants.MENU_STATUS, Menu.NONE, "ステータス表示").setIcon(android.R.drawable.ic_menu_info_details);
130- menu.add(Menu.NONE, Constants.MENU_RECENT, Menu.NONE, "最近のニコカレ").setIcon(android.R.drawable.ic_menu_recent_history);
131162 return result;
132163 }
133164
134165 @Override
135166 public boolean onOptionsItemSelected(MenuItem item) {
136- if(item.getItemId() == Constants.MENU_CONFIG){
137- Intent intent = new Intent(getApplicationContext(), ConfigActivity.class);
167+ if(item.getItemId() == Constants.MENU_ENTRY){
168+ Intent intent = new Intent(getApplicationContext(), EntryActivity.class);
138169 startActivity(intent);
139- } else if(item.getItemId() == Constants.MENU_ENTRY){
140- if(Config.getInstance().isEnable()){
141- Intent intent = new Intent(getApplicationContext(), EntryActivity.class);
142- startActivity(intent);
143- } else {
144- DialogUtils.showDialog("最初にアカウントの設定を行ってください", this);
145- }
146170 } else if(item.getItemId() == Constants.MENU_CALENDAR){
147- if(Config.getInstance().isEnable()){
148- // TODO 年月日をカレンダ表示に引き継ぐ
149- Intent intent = new Intent(getApplicationContext(), CalendarActivity.class);
150- startActivity(intent);
151- } else {
152- DialogUtils.showDialog("最初にアカウントの設定を行ってください", this);
153- }
154- } else if(item.getItemId() == Constants.MENU_STATUS){
155- if(Config.getInstance().isEnable()){
156- Intent intent = new Intent(getApplicationContext(), StatusActivity.class);
157- startActivity(intent);
158- } else {
159- DialogUtils.showDialog("最初にアカウントの設定を行ってください", this);
160- }
161- } else if(item.getItemId() == Constants.MENU_RECENT){
162- Intent intent = new Intent(getApplicationContext(), RecentActivity.class);
171+ // TODO 年月日をカレンダ表示に引き継ぐ
172+ Intent intent = new Intent(getApplicationContext(), CalendarActivity.class);
163173 startActivity(intent);
164174 }
165175 return true;
166176 }
167177
168- @Override
169- @SuppressWarnings("unchecked")
170- public void setData(Object data) {
171- List<Map<String, Object>> result = (List<Map<String, Object>>) data;
172-
178+ public void setData(List<Map<String, Object>> data) {
173179 arrayAdapter.clear();
174180
175- for(Map<String, Object> map: result){
181+ for(Map<String, Object> map: data){
176182 arrayAdapter.add(map);
177183 }
178184 }
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/CalendarActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/CalendarActivity.java (revision 305)
@@ -1,17 +1,17 @@
11 package jp.sf.amateras.nikocale.android;
22
3+import java.util.ArrayList;
34 import java.util.Calendar;
5+import java.util.HashMap;
46 import java.util.List;
57 import java.util.Map;
68 import java.util.concurrent.atomic.AtomicBoolean;
79
8-import jp.sf.amateras.nikocale.android.task.GetUserDataTask;
9-import jp.sf.amateras.nikocale.android.task.IDataReceiver;
1010 import jp.sf.amateras.nikocale.android.util.DialogUtils;
1111 import android.app.Activity;
12-import android.app.AlertDialog;
13-import android.content.DialogInterface;
1412 import android.content.Intent;
13+import android.database.Cursor;
14+import android.database.sqlite.SQLiteDatabase;
1515 import android.graphics.Bitmap;
1616 import android.graphics.BitmapFactory;
1717 import android.graphics.Color;
@@ -29,7 +29,7 @@
2929 *
3030 * @author Naoki Takezoe
3131 */
32-public class CalendarActivity extends Activity implements IDataReceiver {
32+public class CalendarActivity extends Activity {
3333
3434 private Bitmap good32_normal;
3535 private Bitmap good32_comment;
@@ -102,10 +102,7 @@
102102 @Override
103103 public void onStart(){
104104 super.onStart();
105-
106- if(Config.getInstance().isEnable() && Config.getInstance().requiresReload()){
107- refleshCalendar(true);
108- }
105+ refleshCalendar(true);
109106 }
110107
111108
@@ -254,22 +251,55 @@
254251 */
255252 public void refleshCalendar(boolean reload) {
256253 try {
257- GetUserDataTask task = new GetUserDataTask(this, year, month, reload);
258- task.setDataReceiver(this);
259- task.execute((Void[]) null);
260-// setTitle(String.format("%d年%d月のニコカレ", year, month));
254+ SQLiteDatabase db = MainActivity.engine.getReadableDatabase();
255+ List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
261256
257+ Calendar cal = Calendar.getInstance();
258+ cal.set(Calendar.YEAR, year);
259+ cal.set(Calendar.MONTH, month - 1);
260+ cal.set(Calendar.DAY_OF_MONTH, 1);
261+
262+ while(month == cal.get(Calendar.MONTH) + 1){
263+ Cursor cursor = db.rawQuery("SELECT YEAR, MONTH, DAY, STATUS, MESSAGE " +
264+ "FROM CALENDAR WHERE YEAR=? AND MONTH=? AND DAY=? ORDER BY DAY",
265+ new String[]{
266+ String.valueOf(year),
267+ String.valueOf(month),
268+ String.valueOf(cal.get(Calendar.DAY_OF_MONTH))});
269+
270+ cursor.moveToFirst();
271+
272+ if (cursor.getCount() > 0) {
273+ Map<String, Object> map = new HashMap<String, Object>();
274+ map.put("year", cursor.getInt(0));
275+ map.put("month", cursor.getInt(1));
276+ map.put("day", cursor.getInt(2));
277+ map.put("status", cursor.getInt(3));
278+ map.put("message", cursor.getString(4));
279+ data.add(map);
280+
281+ } else {
282+ Map<String, Object> map = new HashMap<String, Object>();
283+ map.put("year", year);
284+ map.put("month", month);
285+ map.put("day", cal.get(Calendar.DAY_OF_MONTH));
286+ data.add(map);
287+ }
288+
289+ cursor.close();
290+
291+ cal.add(Calendar.DAY_OF_MONTH, 1);
292+ }
293+
294+ setData(data);
295+
262296 } catch (Exception ex) {
263297 DialogUtils.showDialog(ex.toString(), this);
264298 }
265299 }
266300
267- @Override
268- public void setData(Object data) {
301+ public void setData(List<Map<String, Object>> data) {
269302
270- @SuppressWarnings("unchecked")
271- List<Map<String, Object>> result = (List<Map<String, Object>>) data;
272-
273303 makeCalendar();
274304
275305 Calendar cal = Calendar.getInstance();
@@ -298,7 +328,7 @@
298328 i = i + 6; break;
299329 }
300330
301- for(Map<String, Object> item: result){
331+ for(Map<String, Object> item: data){
302332 final int year = Integer.parseInt(item.get("year").toString());
303333 final int month = Integer.parseInt(item.get("month").toString());
304334 final int day = Integer.parseInt(item.get("day").toString());
@@ -365,28 +395,8 @@
365395 image.setOnClickListener(new OnClickListener() {
366396 @Override
367397 public void onClick(final View v) {
368-
369- if(hasStatus.get()){
370- // ニコカレが登録済みの場合
371- new AlertDialog.Builder(CalendarActivity.this)
372- .setItems(new String[]{"ニコカレの編集", "コメントの参照・投稿"},
373- new android.content.DialogInterface.OnClickListener() {
374- @Override
375- public void onClick(DialogInterface dialog, int which) {
376- if(which == 0){
377- // 入力画面に遷移
378- moveToEntryActivity(v, year, month, day);
379- } else if(which == 1){
380- // 詳細画面に遷移
381- moveToDetailActivity(v, year, month, day);
382- }
383- }
384- })
385- .show();
386- } else {
387- // ニコカレが登録されていない場合は入力画面に遷移
388- moveToEntryActivity(v, year, month, day);
389- }
398+ // 入力画面に遷移
399+ moveToEntryActivity(v, year, month, day);
390400 }
391401 });
392402
@@ -406,16 +416,4 @@
406416 v.getContext().startActivity(intent);
407417 }
408418
409- /**
410- * コメントの参照・編集画面に遷移します。
411- */
412- private void moveToDetailActivity(final View v, int year, int month, int day){
413- Intent intent = new Intent(v.getContext(), DetailActivity.class);
414- intent.putExtra("email", Config.getInstance().getAddress());
415- intent.putExtra("year", year);
416- intent.putExtra("month", month);
417- intent.putExtra("day", day);
418- v.getContext().startActivity(intent);
419- }
420-
421419 }
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/Constants.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/Constants.java (revision 305)
@@ -8,10 +8,10 @@
88 public static final int STATUS_NORMAL = 1;
99 public static final int STATUS_BAD = 2;
1010
11- public static final int MENU_CONFIG = 0;
11+// public static final int MENU_CONFIG = 0;
1212 public static final int MENU_ENTRY = 1;
1313 public static final int MENU_CALENDAR = 2;
14- public static final int MENU_STATUS = 3;
15- public static final int MENU_RECENT = 4;
14+// public static final int MENU_STATUS = 3;
15+// public static final int MENU_RECENT = 4;
1616
1717 }
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/util/NikocaleSQLiteOpenHelper.java (nonexistent)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/util/NikocaleSQLiteOpenHelper.java (revision 305)
@@ -0,0 +1,31 @@
1+package jp.sf.amateras.nikocale.android.util;
2+
3+import android.content.Context;
4+import android.database.sqlite.SQLiteDatabase;
5+import android.database.sqlite.SQLiteOpenHelper;
6+
7+public class NikocaleSQLiteOpenHelper extends SQLiteOpenHelper {
8+
9+ public NikocaleSQLiteOpenHelper(Context context){
10+ super(context, "NIKOCALE", null, 1);
11+ }
12+
13+ @Override
14+ public void onCreate(SQLiteDatabase db) {
15+ // カレンダのデータを格納するためのテーブルを作成
16+ db.execSQL("CREATE TABLE CALENDAR (" +
17+ "YEAR INTEGER NOT NULL, " +
18+ "MONTH INTEGER NOT NULL, " +
19+ "DAY INTEGER NOT NULL, " +
20+ "STATUS INTEGER NOT NULL, " +
21+ "MESSAGE TEXT," +
22+ "PRIMARY KEY (YEAR, MONTH, DAY))");
23+ }
24+
25+ @Override
26+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
27+ // TODO 自動生成されたメソッド・スタブ
28+
29+ }
30+
31+}
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/EntryActivity.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/src/jp/sf/amateras/nikocale/android/EntryActivity.java (revision 305)
@@ -1,14 +1,14 @@
11 package jp.sf.amateras.nikocale.android;
22
33 import java.util.Calendar;
4+import java.util.HashMap;
45 import java.util.Map;
56
6-import jp.sf.amateras.nikocale.android.task.GetEntryDataTask;
7-import jp.sf.amateras.nikocale.android.task.IDataReceiver;
8-import jp.sf.amateras.nikocale.android.task.SaveEntryTask;
97 import jp.sf.amateras.nikocale.android.util.DialogUtils;
10-import net.arnx.jsonic.JSON;
118 import android.app.Activity;
9+import android.database.Cursor;
10+import android.database.sqlite.SQLiteDatabase;
11+import android.database.sqlite.SQLiteStatement;
1212 import android.os.Bundle;
1313 import android.view.View;
1414 import android.view.View.OnClickListener;
@@ -22,7 +22,7 @@
2222 *
2323 * @author Naoki Takezoe
2424 */
25-public class EntryActivity extends Activity implements IDataReceiver {
25+public class EntryActivity extends Activity {
2626
2727 private int year;
2828 private int month;
@@ -61,9 +61,38 @@
6161 return;
6262 }
6363
64- SaveEntryTask task = new SaveEntryTask(EntryActivity.this);
65- task.execute((Void[]) null);
64+ int status = 0;
6665
66+ if(status1.isChecked()){
67+ status = Constants.STATUS_GOOD;
68+ } else if(status2.isChecked()){
69+ status = Constants.STATUS_NORMAL;
70+ } else if(status3.isChecked()){
71+ status = Constants.STATUS_BAD;
72+ }
73+
74+ EditText messageText = (EditText) findViewById(R.id.EntryMessageText);
75+ String message = messageText.getText().toString();
76+
77+ SQLiteDatabase db = MainActivity.engine.getWritableDatabase();
78+ db.beginTransaction();
79+ try {
80+ SQLiteStatement stmt = db.compileStatement("INSERT INTO CALENDAR " +
81+ "(YEAR, MONTH, DAY, STATUS, MESSAGE) VALUES (?, ?, ?, ?, ?);");
82+ stmt.bindLong(1, year);
83+ stmt.bindLong(2, month);
84+ stmt.bindLong(3, day);
85+ stmt.bindLong(4, status);
86+ stmt.bindString(5, message);
87+ stmt.executeInsert();
88+
89+ db.setTransactionSuccessful();
90+ } finally {
91+ db.endTransaction();
92+ }
93+
94+ finish();
95+
6796 } catch (Exception ex) {
6897 DialogUtils.showDialog(ex.toString(), EntryActivity.this);
6998 }
@@ -70,11 +99,30 @@
7099 }
71100 });
72101
102+ // 初期データの取得
73103 try {
74- GetEntryDataTask task = new GetEntryDataTask(this, year, month, day, true);
75- task.setDataReceiver(this);
76- task.execute((Void[]) null);
104+ SQLiteDatabase db = MainActivity.engine.getReadableDatabase();
105+ Cursor cursor = db.rawQuery("SELECT YEAR, MONTH, DAY, STATUS, MESSAGE " +
106+ "FROM CALENDAR WHERE YEAR=? AND MONTH=? AND DAY=? ORDER BY DAY",
107+ new String[]{
108+ String.valueOf(year),
109+ String.valueOf(month),
110+ String.valueOf(day)});
77111
112+ cursor.moveToFirst();
113+
114+ if (cursor.getCount() > 0) {
115+ Map<String, Object> map = new HashMap<String, Object>();
116+ map.put("year", cursor.getInt(0));
117+ map.put("month", cursor.getInt(1));
118+ map.put("day", cursor.getInt(2));
119+ map.put("status", cursor.getInt(3));
120+ map.put("message", cursor.getString(4));
121+ setData(map);
122+ }
123+
124+ cursor.close();
125+
78126 } catch (Exception ex) {
79127 DialogUtils.showDialog(ex.toString(), this);
80128 }
@@ -81,14 +129,11 @@
81129
82130 }
83131
84- public void setData(Object data){
85- if(data == null){
132+ public void setData(Map<String, Object> entry){
133+ if(entry == null){
86134 return;
87135 }
88136
89- @SuppressWarnings("unchecked")
90- Map<String, Object> entry = (Map<String, Object>) JSON.decode((String) data);
91-
92137 if(entry.containsKey("status")){
93138 int status = Integer.parseInt(entry.get("status").toString());
94139 if(status == Constants.STATUS_GOOD){
@@ -109,16 +154,4 @@
109154 editText.setText((String) entry.get("message"));
110155 }
111156
112- public int getYear() {
113- return year;
114- }
115-
116- public int getMonth() {
117- return month;
118- }
119-
120- public int getDay() {
121- return day;
122- }
123-
124157 }
--- nikocale_android/trunk/nikocale_android/gen/jp/sf/amateras/nikocale/android/R.java (revision 304)
+++ nikocale_android/trunk/nikocale_android/gen/jp/sf/amateras/nikocale/android/R.java (revision 305)
@@ -28,7 +28,6 @@
2828 public static final int normal32_comment=0x7f02000a;
2929 }
3030 public static final class id {
31- public static final int Blank=0x7f06005f;
3231 public static final int Button01=0x7f060003;
3332 public static final int ButtonNextMonth=0x7f060004;
3433 public static final int ButtonPrevMonth=0x7f060002;
@@ -74,18 +73,9 @@
7473 public static final int Calendar7=0x7f06000b;
7574 public static final int Calendar8=0x7f060013;
7675 public static final int Calendar9=0x7f060014;
77- public static final int Comment=0x7f06005d;
78- public static final int CommentList_empty=0x7f060067;
79- public static final int CommentList_list=0x7f060066;
80- public static final int CommentText=0x7f06005a;
81- public static final int Count=0x7f060071;
82- public static final int DateTime=0x7f060060;
83- public static final int DayOfWeek=0x7f06006f;
84- public static final int EditText01=0x7f060062;
85- public static final int EditText02=0x7f060064;
86- public static final int EntryMessageText=0x7f06006c;
87- public static final int EntrySaveButton=0x7f06006d;
88- public static final int FirstDate=0x7f060072;
76+ public static final int DayOfWeek=0x7f060062;
77+ public static final int EntryMessageText=0x7f06005f;
78+ public static final int EntrySaveButton=0x7f060060;
8979 public static final int Image1=0x7f06000c;
9080 public static final int Image10=0x7f06001c;
9181 public static final int Image11=0x7f06001d;
@@ -128,38 +118,24 @@
128118 public static final int Image7=0x7f060012;
129119 public static final int Image8=0x7f06001a;
130120 public static final int Image9=0x7f06001b;
131- public static final int ImageView01=0x7f060065;
132- public static final int InputButton=0x7f060070;
133- public static final int LatestDate=0x7f060073;
134- public static final int ListView01=0x7f06006e;
135- public static final int Name=0x7f06005c;
136- public static final int Point=0x7f060077;
137- public static final int RadioGroup01=0x7f060068;
138- public static final int SendComment=0x7f06005b;
139- public static final int Status0=0x7f060074;
140- public static final int Status1=0x7f060075;
141- public static final int Status2=0x7f060076;
142- public static final int StatusRadio01=0x7f060069;
143- public static final int StatusRadio02=0x7f06006a;
144- public static final int StatusRadio03=0x7f06006b;
121+ public static final int ImageView01=0x7f060064;
122+ public static final int ListView01=0x7f060061;
123+ public static final int Name=0x7f060063;
124+ public static final int RadioGroup01=0x7f06005b;
125+ public static final int StatusRadio01=0x7f06005c;
126+ public static final int StatusRadio02=0x7f06005d;
127+ public static final int StatusRadio03=0x7f06005e;
145128 public static final int TableLayout01=0x7f060000;
146129 public static final int TableRow01=0x7f060001;
147- public static final int TableRow02=0x7f06005e;
148- public static final int TextView01=0x7f060061;
149- public static final int TextView02=0x7f060063;
150- public static final int TextView03=0x7f060059;
130+ public static final int TextView01=0x7f06005a;
131+ public static final int TextView02=0x7f060065;
132+ public static final int scroller=0x7f060059;
151133 }
152134 public static final class layout {
153135 public static final int calendar=0x7f030000;
154- public static final int comment=0x7f030001;
155- public static final int commentdata=0x7f030002;
156- public static final int config=0x7f030003;
157- public static final int detail=0x7f030004;
158- public static final int entry=0x7f030005;
159- public static final int main=0x7f030006;
160- public static final int recent=0x7f030007;
161- public static final int rowdata=0x7f030008;
162- public static final int status=0x7f030009;
136+ public static final int entry=0x7f030001;
137+ public static final int main=0x7f030002;
138+ public static final int rowdata=0x7f030003;
163139 }
164140 public static final class string {
165141 public static final int app_name=0x7f040000;
--- nikocale_android/trunk/nikocale_android/res/layout/recent.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/res/layout/recent.xml (nonexistent)
@@ -1,8 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3- android:orientation="vertical" android:layout_width="fill_parent"
4- android:layout_height="fill_parent">
5- <ListView android:id="@+id/ListView01" android:layout_width="fill_parent"
6- android:layout_height="wrap_content">
7- </ListView>
8-</LinearLayout>
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/res/layout/config.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/res/layout/config.xml (nonexistent)
@@ -1,26 +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" android:layout_height="wrap_content"
4- android:orientation="vertical">
5- <TableLayout android:id="@+id/TableLayout01"
6- android:layout_width="fill_parent" android:layout_height="wrap_content"
7- android:stretchColumns="1" android:shrinkColumns="0">
8- <TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent"
9- android:layout_height="wrap_content">
10- <TextView android:text="メールアドレス" android:id="@+id/TextView01"
11- android:layout_width="wrap_content" android:layout_height="wrap_content" />
12- <jp.sf.amateras.nikocale.android.widget.Text android:text="" android:id="@+id/EditText01" android:singleLine="true"
13- android:layout_width="fill_parent" android:layout_height="wrap_content" />
14- </TableRow>
15- <TableRow android:id="@+id/TableRow01" android:layout_width="fill_parent"
16- android:layout_height="wrap_content">
17- <TextView android:text="パスワード" android:id="@+id/TextView02"
18- android:layout_width="wrap_content" android:layout_height="wrap_content" />
19- <jp.sf.amateras.nikocale.android.widget.Text android:text="" android:id="@+id/EditText02" android:singleLine="true"
20- android:password="true"
21- android:layout_width="fill_parent" android:layout_height="wrap_content" />
22- </TableRow>
23- </TableLayout>
24- <Button android:text="設定を保存" android:id="@+id/Button01"
25- android:layout_width="fill_parent" android:layout_height="wrap_content"></Button>
26-</LinearLayout>
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/res/layout/detail.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/res/layout/detail.xml (nonexistent)
@@ -1,28 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3- android:orientation="vertical" android:layout_width="fill_parent"
4- android:layout_height="fill_parent">
5-
6- <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content">
7- <ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"
8- android:padding="2px"></ImageView>
9- <TextView android:id="@+id/TextView01" android:layout_width="fill_parent"
10- android:layout_height="wrap_content" android:textSize="20px" android:paddingBottom="4px"></TextView>
11- </LinearLayout>
12-
13- <!-- コメントの一覧 -->
14- <TextView android:id="@+id/TextView02" android:layout_width="fill_parent"
15- android:layout_height="wrap_content" android:text="コメント" android:background="@android:color/darker_gray"
16- android:textColor="@android:color/secondary_text_light" android:padding="2px">
17- </TextView>
18-
19- <ListView android:id="@+id/CommentList:list" android:layout_width="fill_parent"
20- android:layout_height="wrap_content">
21- </ListView>
22- <TextView android:id="@+id/CommentList:empty" android:layout_width="wrap_content"
23- android:layout_height="wrap_content" android:text="コメントはありません"></TextView>
24-
25- <!-- コメントの入力 -->
26- <Button android:text="コメントの投稿" android:id="@+id/SendComment" android:layout_width="fill_parent"
27- android:layout_height="wrap_content"></Button>
28-</LinearLayout>
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/res/layout/status.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/res/layout/status.xml (nonexistent)
@@ -1,48 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<TableLayout
3- xmlns:android="http://schemas.android.com/apk/res/android"
4- android:layout_width="wrap_content"
5- android:layout_height="wrap_content">
6- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
7- <TextView android:id="@+id/TextView01" android:text="ニコカレをつけた日数:"
8- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
9- <TextView android:id="@+id/Count"
10- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
11- </TableRow>
12- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
13- <TextView android:id="@+id/TextView01" android:text="最初のニコカレ:"
14- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
15- <TextView android:id="@+id/FirstDate"
16- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
17- </TableRow>
18- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
19- <TextView android:id="@+id/TextView01" android:text="最後のニコカレ:"
20- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
21- <TextView android:id="@+id/LatestDate"
22- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
23- </TableRow>
24- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
25- <TextView android:id="@+id/TextView01" android:text="ニコニコの日数:"
26- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
27- <TextView android:id="@+id/Status0"
28- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
29- </TableRow>
30- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
31- <TextView android:id="@+id/TextView01" android:text="普通の日数:"
32- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
33- <TextView android:id="@+id/Status1"
34- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
35- </TableRow>
36- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
37- <TextView android:id="@+id/TextView01" android:text="ダメダメの日数:"
38- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
39- <TextView android:id="@+id/Status2"
40- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
41- </TableRow>
42- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content" android:layout_height="wrap_content">
43- <TextView android:id="@+id/TextView01" android:text="ニコニコポイント:"
44- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
45- <TextView android:id="@+id/Point"
46- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
47- </TableRow>
48-</TableLayout>
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/res/layout/comment.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/res/layout/comment.xml (nonexistent)
@@ -1,15 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3- android:orientation="vertical" android:layout_width="fill_parent"
4- android:layout_height="fill_parent">
5-
6- <!-- コメントの入力 -->
7- <TextView android:id="@+id/TextView03" android:layout_width="fill_parent"
8- android:layout_height="wrap_content" android:text="コメントを入力してください" android:padding="2px">
9- </TextView>
10- <EditText android:id="@+id/CommentText" android:layout_width="fill_parent"
11- android:layout_height="wrap_content" ></EditText>
12- <Button android:text="コメントの送信" android:id="@+id/SendComment" android:layout_width="fill_parent"
13- android:layout_height="wrap_content"></Button>
14-
15-</LinearLayout>
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/res/layout/commentdata.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/res/layout/commentdata.xml (nonexistent)
@@ -1,27 +0,0 @@
1-<?xml version="1.0" encoding="utf-8"?>
2-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3- android:orientation="vertical" android:layout_width="fill_parent"
4- android:layout_height="wrap_content">
5- <TableLayout android:id="@+id/TableLayout01"
6- android:layout_width="fill_parent" android:layout_height="wrap_content"
7- xmlns:android="http://schemas.android.com/apk/res/android"
8- android:shrinkColumns="1">
9- <TableRow android:id="@+id/TableRow01" android:layout_width="wrap_content"
10- android:layout_height="wrap_content">
11- <TextView android:text="" android:id="@+id/Name"
12- android:layout_width="wrap_content" android:layout_height="wrap_content"
13- android:textColor="@android:color/primary_text_dark"></TextView>
14- <TextView android:text="" android:id="@+id/Comment"
15- android:layout_width="fill_parent" android:layout_height="wrap_content"
16- android:textColor="@android:color/primary_text_dark"></TextView>
17- </TableRow>
18- <TableRow android:id="@+id/TableRow02" android:layout_width="wrap_content"
19- android:layout_height="wrap_content">
20- <TextView android:text="" android:id="@+id/Blank"
21- android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
22- <TextView android:text="" android:id="@+id/DateTime"
23- android:layout_width="wrap_content" android:layout_height="wrap_content"
24- android:textColor="@android:color/darker_gray"></TextView>
25- </TableRow>
26- </TableLayout>
27-</LinearLayout>
\ No newline at end of file
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- nikocale_android/trunk/nikocale_android/res/layout/rowdata.xml (revision 304)
+++ nikocale_android/trunk/nikocale_android/res/layout/rowdata.xml (revision 305)
@@ -25,8 +25,10 @@
2525 android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView>
2626 <TextView android:text="" android:id="@+id/TextView02" android:autoLink="all"
2727 android:layout_width="wrap_content" android:layout_height="wrap_content" ></TextView>
28+ <!--
2829 <ImageButton android:id="@+id/InputButton" android:layout_width="wrap_content" android:layout_height="wrap_content"
2930 android:src="@drawable/calendar_edit"></ImageButton>
31+ -->
3032 </TableRow>
3133 </TableLayout>
3234 </LinearLayout>
\ No newline at end of file
Show on old repository browser