| 1 | /* \r |
| 2 | * Copyright (C) 2007-2011 OpenIntents.org\r |
| 3 | *\r |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");\r |
| 5 | * you may not use this file except in compliance with the License.\r |
| 6 | * You may obtain a copy of the License at\r |
| 7 | *\r |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0\r |
| 9 | *\r |
| 10 | * Unless required by applicable law or agreed to in writing, software\r |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS,\r |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r |
| 13 | * See the License for the specific language governing permissions and\r |
| 14 | * limitations under the License.\r |
| 15 | */\r |
| 16 | \r |
| 17 | package org.openintents.filemanager;\r |
| 18 | \r |
| 19 | \r |
| 20 | import org.openintents.util.VersionUtils;\r |
| 21 | \r |
| 22 | import android.os.Bundle;\r |
| 23 | import android.view.View;\r |
| 24 | \r |
| 25 | /**\r |
| 26 | * Displays the recent changes, reading them from a raw resource.\r |
| 27 | * \r |
| 28 | * @author Peli\r |
| 29 | *\r |
| 30 | */\r |
| 31 | public class NewVersionActivity extends EulaActivity {\r |
| 32 | \r |
| 33 | /** Called when the activity is first created. */\r |
| 34 | @Override\r |
| 35 | public void onCreate(Bundle icicle) {\r |
| 36 | super.onCreate(icicle);\r |
| 37 | \r |
| 38 | // Modifications to convert EulaActivity into\r |
| 39 | // NewVersionActivity:\r |
| 40 | String version = VersionUtils.getVersionNumber(this);\r |
| 41 | String title = getString(R.string.oi_distribution_name_and_version, \r |
| 42 | mAppName, version);\r |
| 43 | String message = getString(R.string.oi_distribution_newversion_message, \r |
| 44 | mAppName);\r |
| 45 | message += "\n\n" + getString(R.string.oi_distribution_newversion_recent_changes);\r |
| 46 | \r |
| 47 | mText1.setText(title);\r |
| 48 | mText2.setText(message);\r |
| 49 | mText.setText(readTextFromRawResource(R.raw.recent_changes, true));\r |
| 50 | \r |
| 51 | mAgree.setText(R.string.oi_distribution_newversion_continue);\r |
| 52 | mDisagree.setVisibility(View.GONE);\r |
| 53 | View v = findViewById(R.id.space);\r |
| 54 | v.setVisibility(View.GONE);\r |
| 55 | }\r |
| 56 | \r |
| 57 | \r |
| 58 | /**\r |
| 59 | * Accept EULA and proceed with main application.\r |
| 60 | */\r |
| 61 | void accept() {\r |
| 62 | EulaOrNewVersion.storeCurrentVersionCode(this);\r |
| 63 | \r |
| 64 | startOriginalActivity();\r |
| 65 | }\r |
| 66 | }\r |