• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

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

Commit MetaInfo

修订版86942491d1f6466c11187bd01cfca6b35611c2f8 (tree)
时间2014-09-16 13:52:40
作者Masahiko, SAWAI <say@user...>
CommiterMasahiko, SAWAI

Log Message

Changed application name "android.R" to ".R"

更改概述

差异

--- a/android-R/AndroidManifest.xml
+++ b/android-R/AndroidManifest.xml
@@ -30,9 +30,10 @@
3030 android:label="@string/preferences_title"
3131 />
3232
33- <activity android:name=".AboutAppActivity"
34- android:label="@string/about_app_title"
35- />
33+ <!-- About App Activities -->
34+ <activity android:name=".about.AppVersionActivity" />
35+ <activity android:name=".about.AppStoreActivity" />
36+ <activity android:name=".about.AppManagementActivity" />
3637
3738 <activity android:name=".string.StringViewerActivity"
3839 android:label="@string/string_viewer_title"
--- a/android-R/pom.xml
+++ b/android-R/pom.xml
@@ -9,7 +9,7 @@
99 <artifactId>android-R</artifactId>
1010 <packaging>apk</packaging>
1111 <version>1.1.06</version>
12- <name>android.R</name>
12+ <name>.R</name>
1313 <url>http://www.example.com/</url>
1414
1515 <dependencies>
--- a/android-R/res/layout-land/about_app_activity.xml
+++ b/android-R/res/layout-land/app_version_activity.xml
@@ -1,32 +1,33 @@
11 <?xml version="1.0" encoding="utf-8"?>
2-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+<FrameLayout
3+ xmlns:android="http://schemas.android.com/apk/res/android"
34 android:layout_width="fill_parent"
45 android:layout_height="fill_parent"
5- android:paddingTop="@dimen/about_app_paddingTop"
6- android:paddingBottom="@dimen/about_app_paddingBottom"
7- android:paddingRight="@dimen/about_app_paddingRight"
8- android:paddingLeft="@dimen/about_app_paddingLeft"
6+ android:paddingTop="@dimen/activity_paddingTop"
7+ android:paddingBottom="@dimen/activity_paddingBottom"
8+ android:paddingLeft="@dimen/activity_paddingLeft"
9+ android:paddingRight="@dimen/activity_paddingRight"
910 >
1011 <LinearLayout
1112 android:orientation="horizontal"
1213 android:layout_width="wrap_content"
1314 android:layout_height="fill_parent"
14- android:layout_gravity="center_horizontal"
15+ android:layout_gravity="center"
1516 >
1617 <!-- app icon -->
1718 <FrameLayout
1819 android:layout_width="wrap_content"
1920 android:layout_height="fill_parent"
2021 android:layout_weight="0"
21- android:layout_gravity="center_vertical"
22+ android:layout_gravity="center_horizontal"
2223 android:padding="@dimen/about_app_icon_frame_padding"
2324 >
24- <include layout="@layout/about_app_icon" />
25+ <include layout="@layout/app_version_icon" />
2526 </FrameLayout>
2627
27- <!-- separator line -->
28+ <!-- vertical line -->
2829 <View style="@style/vline"
29- android:layout_margin="10dip"
30+ android:layout_margin="10dip"
3031 />
3132
3233 <!-- app infomation -->
@@ -34,12 +35,11 @@
3435 android:layout_width="wrap_content"
3536 android:layout_height="fill_parent"
3637 android:layout_weight="0"
37- android:layout_gravity="center_vertical"
38+ android:layout_gravity="center_horizontal"
3839 android:padding="@dimen/about_app_info_frame_padding"
3940 >
40- <include layout="@layout/about_app_info" />
41+ <include layout="@layout/app_version_info" />
4142 </FrameLayout>
42-
4343 </LinearLayout>
44-
4544 </FrameLayout>
45+
--- a/android-R/res/layout/about_app_activity.xml
+++ b/android-R/res/layout/app_version_activity.xml
@@ -3,10 +3,10 @@
33 xmlns:android="http://schemas.android.com/apk/res/android"
44 android:layout_width="fill_parent"
55 android:layout_height="fill_parent"
6- android:paddingTop="@dimen/about_app_paddingTop"
7- android:paddingBottom="@dimen/about_app_paddingBottom"
8- android:paddingRight="@dimen/about_app_paddingRight"
9- android:paddingLeft="@dimen/about_app_paddingLeft"
6+ android:paddingTop="@dimen/activity_paddingTop"
7+ android:paddingBottom="@dimen/activity_paddingBottom"
8+ android:paddingLeft="@dimen/activity_paddingLeft"
9+ android:paddingRight="@dimen/activity_paddingRight"
1010 >
1111 <LinearLayout
1212 android:orientation="vertical"
@@ -22,12 +22,13 @@
2222 android:layout_gravity="center_horizontal"
2323 android:padding="@dimen/about_app_icon_frame_padding"
2424 >
25- <include layout="@layout/about_app_icon" />
25+ <include layout="@layout/app_version_icon" />
2626 </FrameLayout>
2727
2828 <!-- separator line -->
29- <View style="@style/hline"
30- android:layout_margin="10dip"
29+ <View
30+ style="@style/hline"
31+ android:layout_margin="10dip"
3132 />
3233
3334 <!-- app infomation -->
@@ -38,7 +39,7 @@
3839 android:layout_gravity="center_horizontal"
3940 android:padding="@dimen/about_app_info_frame_padding"
4041 >
41- <include layout="@layout/about_app_info" />
42+ <include layout="@layout/app_version_info" />
4243 </FrameLayout>
4344 </LinearLayout>
4445 </FrameLayout>
--- a/android-R/res/layout/about_app_info.xml
+++ b/android-R/res/layout/app_version_info.xml
@@ -1,6 +1,5 @@
11 <?xml version="1.0" encoding="utf-8"?>
2-<LinearLayout
3- xmlns:android="http://schemas.android.com/apk/res/android"
2+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
43 android:orientation="vertical"
54 android:layout_width="wrap_content"
65 android:layout_height="wrap_content"
@@ -11,6 +10,7 @@
1110 android:layout_height="wrap_content"
1211 android:layout_margin="@dimen/about_app_info_item_margin"
1312 android:layout_gravity="center"
13+ android:gravity="center"
1414 android:text="@string/app_name"
1515 android:textSize="@dimen/about_app_name_textSize"
1616 android:textColor="?android:textColorPrimary"
@@ -50,22 +50,4 @@
5050 />
5151 </LinearLayout>
5252
53- <Button
54- android:id="@+id/open_application_store_button"
55- android:layout_width="wrap_content"
56- android:layout_height="wrap_content"
57- android:layout_margin="@dimen/about_app_info_item_margin"
58- android:layout_gravity="center_horizontal"
59- android:text="@string/application_store"
60- />
61-
62- <Button
63- android:id="@+id/open_application_management_button"
64- android:layout_width="wrap_content"
65- android:layout_height="wrap_content"
66- android:layout_margin="@dimen/about_app_info_item_margin"
67- android:layout_gravity="center_horizontal"
68- android:text="@string/application_management"
69- />
70-
7153 </LinearLayout>
\ No newline at end of file
--- a/android-R/res/values-ja/strings_about_app.xml
+++ b/android-R/res/values-ja/strings_about_app.xml
@@ -2,10 +2,17 @@
22 <resources>
33 <string name="about_app_title">このアプリについて</string>
44 <string name="about_app_summary">このアプリケーションについての情報を表示</string>
5+
6+ <string name="application_version_title">バージョン情報</string>
7+ <string name="application_version_summary">このアプリケーションのバージョン情報を表示します。</string>
8+ <string name="application_store_title">アプリケーションストア</string>
9+ <string name="application_store_summary">ストアにあるこのアプリケーションのページを表示します。</string>
10+ <string name="application_management_title">アプリケーションの管理</string>
11+ <string name="application_management_summary">このアプリケーションを管理する画面を表示します。</string>
12+
13+ <!-- AppVersionActivity -->
514 <string name="version">バージョン</string>
615 <string name="build_time">構築日時</string>
716 <string name="build_time_format">yyyyMMdd-kkmmss</string>
8- <string name="application_store">アプリケーションストア</string>
9- <string name="application_management">アプリケーションの管理</string>
10- <string name="open">開く</string>
17+
1118 </resources>
--- a/android-R/res/values-large/dimens_about_app.xml
+++ b/android-R/res/values-large/dimens_about_app.xml
@@ -1,17 +1,12 @@
11 <?xml version="1.0" encoding="utf-8"?>
22 <resources>
3- <dimen name="about_app_paddingTop">24dip</dimen>
4- <dimen name="about_app_paddingBottom">24dip</dimen>
5- <dimen name="about_app_paddingRight">24dip</dimen>
6- <dimen name="about_app_paddingLeft">24dip</dimen>
7-
8- <dimen name="about_app_icon_frame_padding">20dip</dimen>
9- <dimen name="about_app_info_frame_padding">20dip</dimen>
3+ <dimen name="about_app_icon_frame_padding">32dip</dimen>
4+ <dimen name="about_app_info_frame_padding">32dip</dimen>
105
116 <dimen name="about_app_info_item_margin">8dip</dimen>
127
13- <dimen name="about_app_name_textSize">48sp</dimen>
14- <dimen name="about_app_version_textSize">28sp</dimen>
8+ <dimen name="about_app_name_textSize">32sp</dimen>
9+ <dimen name="about_app_version_textSize">26sp</dimen>
1510
1611 <dimen name="about_app_label_textSize">18sp</dimen>
1712 </resources>
--- a/android-R/res/values-small/dimens_about_app.xml
+++ b/android-R/res/values-small/dimens_about_app.xml
@@ -1,16 +1,11 @@
11 <?xml version="1.0" encoding="utf-8"?>
22 <resources>
3- <dimen name="about_app_paddingTop">4dip</dimen>
4- <dimen name="about_app_paddingBottom">4dip</dimen>
5- <dimen name="about_app_paddingRight">4dip</dimen>
6- <dimen name="about_app_paddingLeft">4dip</dimen>
7-
83 <dimen name="about_app_icon_frame_padding">8dip</dimen>
94 <dimen name="about_app_info_frame_padding">8dip</dimen>
105
116 <dimen name="about_app_info_item_margin">4dip</dimen>
127
13- <dimen name="about_app_name_textSize">32sp</dimen>
8+ <dimen name="about_app_name_textSize">24sp</dimen>
149 <dimen name="about_app_version_textSize">18sp</dimen>
1510
1611 <dimen name="about_app_label_textSize">14sp</dimen>
--- a/android-R/res/values-xlarge/dimens_about_app.xml
+++ b/android-R/res/values-xlarge/dimens_about_app.xml
@@ -1,17 +1,12 @@
11 <?xml version="1.0" encoding="utf-8"?>
22 <resources>
3- <dimen name="about_app_paddingTop">48dip</dimen>
4- <dimen name="about_app_paddingBottom">48dip</dimen>
5- <dimen name="about_app_paddingRight">48dip</dimen>
6- <dimen name="about_app_paddingLeft">48dip</dimen>
7-
8- <dimen name="about_app_icon_frame_padding">30dip</dimen>
9- <dimen name="about_app_info_frame_padding">30dip</dimen>
3+ <dimen name="about_app_icon_frame_padding">48dip</dimen>
4+ <dimen name="about_app_info_frame_padding">48dip</dimen>
105
116 <dimen name="about_app_info_item_margin">12dip</dimen>
127
13- <dimen name="about_app_name_textSize">64sp</dimen>
14- <dimen name="about_app_version_textSize">36sp</dimen>
8+ <dimen name="about_app_name_textSize">40sp</dimen>
9+ <dimen name="about_app_version_textSize">32sp</dimen>
1510
1611 <dimen name="about_app_label_textSize">24sp</dimen>
1712 </resources>
--- a/android-R/res/values/dimens_about_app.xml
+++ b/android-R/res/values/dimens_about_app.xml
@@ -1,17 +1,12 @@
11 <?xml version="1.0" encoding="utf-8"?>
22 <resources>
3- <dimen name="about_app_paddingTop">4dip</dimen>
4- <dimen name="about_app_paddingBottom">4dip</dimen>
5- <dimen name="about_app_paddingRight">4dip</dimen>
6- <dimen name="about_app_paddingLeft">4dip</dimen>
7-
8- <dimen name="about_app_icon_frame_padding">10dip</dimen>
9- <dimen name="about_app_info_frame_padding">10dip</dimen>
3+ <dimen name="about_app_icon_frame_padding">16dip</dimen>
4+ <dimen name="about_app_info_frame_padding">16dip</dimen>
105
116 <dimen name="about_app_info_item_margin">4dip</dimen>
127
13- <dimen name="about_app_name_textSize">32sp</dimen>
8+ <dimen name="about_app_name_textSize">24sp</dimen>
149 <dimen name="about_app_version_textSize">20sp</dimen>
1510
16- <dimen name="about_app_label_textSize">14sp</dimen>
11+ <dimen name="about_app_label_textSize">16sp</dimen>
1712 </resources>
--- a/android-R/res/values/strings.xml
+++ b/android-R/res/values/strings.xml
@@ -1,7 +1,7 @@
11 <?xml version="1.0" encoding="utf-8"?>
22 <resources>
33
4- <string name="app_name">android.R</string>
4+ <string name="app_name">.R</string>
55
66 <string name="drawable_viewer">Drawable</string>
77 <string name="drawable_viewer_title">android.R.drawable</string>
--- a/android-R/res/values/strings_about_app.xml
+++ b/android-R/res/values/strings_about_app.xml
@@ -2,10 +2,17 @@
22 <resources>
33 <string name="about_app_title">About App</string>
44 <string name="about_app_summary">Infomation about this application</string>
5+
6+ <string name="application_version_title">Version Infomation</string>
7+ <string name="application_version_summary">Show the version infomation about this application.</string>
8+ <string name="application_store_title">Application Store</string>
9+ <string name="application_store_summary">Open the page about this application in store.</string>
10+ <string name="application_management_title">Application Management</string>
11+ <string name="application_management_summary">Open the screen to manage this application.</string>
12+
13+ <!-- AppVersionActivity -->
514 <string name="version">Version</string>
615 <string name="build_time">Build Time</string>
716 <string name="build_time_format">yyyyMMdd-kkmmss</string>
8- <string name="application_store">Application Store</string>
9- <string name="application_management">Application Management</string>
10- <string name="open">Open</string>
17+
1118 </resources>
--- a/android-R/res/xml/preferences.xml
+++ b/android-R/res/xml/preferences.xml
@@ -41,7 +41,7 @@
4141 <intent
4242 android:action="android.intent.action.MAIN"
4343 android:targetPackage="org.routine_work.android_r"
44- android:targetClass="org.routine_work.android_r.AboutAppActivity"
44+ android:targetClass="org.routine_work.android_r.about.AppVersionActivity"
4545 />
4646 </PreferenceScreen>
4747 </PreferenceCategory>
--- /dev/null
+++ b/android-R/src/org/routine_work/android_r/about/AppManagementActivity.java
@@ -0,0 +1,100 @@
1+/*
2+ * The MIT License
3+ *
4+ * Copyright 2011-2012 Masahiko, SAWAI <masahiko.sawai@gmail.com>.
5+ *
6+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7+ * of this software and associated documentation files (the "Software"), to deal
8+ * in the Software without restriction, including without limitation the rights
9+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+ * copies of the Software, and to permit persons to whom the Software is
11+ * furnished to do so, subject to the following conditions:
12+ *
13+ * The above copyright notice and this permission notice shall be included in
14+ * all copies or substantial portions of the Software.
15+ *
16+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+ * THE SOFTWARE.
23+ */
24+package org.routine_work.android_r.about;
25+
26+import android.app.Activity;
27+import android.content.ActivityNotFoundException;
28+import android.content.Intent;
29+import android.net.Uri;
30+import android.os.Bundle;
31+import org.routine_work.utils.Log;
32+
33+/**
34+ *
35+ * @author Masahiko, SAWAI <masahiko.sawai@gmail.com>
36+ */
37+public class AppManagementActivity extends Activity
38+{
39+
40+ private static final String LOG_TAG = "simple-battery-logger";
41+ private Intent[] applicationManagementIntents;
42+
43+ @Override
44+ protected void onCreate(Bundle savedInstanceState)
45+ {
46+ super.onCreate(savedInstanceState);
47+ finish();
48+ openApplicationManagement();
49+ }
50+
51+ private void openApplicationManagement()
52+ {
53+ Intent[] intents = getApplicationManagementIntents();
54+ for (Intent intent : intents)
55+ {
56+ try
57+ {
58+ Log.i(LOG_TAG, "AppManagementActivity#openApplicationManagement() : intent => " + intent);
59+ startActivity(intent);
60+ break;
61+ }
62+ catch (ActivityNotFoundException e)
63+ {
64+ Log.i(LOG_TAG, "AppManagementActivity#openApplicationManagement() : startActivity(" + intent + ") failed.");
65+ }
66+ }
67+ }
68+
69+ private Intent[] getApplicationManagementIntents()
70+ {
71+ if (applicationManagementIntents == null)
72+ {
73+ // API Level 9 or later
74+ Intent intent0 = new Intent(Intent.ACTION_VIEW);
75+ intent0.setClassName("com.android.settings",
76+ "com.android.settings.applications.InstalledAppDetails");
77+ intent0.setData(Uri.fromParts("package", getPackageName(), null));
78+ intent0.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
79+
80+ // API Level 8 or earlier
81+ Intent intent1 = new Intent(Intent.ACTION_VIEW);
82+ intent1.setClassName("com.android.settings",
83+ "com.android.settings.InstalledAppDetails");
84+ intent1.putExtra("pkg", getPackageName());
85+ intent1.putExtra("com.android.settings.ApplicationPkgName",
86+ getPackageName());
87+ intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
88+
89+ // API Level 3(not in use?)
90+ Intent intent2 = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
91+ intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
92+
93+ applicationManagementIntents = new Intent[]
94+ {
95+ intent0, intent1, intent2,
96+ };
97+ }
98+ return applicationManagementIntents;
99+ }
100+}
--- /dev/null
+++ b/android-R/src/org/routine_work/android_r/about/AppStoreActivity.java
@@ -0,0 +1,89 @@
1+/*
2+ * The MIT License
3+ *
4+ * Copyright 2011-2012 Masahiko, SAWAI <masahiko.sawai@gmail.com>.
5+ *
6+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7+ * of this software and associated documentation files (the "Software"), to deal
8+ * in the Software without restriction, including without limitation the rights
9+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+ * copies of the Software, and to permit persons to whom the Software is
11+ * furnished to do so, subject to the following conditions:
12+ *
13+ * The above copyright notice and this permission notice shall be included in
14+ * all copies or substantial portions of the Software.
15+ *
16+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+ * THE SOFTWARE.
23+ */
24+package org.routine_work.android_r.about;
25+
26+import android.app.Activity;
27+import android.content.ActivityNotFoundException;
28+import android.content.Intent;
29+import android.net.Uri;
30+import android.os.Bundle;
31+import org.routine_work.utils.Log;
32+
33+/**
34+ *
35+ * @author Masahiko, SAWAI <masahiko.sawai@gmail.com>
36+ */
37+public class AppStoreActivity extends Activity
38+{
39+
40+ private static final String LOG_TAG = "simple-battery-logger";
41+ private Intent[] applicationStoreIntents;
42+
43+ @Override
44+ protected void onCreate(Bundle savedInstanceState)
45+ {
46+ super.onCreate(savedInstanceState);
47+ finish();
48+ openApplicationStore();
49+ }
50+
51+ private void openApplicationStore()
52+ {
53+ Intent[] intents = getApplicationStoreIntents();
54+ for (Intent intent : intents)
55+ {
56+ try
57+ {
58+ Log.d(LOG_TAG, "AppStoreActivity#openApplicationStore() : intent => " + intent);
59+ startActivity(intent);
60+ break;
61+ }
62+ catch (ActivityNotFoundException e)
63+ {
64+ Log.d(LOG_TAG, "AppStoreActivity#openApplicationStore() : startActivity(" + intent + ") failed.");
65+ }
66+ }
67+ }
68+
69+ private Intent[] getApplicationStoreIntents()
70+ {
71+ if (applicationStoreIntents == null)
72+ {
73+ String marketUri = String.format("market://details?id=%s", getPackageName());
74+ Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(marketUri));
75+ marketIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
76+
77+ // For which market app (play app) is not installed.
78+ String playStoreUri = String.format("https://play.google.com/store/apps/details?id=%s", getPackageName());
79+ Intent httpPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(playStoreUri));
80+ httpPlayStoreIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
81+
82+ applicationStoreIntents = new Intent[]
83+ {
84+ marketIntent, httpPlayStoreIntent,
85+ };
86+ }
87+ return applicationStoreIntents;
88+ }
89+}
--- a/android-R/src/org/routine_work/android_r/AboutAppActivity.java
+++ b/android-R/src/org/routine_work/android_r/about/AppVersionActivity.java
@@ -21,28 +21,25 @@
2121 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222 * THE SOFTWARE.
2323 */
24-package org.routine_work.android_r;
24+package org.routine_work.android_r.about;
2525
2626 import android.app.Activity;
27-import android.content.ActivityNotFoundException;
28-import android.content.Intent;
2927 import android.content.pm.PackageInfo;
3028 import android.content.pm.PackageManager;
3129 import android.content.pm.PackageManager.NameNotFoundException;
32-import android.net.Uri;
3330 import android.os.Bundle;
3431 import android.text.format.DateFormat;
3532 import android.view.Menu;
3633 import android.view.MenuInflater;
3734 import android.view.MenuItem;
38-import android.view.View;
39-import android.widget.Button;
4035 import android.widget.TextView;
4136 import java.io.FileInputStream;
4237 import java.io.IOException;
4338 import java.util.Date;
4439 import java.util.zip.ZipEntry;
4540 import java.util.zip.ZipInputStream;
41+import org.routine_work.android_r.DashboardActivity;
42+import org.routine_work.android_r.R;
4643 import org.routine_work.utils.Log;
4744 import org.routine_work.utils.SystemResourceUtils;
4845
@@ -50,25 +47,16 @@ import org.routine_work.utils.SystemResourceUtils;
5047 *
5148 * @author Masahiko, SAWAI <masahiko.sawai@gmail.com>
5249 */
53-public class AboutAppActivity extends Activity
54- implements View.OnClickListener
50+public class AppVersionActivity extends Activity
5551 {
5652
57- private static final String LOG_TAG = "android.R";
58- private Intent[] applicationManagementIntents;
59- private Intent[] applicationStoreIntents;
53+ private static final String LOG_TAG = "simple-battery-logger";
6054
6155 @Override
6256 protected void onCreate(Bundle savedInstanceState)
6357 {
6458 super.onCreate(savedInstanceState);
65- setContentView(R.layout.about_app_activity);
66-
67- // init buttons
68- Button openApplicationStoreButton = (Button) findViewById(R.id.open_application_store_button);
69- openApplicationStoreButton.setOnClickListener(this);
70- Button openApplicationManagementButton = (Button) findViewById(R.id.open_application_management_button);
71- openApplicationManagementButton.setOnClickListener(this);
59+ setContentView(R.layout.app_version_activity);
7260
7361 // init package build time
7462 Date buildTime = getPackageBuildTime();
@@ -133,113 +121,6 @@ public class AboutAppActivity extends Activity
133121 return result;
134122 }
135123
136- @Override
137- public void onClick(View view)
138- {
139- int id = view.getId();
140- switch (id)
141- {
142- case R.id.open_application_store_button:
143- openApplicationStore();
144- break;
145- case R.id.open_application_management_button:
146- openApplicationManagement();
147- break;
148- default:
149- throw new AssertionError();
150- }
151- }
152-
153- private void openApplicationStore()
154- {
155- Intent[] intents = getApplicationStoreIntents();
156- for (Intent intent : intents)
157- {
158- try
159- {
160- Log.i(LOG_TAG, "AboutAppActivity#openApplicationStore() : intent => " + intent);
161- startActivity(intent);
162- break;
163- }
164- catch (ActivityNotFoundException e)
165- {
166- Log.i(LOG_TAG, "AboutAppActivity#openApplicationStore() : startActivity(" + intent + ") failed.");
167- }
168- }
169-
170- }
171-
172- private void openApplicationManagement()
173- {
174- Intent[] intents = getApplicationManagementIntents();
175- for (Intent intent : intents)
176- {
177- try
178- {
179- Log.i(LOG_TAG, "open application management : intent => " + intent);
180- startActivity(intent);
181- break;
182- }
183- catch (ActivityNotFoundException e)
184- {
185- Log.i(LOG_TAG, "open application management : startActivity(" + intent + ") failed.");
186- }
187- }
188- }
189-
190- private Intent[] getApplicationStoreIntents()
191- {
192- if (applicationStoreIntents == null)
193- {
194- String marketUri = String.format("market://details?id=%s", getPackageName());
195- Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(marketUri));
196- marketIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
197-
198- // For which market app (play app) is not installed.
199- String playStoreUri = String.format("https://play.google.com/store/apps/details?id=%s", getPackageName());
200- Intent httpPlayStoreIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(playStoreUri));
201- httpPlayStoreIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
202-
203- applicationStoreIntents = new Intent[]
204- {
205- marketIntent, httpPlayStoreIntent,
206- };
207- }
208- return applicationStoreIntents;
209- }
210-
211- private Intent[] getApplicationManagementIntents()
212- {
213- if (applicationManagementIntents == null)
214- {
215- // API Level 9 or later
216- Intent intent0 = new Intent(Intent.ACTION_VIEW);
217- intent0.setClassName("com.android.settings",
218- "com.android.settings.applications.InstalledAppDetails");
219- intent0.setData(Uri.fromParts("package", getPackageName(), null));
220- intent0.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
221-
222- // API Level 8 or earlier
223- Intent intent1 = new Intent(Intent.ACTION_VIEW);
224- intent1.setClassName("com.android.settings",
225- "com.android.settings.InstalledAppDetails");
226- intent1.putExtra("pkg", getPackageName());
227- intent1.putExtra("com.android.settings.ApplicationPkgName",
228- getPackageName());
229- intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
230-
231- // API Level 3(not in use?)
232- Intent intent2 = new Intent(android.provider.Settings.ACTION_MANAGE_APPLICATIONS_SETTINGS);
233- intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
234-
235- applicationManagementIntents = new Intent[]
236- {
237- intent0, intent1, intent2,
238- };
239- }
240- return applicationManagementIntents;
241- }
242-
243124 private Date getPackageBuildTime()
244125 {
245126 final String targetFileName = "classes.dex";