Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d6085cfb47
6 changed files with 26 additions and 21 deletions
|
@ -135,5 +135,19 @@ public class PoiType extends AbstractPoiType {
|
|||
this.relation = relation;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PoiType{" +
|
||||
"category=" + category +
|
||||
", parentType=" + parentType +
|
||||
", referenceType=" + referenceType +
|
||||
", osmTag='" + osmTag + '\'' +
|
||||
", osmTag2='" + osmTag2 + '\'' +
|
||||
", osmValue='" + osmValue + '\'' +
|
||||
", osmValue2='" + osmValue2 + '\'' +
|
||||
", text=" + text +
|
||||
", nameOnly=" + nameOnly +
|
||||
", relation=" + relation +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2266,4 +2266,6 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
|
|||
<string name="poi_deleted_localy">POI will be deleted once you upload your changes</string>
|
||||
<string name="show_gpx">Show GPX</string>
|
||||
<string name="count_of_lines">Count of lines</string>
|
||||
<string name="are_you_sure">Are you sure?</string>
|
||||
<string name="unsaved_changes_will_be_lost">Any unsaved changes will be lost. Continue?</string>
|
||||
</resources>
|
||||
|
|
|
@ -20,9 +20,6 @@ import net.osmand.plus.activities.MapActivity;
|
|||
import net.osmand.plus.widgets.InterceptorFrameLayout;
|
||||
import net.osmand.plus.widgets.tools.SwipeDismissTouchListener;
|
||||
|
||||
/**
|
||||
* Created by Denis on 24.11.2014.
|
||||
*/
|
||||
public abstract class DashBaseFragment extends Fragment {
|
||||
protected DashboardOnMap dashboard;
|
||||
|
||||
|
@ -72,9 +69,7 @@ public abstract class DashBaseFragment extends Fragment {
|
|||
|
||||
@Override
|
||||
public void onDismiss(View view, Object token, boolean isSwipeRight) {
|
||||
if (isSwipeRight) {
|
||||
getDismissCallback().onDismiss();
|
||||
}
|
||||
getDismissCallback().onDismiss();
|
||||
}
|
||||
});
|
||||
frameLayout.setOnTouchListener(listener);
|
||||
|
|
|
@ -120,7 +120,7 @@ public class EditPoiFragment extends DialogFragment {
|
|||
Bundle savedInstanceState) {
|
||||
final View view = inflater.inflate(R.layout.fragment_edit_poi, container, false);
|
||||
final OsmandSettings settings = getMyApplication().getSettings();
|
||||
boolean isLightTheme = settings.OSMAND_THEME.get() == settings.OSMAND_LIGHT_THEME;
|
||||
boolean isLightTheme = settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_THEME;
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
editPoiData.tags = (LinkedHashSet<Tag>) savedInstanceState.getSerializable(TAGS_LIST);
|
||||
|
@ -449,8 +449,7 @@ public class EditPoiFragment extends DialogFragment {
|
|||
|
||||
@Override
|
||||
protected Node doInBackground(Void... params) {
|
||||
Node node = openstreetmapUtil.commitNodeImpl(action, n, info, comment, closeChangeSet);
|
||||
return node;
|
||||
return openstreetmapUtil.commitNodeImpl(action, n, info, comment, closeChangeSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -460,8 +459,6 @@ public class EditPoiFragment extends DialogFragment {
|
|||
successAction.run();
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
}.execute();
|
||||
}
|
||||
|
||||
|
@ -532,7 +529,7 @@ public class EditPoiFragment extends DialogFragment {
|
|||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}.execute(new Void[0]);
|
||||
}.execute();
|
||||
}
|
||||
|
||||
public static class MyAdapter extends FragmentPagerAdapter {
|
||||
|
@ -611,8 +608,8 @@ public class EditPoiFragment extends DialogFragment {
|
|||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setTitle("Are you sure?")
|
||||
.setMessage("Any unsaved changes will be lost. Continue?")
|
||||
builder.setTitle(getResources().getString(R.string.are_you_sure))
|
||||
.setMessage(getResources().getString(R.string.unsaved_changes_will_be_lost))
|
||||
.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
|
|
@ -11,9 +11,6 @@ import android.widget.FrameLayout;
|
|||
|
||||
import net.osmand.plus.widgets.tools.SwipeDismissTouchListener;
|
||||
|
||||
/**
|
||||
* Created by GaidamakUA on 8/5/15.
|
||||
*/
|
||||
public class InterceptorFrameLayout extends FrameLayout {
|
||||
private int mTouchSlop;
|
||||
private boolean mIsScrolling;
|
||||
|
@ -67,7 +64,7 @@ public class InterceptorFrameLayout extends FrameLayout {
|
|||
}
|
||||
|
||||
final int xDiff = calculateDistanceX(ev);
|
||||
if (xDiff > mTouchSlop) {
|
||||
if (Math.abs(xDiff) > mTouchSlop) {
|
||||
mIsScrolling = true;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ public class SwipeDismissTouchListener implements View.OnTouchListener {
|
|||
dismiss = (velocityX < 0) == (deltaX < 0);
|
||||
dismissRight = mVelocityTracker.getXVelocity() > 0;
|
||||
}
|
||||
if (dismiss && dismissRight) {
|
||||
if (dismiss) {
|
||||
// dismiss
|
||||
final boolean finalDismissRight = dismissRight;
|
||||
ViewCompat.animate(mView)
|
||||
|
@ -210,7 +210,7 @@ public class SwipeDismissTouchListener implements View.OnTouchListener {
|
|||
mVelocityTracker.addMovement(motionEvent);
|
||||
float deltaX = motionEvent.getRawX() - mDownX;
|
||||
float deltaY = motionEvent.getRawY() - mDownY;
|
||||
if (deltaX > mSlop && Math.abs(deltaY) < deltaX / 2) {
|
||||
if (Math.abs(deltaX) > mSlop && Math.abs(deltaY) < Math.abs(deltaX) / 2) {
|
||||
mSwiping = true;
|
||||
mSwipingSlop = (deltaX > 0 ? mSlop : -mSlop);
|
||||
mView.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
|
|
Loading…
Reference in a new issue