Code cleanup

This commit is contained in:
max-klaus 2020-07-27 14:14:52 +03:00
parent 14b3bcead7
commit e2af067edb
2 changed files with 10 additions and 9 deletions

View file

@ -48,7 +48,7 @@ public abstract class BottomSheetDialogFragment extends DialogFragment {
public abstract View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState); public abstract View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);
@Override @Override
public void onAttach(Context context) { public void onAttach(@NonNull Context context) {
super.onAttach(context); super.onAttach(context);
if (context instanceof OnDialogFragmentResultListener) { if (context instanceof OnDialogFragmentResultListener) {
dialogFragmentResultListener = (OnDialogFragmentResultListener) context; dialogFragmentResultListener = (OnDialogFragmentResultListener) context;
@ -82,10 +82,10 @@ public abstract class BottomSheetDialogFragment extends DialogFragment {
} }
@Nullable @Nullable
protected Drawable getIcon(@DrawableRes int drawableRes, @ColorRes int color) { protected Drawable getIcon(@DrawableRes int drawableRes, @ColorRes int colorRes) {
OsmandApplication app = getMyApplication(); OsmandApplication app = getMyApplication();
if (app != null) { if (app != null) {
return app.getUIUtilities().getIcon(drawableRes, color); return app.getUIUtilities().getIcon(drawableRes, colorRes);
} else { } else {
return null; return null;
} }

View file

@ -1,7 +1,8 @@
package net.osmand.plus.measurementtool; package net.osmand.plus.measurementtool;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.GPXUtilities.TrkSegment;
import net.osmand.data.QuadRect; import net.osmand.data.QuadRect;
import net.osmand.GPXUtilities;
public class NewGpxData { public class NewGpxData {
@ -12,19 +13,19 @@ public class NewGpxData {
OVERWRITE_SEGMENT OVERWRITE_SEGMENT
} }
private GPXUtilities.GPXFile gpxFile; private GPXFile gpxFile;
private GPXUtilities.TrkSegment trkSegment; private TrkSegment trkSegment;
private QuadRect rect; private QuadRect rect;
private ActionType actionType; private ActionType actionType;
public NewGpxData(GPXUtilities.GPXFile gpxFile, QuadRect rect, ActionType actionType, GPXUtilities.TrkSegment trkSegment) { public NewGpxData(GPXFile gpxFile, QuadRect rect, ActionType actionType, TrkSegment trkSegment) {
this.gpxFile = gpxFile; this.gpxFile = gpxFile;
this.rect = rect; this.rect = rect;
this.actionType = actionType; this.actionType = actionType;
this.trkSegment = trkSegment; this.trkSegment = trkSegment;
} }
public GPXUtilities.GPXFile getGpxFile() { public GPXFile getGpxFile() {
return gpxFile; return gpxFile;
} }
@ -36,7 +37,7 @@ public class NewGpxData {
return actionType; return actionType;
} }
public GPXUtilities.TrkSegment getTrkSegment() { public TrkSegment getTrkSegment() {
return trkSegment; return trkSegment;
} }
} }