aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/AboutActivity.java
diff options
context:
space:
mode:
authorBananeweizen <bananeweizen@gmx.de>2013-06-09 07:28:09 +0200
committerBananeweizen <bananeweizen@gmx.de>2013-06-09 07:28:09 +0200
commit52681d8ab984caaa95db03076b6e369f7033bb36 (patch)
tree0224e0fc78a10eb0359511a40201710a2642c319 /main/src/cgeo/geocaching/AboutActivity.java
parent75ef80dc91bea395f7c7d089d8ca16b83d93e01f (diff)
downloadcgeo-52681d8ab984caaa95db03076b6e369f7033bb36.zip
cgeo-52681d8ab984caaa95db03076b6e369f7033bb36.tar.gz
cgeo-52681d8ab984caaa95db03076b6e369f7033bb36.tar.bz2
#2866: Use Android Annotations to implement standard patterns
Diffstat (limited to 'main/src/cgeo/geocaching/AboutActivity.java')
-rw-r--r--main/src/cgeo/geocaching/AboutActivity.java71
1 files changed, 29 insertions, 42 deletions
diff --git a/main/src/cgeo/geocaching/AboutActivity.java b/main/src/cgeo/geocaching/AboutActivity.java
index 3164602..f947655 100644
--- a/main/src/cgeo/geocaching/AboutActivity.java
+++ b/main/src/cgeo/geocaching/AboutActivity.java
@@ -1,85 +1,72 @@
package cgeo.geocaching;
-import butterknife.InjectView;
-
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 android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
-import android.view.View;
import android.widget.TextView;
+@EActivity
public class AboutActivity extends AbstractActivity {
- @InjectView(R.id.about_version_string) protected TextView version;
- @InjectView(R.id.contributors) protected TextView contributors;
- @InjectView(R.id.changelog) protected TextView changeLog;
+ @ViewById(R.id.about_version_string) protected TextView version;
+ @ViewById(R.id.contributors) protected TextView contributors;
+ @ViewById(R.id.changelog) protected TextView changeLog;
@Override
public void onCreate(Bundle savedInstanceState) {
+ // 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());
changeLog.setMovementMethod(AnchorAwareLinkMovementMethod.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) {
+ @Click(R.id.nutshellmanual)
+ public void nutshellmanual() {
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://manual.cgeo.org/")));
}
- /**
- * @param view
- * unused here but needed since this method is referenced from XML layout
- */
- public void market(View view) {
- Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + getPackageName()));
+ @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);
}