Mark visibility

This commit is contained in:
PavelRatushny 2017-08-09 19:06:46 +03:00
parent aa35e2cb1a
commit 42b216b8dd
2 changed files with 45 additions and 50 deletions

View file

@ -84,12 +84,6 @@ public class MeasurementToolFragment extends Fragment {
private ImageView upDownBtn; private ImageView upDownBtn;
private ImageView undoBtn; private ImageView undoBtn;
private ImageView redoBtn; private ImageView redoBtn;
private TextViewEx cancelButton;
private ImageView movePointIcon;
private TextView movePointText;
private ImageView rulerIcon;
private Button addPointButton;
private Button applyMovePointButton;
private boolean wasCollapseButtonVisible; private boolean wasCollapseButtonVisible;
private boolean pointsListOpened; private boolean pointsListOpened;
@ -127,18 +121,16 @@ public class MeasurementToolFragment extends Fragment {
distanceTv = (TextView) mainView.findViewById(R.id.measurement_distance_text_view); distanceTv = (TextView) mainView.findViewById(R.id.measurement_distance_text_view);
pointsTv = (TextView) mainView.findViewById(R.id.measurement_points_text_view); pointsTv = (TextView) mainView.findViewById(R.id.measurement_points_text_view);
rulerIcon = (ImageView) mainView.findViewById(R.id.ruler_icon); ((ImageView) mainView.findViewById(R.id.ruler_icon))
rulerIcon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_ruler, R.color.color_myloc_distance)); .setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_ruler, R.color.color_myloc_distance));
movePointIcon = (ImageView) mainView.findViewById(R.id.move_point_icon); ((ImageView) mainView.findViewById(R.id.move_point_icon))
movePointIcon.setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_measure_point, R.color.color_myloc_distance)); .setImageDrawable(iconsCache.getIcon(R.drawable.ic_action_measure_point, R.color.color_myloc_distance));
movePointText = (TextView) mainView.findViewById(R.id.move_point_text);
upDownBtn = (ImageView) mainView.findViewById(R.id.up_down_button); upDownBtn = (ImageView) mainView.findViewById(R.id.up_down_button);
upDownBtn.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_arrow_up)); upDownBtn.setImageDrawable(iconsCache.getThemedIcon(R.drawable.ic_action_arrow_up));
cancelButton = (TextViewEx) mainView.findViewById(R.id.cancel_button); ((TextViewEx) mainView.findViewById(R.id.cancel_button)).setOnClickListener(new View.OnClickListener() {
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
cancelMovePointMode(); cancelMovePointMode();
@ -156,8 +148,8 @@ public class MeasurementToolFragment extends Fragment {
} }
}); });
applyMovePointButton = (Button) mainView.findViewById(R.id.apply_point_button); ((Button) mainView.findViewById(R.id.apply_point_button))
applyMovePointButton.setOnClickListener(new View.OnClickListener() { .setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
applyMovePointMode(); applyMovePointMode();
@ -207,8 +199,8 @@ public class MeasurementToolFragment extends Fragment {
} }
}); });
addPointButton = (Button) mainView.findViewById(R.id.add_point_button); ((Button) mainView.findViewById(R.id.add_point_button))
addPointButton.setOnClickListener(new View.OnClickListener() { .setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
addPoint(); addPoint();
@ -375,31 +367,35 @@ public class MeasurementToolFragment extends Fragment {
} }
private void enterMovePointMode() { private void enterMovePointMode() {
rulerIcon.setVisibility(View.GONE); mark(View.GONE,
distanceTv.setVisibility(View.GONE); R.id.ruler_icon,
pointsTv.setVisibility(View.GONE); R.id.measurement_distance_text_view,
upDownBtn.setVisibility(View.GONE); R.id.measurement_points_text_view,
undoBtn.setVisibility(View.GONE); R.id.up_down_button,
redoBtn.setVisibility(View.GONE); R.id.undo_point_button,
addPointButton.setVisibility(View.GONE); R.id.redo_point_button,
movePointIcon.setVisibility(View.VISIBLE); R.id.add_point_button);
movePointText.setVisibility(View.VISIBLE); mark(View.VISIBLE,
cancelButton.setVisibility(View.VISIBLE); R.id.move_point_icon,
applyMovePointButton.setVisibility(View.VISIBLE); R.id.move_point_text,
R.id.cancel_button,
R.id.apply_point_button);
} }
private void exitMovePointMode() { private void exitMovePointMode() {
movePointIcon.setVisibility(View.GONE); mark(View.GONE,
movePointText.setVisibility(View.GONE); R.id.move_point_icon,
cancelButton.setVisibility(View.GONE); R.id.move_point_text,
applyMovePointButton.setVisibility(View.GONE); R.id.cancel_button,
rulerIcon.setVisibility(View.VISIBLE); R.id.apply_point_button);
distanceTv.setVisibility(View.VISIBLE); mark(View.VISIBLE,
pointsTv.setVisibility(View.VISIBLE); R.id.ruler_icon,
upDownBtn.setVisibility(View.VISIBLE); R.id.measurement_distance_text_view,
undoBtn.setVisibility(View.VISIBLE); R.id.measurement_points_text_view,
redoBtn.setVisibility(View.VISIBLE); R.id.up_down_button,
addPointButton.setVisibility(View.VISIBLE); R.id.undo_point_button,
R.id.redo_point_button,
R.id.add_point_button);
} }
private void hidePointsListIfNoPoints() { private void hidePointsListIfNoPoints() {

View file

@ -17,7 +17,6 @@ public class MovePointCommand implements Command {
this.position = position; this.position = position;
} }
@Override @Override
public boolean execute() { public boolean execute() {
return true; return true;