aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/WaypointPopup.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/WaypointPopup.java')
-rw-r--r--main/src/cgeo/geocaching/WaypointPopup.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/main/src/cgeo/geocaching/WaypointPopup.java b/main/src/cgeo/geocaching/WaypointPopup.java
index ad1d981..b77fc0c 100644
--- a/main/src/cgeo/geocaching/WaypointPopup.java
+++ b/main/src/cgeo/geocaching/WaypointPopup.java
@@ -1,5 +1,8 @@
package cgeo.geocaching;
+import butterknife.InjectView;
+import butterknife.Views;
+
import cgeo.geocaching.apps.cache.navi.NavigationAppFactory;
import cgeo.geocaching.geopoint.Geopoint;
import cgeo.geocaching.geopoint.Units;
@@ -18,6 +21,11 @@ import android.widget.LinearLayout;
import android.widget.TextView;
public class WaypointPopup extends AbstractPopupActivity {
+ @InjectView(R.id.actionbar_title) protected TextView actionBarTitle;
+ @InjectView(R.id.waypoint_details_list) protected LinearLayout waypointDetailsLayout;
+ @InjectView(R.id.edit) protected Button buttonEdit;
+ @InjectView(R.id.details_list) protected LinearLayout cacheDetailsLayout;
+
private int waypointId = 0;
private Waypoint waypoint = null;
private TextView waypointDistance = null;
@@ -29,6 +37,7 @@ public class WaypointPopup extends AbstractPopupActivity {
@Override
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ Views.inject(this);
// get parameters
final Bundle extras = getIntent().getExtras();
if (extras != null) {
@@ -55,11 +64,9 @@ public class WaypointPopup extends AbstractPopupActivity {
setTitle(waypoint.getGeocode());
}
- // actionbar icon
- ((TextView) findViewById(R.id.actionbar_title)).setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(waypoint.getWaypointType().markerId), null, null, null);
+ actionBarTitle.setCompoundDrawablesWithIntrinsicBounds(getResources().getDrawable(waypoint.getWaypointType().markerId), null, null, null);
- //Start filling waypoint details
- details = new CacheDetailsCreator(this, (LinearLayout) findViewById(R.id.waypoint_details_list));
+ details = new CacheDetailsCreator(this, waypointDetailsLayout);
//Waypoint geocode
details.add(R.string.cache_geocode, waypoint.getPrefix() + waypoint.getGeocode().substring(2));
@@ -67,8 +74,6 @@ public class WaypointPopup extends AbstractPopupActivity {
waypointDistance = details.getValueView();
details.add(R.string.waypoint_note, waypoint.getNote());
- // Edit Button
- final Button buttonEdit = (Button) findViewById(R.id.edit);
buttonEdit.setOnClickListener(new OnClickListener() {
@Override
@@ -78,8 +83,7 @@ public class WaypointPopup extends AbstractPopupActivity {
}
});
- //Start filling cache details
- details = new CacheDetailsCreator(this, (LinearLayout) findViewById(R.id.details_list));
+ details = new CacheDetailsCreator(this, cacheDetailsLayout);
details.add(R.string.cache_name, cache.getName());
addCacheDetails();