diff options
| author | koem <koem@petoria.de> | 2013-05-01 18:28:52 -0500 |
|---|---|---|
| committer | koem <koem@petoria.de> | 2013-05-01 18:28:52 -0500 |
| commit | f7fb7e91cbfb14a473220a544e469d1a1581288f (patch) | |
| tree | 4d0d36b2196cef4eda4705775fc1bb949b9ca8db /main/src/cgeo/geocaching/UsefulAppsActivity.java | |
| parent | 9eae0750719e94dab9dae6540095e19fa7b11ff9 (diff) | |
| parent | 74fce89a36e8d130851145941459966aed1176c3 (diff) | |
| download | cgeo-f7fb7e91cbfb14a473220a544e469d1a1581288f.zip cgeo-f7fb7e91cbfb14a473220a544e469d1a1581288f.tar.gz cgeo-f7fb7e91cbfb14a473220a544e469d1a1581288f.tar.bz2 | |
Merge branch 'master' into issue2662-leichtes-klettern
Conflicts:
.gitignore
Diffstat (limited to 'main/src/cgeo/geocaching/UsefulAppsActivity.java')
| -rw-r--r-- | main/src/cgeo/geocaching/UsefulAppsActivity.java | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/main/src/cgeo/geocaching/UsefulAppsActivity.java b/main/src/cgeo/geocaching/UsefulAppsActivity.java index af643b3..ce8bbdd 100644 --- a/main/src/cgeo/geocaching/UsefulAppsActivity.java +++ b/main/src/cgeo/geocaching/UsefulAppsActivity.java @@ -1,5 +1,7 @@ package cgeo.geocaching; +import butterknife.InjectView; + import cgeo.geocaching.activity.AbstractActivity; import android.content.Intent; @@ -15,17 +17,11 @@ import java.util.Locale; public class UsefulAppsActivity extends AbstractActivity { - private LinearLayout parentLayout; + @InjectView(R.id.parent) protected LinearLayout parentLayout; @Override public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // init - setTheme(); - setContentView(R.layout.useful_apps); - setTitle(res.getString(R.string.helpers)); - parentLayout = (LinearLayout) findViewById(R.id.parent); + super.onCreate(savedInstanceState, R.layout.useful_apps); final Locale loc = Locale.getDefault(); final String language = loc.getLanguage(); @@ -45,12 +41,6 @@ public class UsefulAppsActivity extends AbstractActivity { addApp(R.string.helper_barcode_title, R.string.helper_barcode_description, R.drawable.helper_barcode, "com.google.zxing.client.android"); } - @Override - public void onResume() { - super.onResume(); - - } - private void installFromMarket(String marketId) { try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://search?q=pname:" + marketId))); @@ -62,18 +52,18 @@ public class UsefulAppsActivity extends AbstractActivity { } private void addApp(final int titleId, final int descriptionId, final int imageId, final String marketUrl) { - final LinearLayout layout = (LinearLayout) getLayoutInflater().inflate(R.layout.useful_apps_item, null); - ((TextView) layout.findViewById(R.id.title)).setText(res.getString(titleId)); - ((ImageView) layout.findViewById(R.id.image)).setImageDrawable(res.getDrawable(imageId)); - ((TextView) layout.findViewById(R.id.description)).setText(res.getString(descriptionId)); - layout.findViewById(R.id.app_layout).setOnClickListener(new OnClickListener() { + final View appLayout = getLayoutInflater().inflate(R.layout.useful_apps_item, null); + ((TextView) appLayout.findViewById(R.id.title)).setText(res.getString(titleId)); + ((ImageView) appLayout.findViewById(R.id.image)).setImageDrawable(res.getDrawable(imageId)); + ((TextView) appLayout.findViewById(R.id.description)).setText(res.getString(descriptionId)); + appLayout.findViewById(R.id.app_layout).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { installFromMarket(marketUrl); } }); - parentLayout.addView(layout); + parentLayout.addView(appLayout); } } |
