• 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évisionb7a3f86ec13a6291a5ef408f6c5abcac4012e896 (tree)
l'heure2012-09-07 22:06:29
AuteurKodakana <kodakana@user...>
CommiterKodakana

Message de Log

撮らずに送信する場合の動作の改善。ファイルを開く場合に拡張子が大文字だと失敗する問題の修正。ファイルを開く場合にパスにマルチバイト文字が含まれていると正しく動作しない問題の改善。日本語リソースを追加。

Change Summary

Modification

--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -1,11 +1,11 @@
11 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
22 package="org.pulpdust.snappingcamera"
33 android:versionCode="1"
4- android:versionName="0.3"
4+ android:versionName="0.4"
55 android:installLocation="auto" >
66
77 <uses-sdk
8- android:minSdkVersion="8"
8+ android:minSdkVersion="4"
99 android:targetSdkVersion="8" />
1010 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
1111
@@ -14,7 +14,8 @@
1414 android:label="@string/app_name" >
1515 <activity
1616 android:name=".MainActivity"
17- android:label="@string/app_name" >
17+ android:label="@string/app_name"
18+ android:windowSoftInputMode="stateUnchanged|adjustResize" >
1819 <intent-filter>
1920 <action android:name="android.intent.action.MAIN" />
2021
--- a/bin/AndroidManifest.xml
+++ b/bin/AndroidManifest.xml
@@ -1,11 +1,11 @@
11 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
22 package="org.pulpdust.snappingcamera"
33 android:versionCode="1"
4- android:versionName="0.3"
4+ android:versionName="0.4"
55 android:installLocation="auto" >
66
77 <uses-sdk
8- android:minSdkVersion="8"
8+ android:minSdkVersion="4"
99 android:targetSdkVersion="8" />
1010 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
1111
@@ -14,7 +14,8 @@
1414 android:label="@string/app_name" >
1515 <activity
1616 android:name=".MainActivity"
17- android:label="@string/app_name" >
17+ android:label="@string/app_name"
18+ android:windowSoftInputMode="stateUnchanged|adjustResize" >
1819 <intent-filter>
1920 <action android:name="android.intent.action.MAIN" />
2021
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$2.class and b/bin/classes/org/pulpdust/snappingcamera/MainActivity$2.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/resources.ap_ and b/bin/resources.ap_ differ
--- a/res/layout/activity_main.xml
+++ b/res/layout/activity_main.xml
@@ -28,6 +28,7 @@
2828 android:id="@+id/button2"
2929 android:layout_width="wrap_content"
3030 android:layout_height="wrap_content"
31+ android:layout_alignBottom="@+id/editText1"
3132 android:layout_alignParentRight="true"
3233 android:layout_alignParentTop="true"
3334 android:text="@string/kigo" />
--- /dev/null
+++ b/res/values-ja/strings.xml
@@ -0,0 +1,22 @@
1+<resources>
2+
3+ <string name="app_name">Snapping Camera</string>
4+ <string name="hello_world">またお会いしましたね。</string>
5+ <string name="menu_notake">撮らない</string>
6+ <string name="menu_open">ファイルから&#8230;</string>
7+ <string name="menu_settings">設定&#8230;</string>
8+ <string name="title_activity_main">MainActivity</string>
9+ <string name="to">To:</string>
10+ <string name="sub">Subject:</string>
11+ <string name="cc">CC:</string>
12+ <string name="bcc">BCC:</string>
13+ <string name="shot">写真を撮る</string>
14+ <string name="err_not_cam">カメラが見つかりません。</string>
15+ <string name="err_not_mail">送信できません。</string>
16+ <string name="err_not_sd">拡張記憶領域が見つかりません。</string>
17+ <string name="err_den_sd">拡張記憶領域と連絡がとれません。</string>
18+ <string name="err_not_act">アクティビティが見つかりません。</string>
19+ <string name="err_not_file">ファイルを選択してください。</string>
20+ <string name="kigo">Kigo</string>
21+
22+</resources>
\ No newline at end of file
--- a/src/org/pulpdust/snappingcamera/MainActivity.java
+++ b/src/org/pulpdust/snappingcamera/MainActivity.java
@@ -50,7 +50,7 @@ public class MainActivity extends Activity {
5050 setContentView(R.layout.activity_main);
5151 // snpcmrvw = (SnappingCameraView) findViewById(R.id.surfaceView1);
5252 if (Intent.ACTION_SEND.equals(getIntent().getAction())){
53- Intent throwint = buildSender();
53+ Intent throwint = buildSender(0);
5454 String type = getIntent().getType();
5555 throwint.setType(type);
5656 Uri uri = getIntent().getParcelableExtra(Intent.EXTRA_STREAM);
@@ -76,9 +76,9 @@ public class MainActivity extends Activity {
7676 @Override
7777 public void onClick(View v) {
7878 Intent intent = new Intent("org.pulpdust.kigo.action.PICK_KEYWORD");
79- if (subject != null){
80- intent.putExtra("org.pulpdust.kigo.extra.WORD", subject);
81- }
79+// if (subject != null){
80+// intent.putExtra("org.pulpdust.kigo.extra.WORD", subject);
81+// }
8282 try {
8383 startActivityForResult(intent, 4);
8484 } catch (ActivityNotFoundException e){
@@ -128,9 +128,10 @@ public class MainActivity extends Activity {
128128 Toast.makeText(this, R.string.err_not_sd, Toast.LENGTH_LONG).show();
129129 return;
130130 }
131- File path =
132- Environment.getExternalStoragePublicDirectory(
133- Environment.DIRECTORY_PICTURES + "/snapping");
131+// File path =
132+// Environment.getExternalStoragePublicDirectory(
133+// Environment.DIRECTORY_PICTURES + "/snapping");
134+ File path = new File(Environment.getExternalStorageDirectory(), "/Pictures/snapping");
134135 if (!path.exists()){
135136 path.mkdirs();
136137 }
@@ -148,6 +149,7 @@ public class MainActivity extends Activity {
148149
149150 Intent intent = new Intent();
150151 intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
152+// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
151153 intent.putExtra(MediaStore.EXTRA_OUTPUT, imguri);
152154 try {
153155 startActivityForResult(intent, 1);
@@ -157,13 +159,25 @@ public class MainActivity extends Activity {
157159 }
158160 }
159161
160- public Intent buildSender(){
161- Intent intent = new Intent(Intent.ACTION_SEND);
162+ public Intent buildSender(int mode){
163+ Intent intent = new Intent();
164+ if (mode == 1){
165+ intent.setAction(Intent.ACTION_SENDTO);
166+ } else if (mode == 0){
167+ intent.setAction(Intent.ACTION_SEND);
168+ } else {
169+ intent.setAction(Intent.ACTION_SEND);
170+ }
171+ intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
162172 if (!subject.equalsIgnoreCase("")){
163173 intent.putExtra(Intent.EXTRA_SUBJECT, subject);
164174 }
165175 if (!send_to[0].equalsIgnoreCase("")){
166- intent.putExtra(Intent.EXTRA_EMAIL, send_to);
176+ if (mode == 1){
177+ intent.setData(Uri.parse("mailto:" + send_to[0]));
178+ } else {
179+ intent.putExtra(Intent.EXTRA_EMAIL, send_to);
180+ }
167181 }
168182 if (!cc[0].equalsIgnoreCase("")){
169183 intent.putExtra(Intent.EXTRA_CC, cc);
@@ -178,7 +192,7 @@ public class MainActivity extends Activity {
178192 switch (requestCode){
179193 case 1:
180194 if (resultCode == RESULT_OK){
181- Intent mailint = buildSender();
195+ Intent mailint = buildSender(0);
182196 mailint.setType("image/jpeg");
183197 mailint.putExtra(Intent.EXTRA_STREAM, imguri);
184198 try {
@@ -208,16 +222,18 @@ public class MainActivity extends Activity {
208222 String suri = data.getDataString();
209223 File file = new File(suri);
210224 if (!file.isDirectory()){
211- Intent mailint = buildSender();
225+ Intent mailint = buildSender(0);
212226 String ext = MimeTypeMap.getFileExtensionFromUrl(suri);
213227 String mime = null;
214228 if (ext != null){
215- mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext);
229+ mime = MimeTypeMap.getSingleton().getMimeTypeFromExtension(ext.toLowerCase());
216230 } else {
217- mime = "all/all";
231+ mime = "application/octet-stream";
218232 }
219233 if (mime != null){
220234 mailint.setType(mime);
235+ } else {
236+ mailint.setType("application/octet-stream");
221237 }
222238 mailint.putExtra(Intent.EXTRA_STREAM, Uri.parse(suri));
223239 try {
@@ -274,9 +290,7 @@ public class MainActivity extends Activity {
274290 startActivityForResult(prefint, 2);
275291 return true;
276292 case R.id.menu_notake:
277- Intent ntint = buildSender();
278- ntint.setType("text/plain");
279- ntint.putExtra(Intent.EXTRA_TEXT, "");
293+ Intent ntint = buildSender(1);
280294 try {
281295 startActivity(ntint);
282296 } catch (ActivityNotFoundException e){