diff options
Diffstat (limited to 'main/src/cgeo/geocaching/AboutActivity.java')
| -rw-r--r-- | main/src/cgeo/geocaching/AboutActivity.java | 84 |
1 files changed, 41 insertions, 43 deletions
diff --git a/main/src/cgeo/geocaching/AboutActivity.java b/main/src/cgeo/geocaching/AboutActivity.java index c2a16e4..ef59cee 100644 --- a/main/src/cgeo/geocaching/AboutActivity.java +++ b/main/src/cgeo/geocaching/AboutActivity.java @@ -1,85 +1,83 @@ package cgeo.geocaching; import cgeo.geocaching.activity.AbstractActivity; +import cgeo.geocaching.ui.AnchorAwareLinkMovementMethod; import cgeo.geocaching.utils.Version; +import com.googlecode.androidannotations.annotations.AfterViews; +import com.googlecode.androidannotations.annotations.Click; +import com.googlecode.androidannotations.annotations.EActivity; +import com.googlecode.androidannotations.annotations.ViewById; + import org.apache.commons.lang3.StringUtils; import android.content.Intent; import android.net.Uri; import android.os.Bundle; -import android.text.method.LinkMovementMethod; import android.view.View; import android.widget.TextView; +@EActivity public class AboutActivity extends AbstractActivity { + @ViewById(R.id.about_version_string) protected TextView version; + @ViewById(R.id.contributors) protected TextView contributors; + @ViewById(R.id.changelog_master) protected TextView changeLogMaster; + @ViewById(R.id.changelog_release) protected TextView changeLogRelease; @Override public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setTheme(); - setContentView(R.layout.about_activity); - setTitle(res.getString(R.string.about)); + // TODO remove this after the theme has been fixed + super.onCreate(savedInstanceState, R.layout.about_activity); + } + @AfterViews + void initializeViews() { + version.setText(Version.getVersionName(this)); + contributors.setMovementMethod(AnchorAwareLinkMovementMethod.getInstance()); + changeLogRelease.setMovementMethod(AnchorAwareLinkMovementMethod.getInstance()); final String changeLogMasterString = getString(R.string.changelog_master); - final TextView changeLogMaster = (TextView) findViewById(R.id.changelog_master); if (StringUtils.isBlank(changeLogMasterString)) { changeLogMaster.setVisibility(View.GONE); } else { - changeLogMaster.setMovementMethod(LinkMovementMethod.getInstance()); + changeLogMaster.setMovementMethod(AnchorAwareLinkMovementMethod.getInstance()); } - - ((TextView) findViewById(R.id.about_version_string)).setText(Version.getVersionName(this)); - ((TextView) findViewById(R.id.contributors)).setMovementMethod(LinkMovementMethod.getInstance()); - ((TextView) findViewById(R.id.changelog_release)).setMovementMethod(LinkMovementMethod.getInstance()); } - /** - * @param view - * unused here but needed since this method is referenced from XML layout - */ - public void donate(View view) { + @Click(R.id.donate) + public void donate() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FMLNN8GXZKJEE"))); } - /** - * @param view - * unused here but needed since this method is referenced from XML layout - */ - public void support(View view) { + @Click(R.id.support) + public void support() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("mailto:support@cgeo.org"))); } - /** - * @param view - * unused here but needed since this method is referenced from XML layout - */ - public void website(View view) { + + @Click(R.id.website) + void webSite() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.cgeo.org/"))); } - /** - * @param view - * unused here but needed since this method is referenced from XML layout - */ - public void facebook(View view) { + @Click(R.id.facebook) + public void facebook() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.facebook.com/pages/cgeo/297269860090"))); } - /** - * @param view - * unused here but needed since this method is referenced from XML layout - */ - public void twitter(View view) { + @Click(R.id.twitter) + public void twitter() { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://twitter.com/android_gc"))); } - /** - * @param view - * unused here but needed since this method is referenced from XML layout - */ - public void nutshellmanual(View view) { - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.cgeo.org/"))); + @Click(R.id.nutshellmanual) + public void nutshellmanual() { + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://manual.cgeo.org/"))); + } + + @Click(R.id.market) + public void market() { + final Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName())); + marketIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); + startActivity(marketIntent); } } |
