mirror of https://github.com/tasks/tasks
Initial about screen; need to make the about links clickable
parent
b57645fe44
commit
b1a90ffecc
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="p_about">About Astrid</string>
|
||||
<string name="p_about_text">Astrid Tasks\n\n
|
||||
|
||||
Current version: %s\n\n
|
||||
|
||||
Astrid is open-source and proudly maintained by Todoroo, Inc.\n\n
|
||||
|
||||
Source: http://github.com/todoroo/astrid\n
|
||||
Privacy Policy: http://www.todoroo.com/privacy\n
|
||||
Terms of Use: http://www.todoroo.com/terms\n
|
||||
Visit http://weloveastrid.com for more information, to add translations or help make Astrid better!</string>
|
||||
</resources>
|
||||
@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2008 Google Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
package com.todoroo.astrid.activity;
|
||||
|
||||
import java.util.Formatter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.timsu.astrid.R;
|
||||
|
||||
/**
|
||||
* Displays an About ("End User License Agreement") that the user has to accept
|
||||
* before using the application. Your application should call
|
||||
* {@link About#showAbout(android.app.Activity)} in the onCreate() method of the
|
||||
* first activity. If the user accepts the About, it will never be shown again.
|
||||
* If the user refuses, {@link android.app.Activity#finish()} is invoked on your
|
||||
* activity.
|
||||
*/
|
||||
class About {
|
||||
private static final String PREFERENCES_ABOUT = "About"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* Displays the About if necessary. This method should be called from the
|
||||
* onCreate() method of your main Activity.
|
||||
*
|
||||
* @param activity
|
||||
* The Activity to finish if the user rejects the About
|
||||
*/
|
||||
static void showAbout(final Activity activity, final Resources r, final String versionName) {
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle(R.string.p_about);
|
||||
builder.setCancelable(true);
|
||||
builder.setMessage((new Formatter()).format(r.getString(R.string.p_about_text), versionName).toString());
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private About() {
|
||||
// don't construct me
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue