Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorАлександр Зацепин <az@mapswithme.com>2017-11-02 15:58:12 +0300
committerArsentiy Milchakov <milcars@mapswithme.com>2017-11-02 17:11:45 +0300
commit15ea0f828a98cdbf839fe399beb3ac38fb8b3c2e (patch)
treee28415296d533a816ba7fce38ec020b9e5494b95
parent33a7585272f0b3db5e25959e3d1e7a005cdc15c2 (diff)
[android] Added debug info to ugc object with null feature idbeta-1093
-rw-r--r--android/src/com/mapswithme/maps/ugc/EditParams.java47
-rw-r--r--android/src/com/mapswithme/maps/ugc/UGCController.java5
-rw-r--r--android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java3
-rw-r--r--android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java13
4 files changed, 66 insertions, 2 deletions
diff --git a/android/src/com/mapswithme/maps/ugc/EditParams.java b/android/src/com/mapswithme/maps/ugc/EditParams.java
index 7d1901d07f..20f9b39360 100644
--- a/android/src/com/mapswithme/maps/ugc/EditParams.java
+++ b/android/src/com/mapswithme/maps/ugc/EditParams.java
@@ -19,6 +19,12 @@ class EditParams
private final int mDefaultRating;
private final boolean mCanBeReviewed;
private final boolean mFromPP;
+ // TODO: mLat, mLon, mAddress are added just for debugging null feature id for ugc object.
+ // Remove they after problem is fixed.
+ private double mLat;
+ private double mLon;
+ @Nullable
+ private String mAddress;
private EditParams(@NonNull Builder builder)
{
@@ -28,6 +34,9 @@ class EditParams
mDefaultRating = builder.mDefaultRating;
mCanBeReviewed = builder.mCanBeReviewed;
mFromPP = builder.mFromPP;
+ mLat = builder.mLat;
+ mLon = builder.mLon;
+ mAddress = builder.mAddress;
}
@NonNull
@@ -63,6 +72,22 @@ class EditParams
return mFromPP;
}
+ double getLat()
+ {
+ return mLat;
+ }
+
+ double getLon()
+ {
+ return mLon;
+ }
+
+ @Nullable
+ String getAddress()
+ {
+ return mAddress;
+ }
+
public static class Builder
{
@NonNull
@@ -75,6 +100,10 @@ class EditParams
private int mDefaultRating;
private boolean mCanBeReviewed;
private boolean mFromPP;
+ private double mLat;
+ private double mLon;
+ @Nullable
+ private String mAddress;
public Builder(@NonNull String title, @NonNull FeatureId featureId)
{
@@ -106,6 +135,24 @@ class EditParams
return this;
}
+ public Builder setLat(double lat)
+ {
+ mLat = lat;
+ return this;
+ }
+
+ public Builder setLon(double lon)
+ {
+ mLon = lon;
+ return this;
+ }
+
+ public Builder setAddress(@Nullable String address)
+ {
+ mAddress = address;
+ return this;
+ }
+
public EditParams build()
{
return new EditParams(this);
diff --git a/android/src/com/mapswithme/maps/ugc/UGCController.java b/android/src/com/mapswithme/maps/ugc/UGCController.java
index 7e753d49a6..bbd4f2f0f8 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCController.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCController.java
@@ -255,7 +255,10 @@ public class UGCController implements View.OnClickListener, UGC.UGCListener
{
return new EditParams.Builder(mapObject.getTitle(), mapObject.getFeatureId())
.setRatings(mapObject.getDefaultRatings())
- .setCanBeReviewed(mapObject.canBeReviewed());
+ .setCanBeReviewed(mapObject.canBeReviewed())
+ .setLat(mapObject.getLat())
+ .setLon(mapObject.getLon())
+ .setAddress(mapObject.getAddress());
}
private void setUserReviewAndRatingsView(@Nullable UGCUpdate update)
diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java b/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
index 89bf3302ad..74e6fd9000 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
@@ -23,6 +23,9 @@ public class UGCEditorActivity extends BaseMwmFragmentActivity
args.putInt(UGCEditorFragment.ARG_DEFAULT_RATING, params.getDefaultRating());
args.putParcelableArrayList(UGCEditorFragment.ARG_RATING_LIST, params.getRatings());
args.putBoolean(UGCEditorFragment.ARG_CAN_BE_REVIEWED, params.canBeReviewed());
+ args.putDouble(UGCEditorFragment.ARG_LAT, params.getLat());
+ args.putDouble(UGCEditorFragment.ARG_LON, params.getLon());
+ args.putString(UGCEditorFragment.ARG_ADDRESS, params.getAddress());
i.putExtras(args);
activity.startActivity(i);
}
diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
index e6a36089fb..184f836fba 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
@@ -14,6 +14,7 @@ import com.mapswithme.maps.R;
import com.mapswithme.maps.auth.BaseMwmAuthorizationFragment;
import com.mapswithme.maps.bookmarks.data.FeatureId;
import com.mapswithme.maps.widget.ToolbarController;
+import com.mapswithme.util.CrashlyticsUtils;
import com.mapswithme.util.Language;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.statistics.Statistics;
@@ -27,6 +28,9 @@ public class UGCEditorFragment extends BaseMwmAuthorizationFragment
static final String ARG_DEFAULT_RATING = "arg_default_rating";
static final String ARG_RATING_LIST = "arg_rating_list";
static final String ARG_CAN_BE_REVIEWED = "arg_can_be_reviewed";
+ static final String ARG_LAT = "arg_lat";
+ static final String ARG_LON = "arg_lon";
+ static final String ARG_ADDRESS = "arg_address";
@NonNull
private final UGCRatingAdapter mUGCRatingAdapter = new UGCRatingAdapter();
@SuppressWarnings("NullableProblems")
@@ -96,7 +100,14 @@ public class UGCEditorFragment extends BaseMwmAuthorizationFragment
System.currentTimeMillis(), Language.getDefaultLocale());
FeatureId featureId = getArguments().getParcelable(ARG_FEATURE_ID);
if (featureId == null)
- throw new AssertionError("Feature ID must be passed to this fragment!");
+ {
+
+ throw new AssertionError("Feature ID must be non-null for ugc object! " +
+ "Title = " + getArguments().getString(ARG_TITLE) +
+ "; address = " + getArguments().getString(ARG_ADDRESS) +
+ "; lat = " + getArguments().getDouble(ARG_LAT) +
+ "; lon = " + getArguments().getDouble(ARG_LON));
+ }
UGC.setUGCUpdate(featureId, update);
Statistics.INSTANCE.trackEvent(Statistics.EventName.UGC_REVIEW_SUCCESS);
}