• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

Commit MetaInfo

Révision6c1f19dc317d0ac7a3f574eb991928a14cd2296a (tree)
l'heure2012-10-12 21:31:07
AuteurKodakana <kodakana@user...>
CommiterKodakana

Message de Log

targetSdkVersion を 14 に変更。自動削除を追加。

Change Summary

Modification

--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,17 +1,18 @@
11 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
22 package="org.pulpdust.snappingcamera"
3- android:versionCode="1"
4- android:versionName="0.5"
3+ android:versionCode="2"
4+ android:versionName="0.6"
55 android:installLocation="auto" >
66
77 <uses-sdk
88 android:minSdkVersion="4"
9- android:targetSdkVersion="8" />
9+ android:targetSdkVersion="14" />
1010 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
1111
1212 <application
1313 android:icon="@drawable/ic_launcher"
14- android:label="@string/app_name" >
14+ android:label="@string/app_name"
15+ android:theme="@style/AppTheme" >
1516 <activity
1617 android:name=".MainActivity"
1718 android:label="@string/app_name"
--- a/bin/AndroidManifest.xml
+++ b/bin/AndroidManifest.xml
@@ -1,17 +1,18 @@
11 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
22 package="org.pulpdust.snappingcamera"
3- android:versionCode="1"
4- android:versionName="0.5"
3+ android:versionCode="2"
4+ android:versionName="0.6"
55 android:installLocation="auto" >
66
77 <uses-sdk
88 android:minSdkVersion="4"
9- android:targetSdkVersion="8" />
9+ android:targetSdkVersion="14" />
1010 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
1111
1212 <application
1313 android:icon="@drawable/ic_launcher"
14- android:label="@string/app_name" >
14+ android:label="@string/app_name"
15+ android:theme="@style/AppTheme" >
1516 <activity
1617 android:name=".MainActivity"
1718 android:label="@string/app_name"
Binary files a/bin/Snapping Camera.apk and b/bin/Snapping Camera.apk differ
Binary files a/bin/classes.dex and b/bin/classes.dex differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/MainActivity$1.class and b/bin/classes/org/pulpdust/snappingcamera/MainActivity$1.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/MainActivity$2.class and b/bin/classes/org/pulpdust/snappingcamera/MainActivity$2.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/MainActivity$3.class and b/bin/classes/org/pulpdust/snappingcamera/MainActivity$3.class differ
Binary files /dev/null and b/bin/classes/org/pulpdust/snappingcamera/MainActivity$4.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/MainActivity.class and b/bin/classes/org/pulpdust/snappingcamera/MainActivity.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/R$id.class and b/bin/classes/org/pulpdust/snappingcamera/R$id.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/R$layout.class and b/bin/classes/org/pulpdust/snappingcamera/R$layout.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/R$menu.class and b/bin/classes/org/pulpdust/snappingcamera/R$menu.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/R$string.class and b/bin/classes/org/pulpdust/snappingcamera/R$string.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/R$style.class and b/bin/classes/org/pulpdust/snappingcamera/R$style.class differ
Binary files a/bin/classes/org/pulpdust/snappingcamera/R$xml.class and b/bin/classes/org/pulpdust/snappingcamera/R$xml.class differ
Binary files a/bin/resources.ap_ and b/bin/resources.ap_ differ
--- a/gen/org/pulpdust/snappingcamera/R.java
+++ b/gen/org/pulpdust/snappingcamera/R.java
@@ -23,9 +23,10 @@ public final class R {
2323 public static final int button1=0x7f090000;
2424 public static final int button2=0x7f090002;
2525 public static final int editText1=0x7f090001;
26+ public static final int menu_close=0x7f090005;
2627 public static final int menu_notake=0x7f090003;
2728 public static final int menu_open=0x7f090004;
28- public static final int menu_settings=0x7f090005;
29+ public static final int menu_settings=0x7f090006;
2930 }
3031 public static final class layout {
3132 public static final int activity_main=0x7f030000;
@@ -40,27 +41,31 @@ public final class R {
4041 public static final int app_lic=0x7f060002;
4142 public static final int app_name=0x7f060000;
4243 public static final int app_ver=0x7f060001;
43- public static final int bcc=0x7f060011;
44- public static final int cc=0x7f060010;
44+ public static final int bcc=0x7f060012;
45+ public static final int cc=0x7f060011;
4546 public static final int copy=0x7f060005;
46- public static final int err_den_sd=0x7f060018;
47- public static final int err_not_act=0x7f060019;
48- public static final int err_not_cam=0x7f060015;
49- public static final int err_not_file=0x7f06001a;
50- public static final int err_not_mail=0x7f060016;
51- public static final int err_not_sd=0x7f060017;
47+ public static final int err_den_sd=0x7f06001c;
48+ public static final int err_not_act=0x7f06001d;
49+ public static final int err_not_cam=0x7f060019;
50+ public static final int err_not_file=0x7f06001e;
51+ public static final int err_not_mail=0x7f06001a;
52+ public static final int err_not_sd=0x7f06001b;
5253 public static final int hello_world=0x7f060009;
53- public static final int kigo=0x7f06001b;
54+ public static final int kigo=0x7f06001f;
5455 public static final int license=0x7f060008;
56+ public static final int menu_close=0x7f06000c;
5557 public static final int menu_notake=0x7f06000a;
5658 public static final int menu_open=0x7f06000b;
57- public static final int menu_settings=0x7f06000c;
58- public static final int pref_cat_about=0x7f060013;
59- public static final int pref_cat_templ=0x7f060012;
60- public static final int shot=0x7f060014;
61- public static final int sub=0x7f06000f;
62- public static final int title_activity_main=0x7f06000d;
63- public static final int to=0x7f06000e;
59+ public static final int menu_settings=0x7f06000d;
60+ public static final int pref_cat_about=0x7f060017;
61+ public static final int pref_cat_behavior=0x7f060014;
62+ public static final int pref_cat_templ=0x7f060013;
63+ public static final int pref_delete=0x7f060015;
64+ public static final int pref_delete_summary=0x7f060016;
65+ public static final int shot=0x7f060018;
66+ public static final int sub=0x7f060010;
67+ public static final int title_activity_main=0x7f06000e;
68+ public static final int to=0x7f06000f;
6469 public static final int version=0x7f060007;
6570 }
6671 public static final class style {
--- a/project.properties
+++ b/project.properties
@@ -11,4 +11,4 @@
1111 #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
1212
1313 # Project target.
14-target=android-8
14+target=android-14
--- /dev/null
+++ b/res/.directory
@@ -0,0 +1,3 @@
1+[Dolphin]
2+Timestamp=2012,10,5,23,51,36
3+ViewMode=1
--- a/res/menu/activity_main.xml
+++ b/res/menu/activity_main.xml
@@ -7,6 +7,10 @@
77 android:title="@string/menu_open"
88 android:orderInCategory="100"
99 android:icon="@android:drawable/ic_menu_set_as" />
10+ <item android:id="@+id/menu_close"
11+ android:title="@string/menu_close"
12+ android:orderInCategory="100"
13+ android:icon="@android:drawable/ic_menu_close_clear_cancel" />
1014 <item android:id="@+id/menu_settings"
1115 android:title="@string/menu_settings"
1216 android:orderInCategory="100"
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -1,7 +1,7 @@
11 <resources>
22
33 <string name="app_name">Snapping Camera</string>
4- <string name="app_ver">0.5</string>
4+ <string name="app_ver">0.6</string>
55 <string name="app_lic">GNU GPL v3</string>
66 <string name="address">連絡先</string>
77 <string name="app_author">Kodakana&lt;kodakana.hws@gmail.com&gt;</string>
@@ -12,6 +12,7 @@
1212 <string name="hello_world">またお会いしましたね。</string>
1313 <string name="menu_notake">撮らない</string>
1414 <string name="menu_open">ファイルから&#8230;</string>
15+ <string name="menu_close">閉じる</string>
1516 <string name="menu_settings">設定&#8230;</string>
1617 <string name="title_activity_main">MainActivity</string>
1718 <string name="to">To:</string>
@@ -19,12 +20,15 @@
1920 <string name="cc">CC:</string>
2021 <string name="bcc">BCC:</string>
2122 <string name="pref_cat_templ">送信の雛形</string>
23+ <string name="pref_cat_behavior">動作</string>
24+ <string name="pref_delete">自動削除</string>
25+ <string name="pref_delete_summary">メニューから閉じるときにフォルダ(&lt;sdcard&gt;/Pictures/snapping)を空にするかどうか。</string>
2226 <string name="pref_cat_about">概要</string>
2327 <string name="shot">写真を撮る</string>
2428 <string name="err_not_cam">カメラが見つかりません。</string>
2529 <string name="err_not_mail">送信できません。</string>
2630 <string name="err_not_sd">拡張記憶領域が見つかりません。</string>
27- <string name="err_den_sd">拡張記憶領域と連絡がとれません。</string>
31+ <string name="err_den_sd">拡張記憶領域と連絡できません。</string>
2832 <string name="err_not_act">アクティビティが見つかりません。</string>
2933 <string name="err_not_file">ファイルを選択してください。</string>
3034 <string name="kigo">Kigo</string>
--- /dev/null
+++ b/res/values-v11/styles.xml
@@ -0,0 +1,4 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<resources>
3+ <style name="AppTheme" parent="@android:style/Theme.Holo" />
4+</resources>
\ No newline at end of file
--- /dev/null
+++ b/res/values-v14/styles.xml
@@ -0,0 +1,4 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<resources>
3+ <style name="AppTheme" parent="@android:style/Theme.DeviceDefault" />
4+</resources>
\ No newline at end of file
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1,7 +1,7 @@
11 <resources>
22
33 <string name="app_name">Snapping Camera</string>
4- <string name="app_ver">0.5</string>
4+ <string name="app_ver">0.6</string>
55 <string name="app_lic">GNU GPL v3</string>
66 <string name="address">Address</string>
77 <string name="app_author">Kodakana&lt;kodakana.hws@gmail.com&gt;</string>
@@ -12,6 +12,7 @@
1212 <string name="hello_world">Hello world!</string>
1313 <string name="menu_notake">Not Take</string>
1414 <string name="menu_open">From File&#8230;</string>
15+ <string name="menu_close">Close</string>
1516 <string name="menu_settings">Settings&#8230;</string>
1617 <string name="title_activity_main">MainActivity</string>
1718 <string name="to">To:</string>
@@ -19,6 +20,9 @@
1920 <string name="cc">CC:</string>
2021 <string name="bcc">BCC:</string>
2122 <string name="pref_cat_templ">Mail Template</string>
23+ <string name="pref_cat_behavior">Behavior</string>
24+ <string name="pref_delete">Automatic deletion</string>
25+ <string name="pref_delete_summary">Whether to empty the folder(&lt;sdcard&gt;/Pictures/snapping) when closing from menu.</string>
2226 <string name="pref_cat_about">About</string>
2327 <string name="shot">Take A Picture</string>
2428 <string name="err_not_cam">Camera Not Found.</string>
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -1,5 +1,5 @@
11 <resources>
22
3- <style name="AppTheme" parent="android:Theme.Light" />
3+ <style name="AppTheme" parent="android:Theme" />
44
55 </resources>
\ No newline at end of file
--- a/res/xml/prefs.xml
+++ b/res/xml/prefs.xml
@@ -14,6 +14,13 @@
1414 android:key="bcc"
1515 android:title="@string/bcc" />
1616 </PreferenceCategory>
17+ <PreferenceCategory android:title="@string/pref_cat_behavior">
18+ <CheckBoxPreference
19+ android:key="do_delete"
20+ android:title="@string/pref_delete"
21+ android:summary="@string/pref_delete_summary"
22+ android:defaultValue="false" />
23+ </PreferenceCategory>
1724 <PreferenceCategory android:title="@string/pref_cat_about">
1825 <Preference
1926 android:selectable="false"
--- a/src/org/pulpdust/snappingcamera/MainActivity.java
+++ b/src/org/pulpdust/snappingcamera/MainActivity.java
@@ -42,6 +42,7 @@ public class MainActivity extends Activity {
4242 String[] send_to = new String[1];
4343 String[] cc = new String[1];
4444 String[] bcc = new String[1];
45+ boolean dlt = false;
4546 File objct;
4647
4748 @Override
@@ -118,6 +119,7 @@ public class MainActivity extends Activity {
118119 @Override
119120 public void onStop(){
120121 super.onStop();
122+ Log.d(TAG, "onStop");
121123 writeMainprefs();
122124 }
123125 public void writeMainprefs(){
@@ -129,6 +131,58 @@ public class MainActivity extends Activity {
129131 }
130132 sedit.commit();
131133 }
134+ @Override
135+ public void onDestroy(){
136+ super.onDestroy();
137+ Log.d(TAG, "onDestroy");
138+ }
139+// @Override
140+// public boolean dispatchKeyEvent(KeyEvent kev){
141+// if (kev.getAction() == KeyEvent.ACTION_DOWN){
142+// switch (kev.getKeyCode()){
143+// case KeyEvent.KEYCODE_BACK:
144+// if (dlt){
145+// if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){
146+// File file = new File(Environment.getExternalStorageDirectory(), "/Pictures/snapping");
147+// final Uri uri = Uri.fromFile(file);
148+// new Thread(new Runnable(){
149+// @Override
150+// public void run(){
151+// delDel(uri);
152+// }
153+// }).start();
154+// }
155+// }
156+// }
157+// return super.dispatchKeyEvent(kev);
158+// } else {
159+// return super.dispatchKeyEvent(kev);
160+// }
161+//
162+// }
163+ public void delDel(Uri path){
164+ String path_s = path.toString();
165+ if (path_s.startsWith("file://")){
166+ path_s = path_s.substring(7);
167+ }
168+ File dir = new File(path_s);
169+ String files[] = dir.list();
170+ if (files == null){
171+
172+ } else {
173+ for(int index = 0 ; index < files.length; index++){
174+ File who = new File(dir, files[index]);
175+ if (who.isDirectory()){
176+
177+ } else {
178+ if (who.exists() && who.canWrite()){
179+ who.delete();
180+ }
181+
182+ }
183+ }
184+ }
185+ }
132186 public void startCamera(){
133187 if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){
134188 Toast.makeText(this, R.string.err_not_sd, Toast.LENGTH_LONG).show();
@@ -206,9 +260,18 @@ public class MainActivity extends Activity {
206260 imguri = lastimguri;
207261 }
208262 if (resultCode == RESULT_OK){
263+ Uri sendfile = null;
264+ if (data != null){
265+ sendfile = data.getData();
266+ }
267+ if (sendfile != null){
268+ sendfile = data.getData();
269+ } else {
270+ sendfile = imguri;
271+ }
209272 Intent mailint = buildSender(0);
210273 mailint.setType("image/jpg");
211- mailint.putExtra(Intent.EXTRA_STREAM, imguri);
274+ mailint.putExtra(Intent.EXTRA_STREAM, sendfile);
212275 mailint.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
213276 try {
214277 startActivity(mailint);
@@ -276,6 +339,7 @@ public class MainActivity extends Activity {
276339 send_to[0] = sprefs.getString("send_to", "");
277340 cc[0] = sprefs.getString("cc", "");
278341 bcc[0] = sprefs.getString("bcc", "");
342+ dlt = sprefs.getBoolean("do_delete", false);
279343 SharedPreferences mprefs = getSharedPreferences(mprf, 0);
280344 subject = mprefs.getString("subject", "");
281345 lastimguri = Uri.parse(mprefs.getString("lastimguri", ""));
@@ -326,6 +390,21 @@ public class MainActivity extends Activity {
326390 Log.e(TAG, e.getMessage());
327391 }
328392 return true;
393+ case R.id.menu_close:
394+ if (dlt){
395+ if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){
396+ File file = new File(Environment.getExternalStorageDirectory(), "/Pictures/snapping");
397+ final Uri uri = Uri.fromFile(file);
398+ new Thread(new Runnable(){
399+ @Override
400+ public void run(){
401+ delDel(uri);
402+ }
403+ }).start();
404+ }
405+ }
406+ finish();
407+ return true;
329408 default:
330409 return super.onOptionsItemSelected(item);
331410 }