merge in OI distribution
[android_pandora.git] / apps / oi-filemanager / FileManager / src / org / openintents / filemanager / NewVersionActivity.java
diff --git a/apps/oi-filemanager/FileManager/src/org/openintents/filemanager/NewVersionActivity.java b/apps/oi-filemanager/FileManager/src/org/openintents/filemanager/NewVersionActivity.java
new file mode 100644 (file)
index 0000000..0c3f56e
--- /dev/null
@@ -0,0 +1,66 @@
+/* \r
+ * Copyright (C) 2007-2011 OpenIntents.org\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+package org.openintents.filemanager;\r
+\r
+\r
+import org.openintents.util.VersionUtils;\r
+\r
+import android.os.Bundle;\r
+import android.view.View;\r
+\r
+/**\r
+ * Displays the recent changes, reading them from a raw resource.\r
+ * \r
+ * @author Peli\r
+ *\r
+ */\r
+public class NewVersionActivity extends EulaActivity {\r
+       \r
+       /** Called when the activity is first created. */\r
+       @Override\r
+       public void onCreate(Bundle icicle) {\r
+               super.onCreate(icicle);\r
+\r
+               // Modifications to convert EulaActivity into\r
+               // NewVersionActivity:\r
+               String version = VersionUtils.getVersionNumber(this);\r
+               String title = getString(R.string.oi_distribution_name_and_version, \r
+                               mAppName, version);\r
+               String message = getString(R.string.oi_distribution_newversion_message, \r
+                               mAppName);\r
+               message += "\n\n" + getString(R.string.oi_distribution_newversion_recent_changes);\r
+               \r
+               mText1.setText(title);\r
+               mText2.setText(message);\r
+               mText.setText(readTextFromRawResource(R.raw.recent_changes, true));\r
+               \r
+               mAgree.setText(R.string.oi_distribution_newversion_continue);\r
+               mDisagree.setVisibility(View.GONE);\r
+               View v = findViewById(R.id.space);\r
+               v.setVisibility(View.GONE);\r
+       }\r
+       \r
+\r
+       /**\r
+        * Accept EULA and proceed with main application.\r
+        */\r
+       void accept() {\r
+               EulaOrNewVersion.storeCurrentVersionCode(this);\r
+               \r
+               startOriginalActivity();\r
+       }\r
+}\r