From c93f20e11d6b3515783aa063a202823186c5af0c Mon Sep 17 00:00:00 2001 From: Chumva Date: Tue, 27 Mar 2018 19:14:07 +0300 Subject: [PATCH] refactored some code --- .../plus/myplaces/TrackSegmentFragment.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java index 2ae3c02e94..b147c38b34 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackSegmentFragment.java @@ -155,8 +155,8 @@ public class TrackSegmentFragment extends OsmAndListFragment { private FloatingActionButton lineFab; private View lineTextLayout; private View overlayView; - private IconPopupMenu iconGeneralPopupMenu; - private IconPopupMenu iconAltitudePopupMenu; + private IconPopupMenu generalPopupMenu; + private IconPopupMenu altitudePopupMenu; private ListPopupWindow splitListPopupWindow; private ListPopupWindow colorListPopupWindow; @@ -411,8 +411,8 @@ public class TrackSegmentFragment extends OsmAndListFragment { public void onPause() { super.onPause(); updateEnable = false; - if (iconGeneralPopupMenu != null) { - iconGeneralPopupMenu.dismiss(); + if (generalPopupMenu != null) { + generalPopupMenu.dismiss(); } if (splitListPopupWindow != null) { splitListPopupWindow.dismiss(); @@ -420,8 +420,8 @@ public class TrackSegmentFragment extends OsmAndListFragment { if (colorListPopupWindow != null) { colorListPopupWindow.dismiss(); } - if (iconAltitudePopupMenu != null) { - iconAltitudePopupMenu.dismiss(); + if (altitudePopupMenu != null) { + altitudePopupMenu.dismiss(); } } @@ -1369,12 +1369,12 @@ public class TrackSegmentFragment extends OsmAndListFragment { view.findViewById(R.id.overflow_menu).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - iconGeneralPopupMenu = new IconPopupMenu(getTrackActivity(), view.findViewById(R.id.overflow_menu)); - Menu menu = iconGeneralPopupMenu.getMenu(); - iconGeneralPopupMenu.getMenuInflater().inflate(R.menu.track_segment_menu, menu); + generalPopupMenu = new IconPopupMenu(getTrackActivity(), view.findViewById(R.id.overflow_menu)); + Menu menu = generalPopupMenu.getMenu(); + generalPopupMenu.getMenuInflater().inflate(R.menu.track_segment_menu, menu); menu.findItem(R.id.action_edit).setIcon(ic.getThemedIcon(R.drawable.ic_action_edit_dark)); menu.findItem(R.id.action_delete).setIcon(ic.getThemedIcon(R.drawable.ic_action_remove_dark)); - iconGeneralPopupMenu.setOnMenuItemClickListener(new IconPopupMenu.OnMenuItemClickListener() { + generalPopupMenu.setOnMenuItemClickListener(new IconPopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { @@ -1406,7 +1406,7 @@ public class TrackSegmentFragment extends OsmAndListFragment { return false; } }); - iconGeneralPopupMenu.show(); + generalPopupMenu.show(); } }); } else { @@ -1472,12 +1472,12 @@ public class TrackSegmentFragment extends OsmAndListFragment { view.findViewById(R.id.overflow_menu).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - iconAltitudePopupMenu = new IconPopupMenu(getTrackActivity(), view.findViewById(R.id.overflow_menu)); - Menu menu = iconAltitudePopupMenu.getMenu(); - iconAltitudePopupMenu.getMenuInflater().inflate(R.menu.track_segment_menu, menu); + altitudePopupMenu = new IconPopupMenu(getTrackActivity(), view.findViewById(R.id.overflow_menu)); + Menu menu = altitudePopupMenu.getMenu(); + altitudePopupMenu.getMenuInflater().inflate(R.menu.track_segment_menu, menu); menu.findItem(R.id.action_edit).setIcon(ic.getThemedIcon(R.drawable.ic_action_edit_dark)); menu.findItem(R.id.action_delete).setIcon(ic.getThemedIcon(R.drawable.ic_action_remove_dark)); - iconAltitudePopupMenu.setOnMenuItemClickListener(new IconPopupMenu.OnMenuItemClickListener() { + altitudePopupMenu.setOnMenuItemClickListener(new IconPopupMenu.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { @@ -1500,7 +1500,7 @@ public class TrackSegmentFragment extends OsmAndListFragment { return false; } }); - iconAltitudePopupMenu.show(); + altitudePopupMenu.show(); } }); } else {