diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
index c74cb2e697..88fbde206b 100644
--- a/android/AndroidManifest.xml
+++ b/android/AndroidManifest.xml
@@ -364,7 +364,15 @@
-
+
+
+
+
-
-
+
-
-
+ android:layout_height="?attr/actionBarSize"
+ android:theme="@style/MwmWidget.ToolbarTheme">
+
+
+
-
+ tools:listitem="@layout/item_ugc_rating"/>
+
+
+
+
-
-
-
-
-
+
+
diff --git a/android/res/layout/item_ugc_rating.xml b/android/res/layout/item_ugc_rating.xml
index a784f50cf2..1a59a5c2f2 100644
--- a/android/res/layout/item_ugc_rating.xml
+++ b/android/res/layout/item_ugc_rating.xml
@@ -2,12 +2,7 @@
diff --git a/android/res/values/dimens.xml b/android/res/values/dimens.xml
index 69762acb5d..f20f93e4e8 100644
--- a/android/res/values/dimens.xml
+++ b/android/res/values/dimens.xml
@@ -215,4 +215,7 @@
40dp
20dp
20dp
+ 152dp
+
+ 1dp
diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java b/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
index 024df8134c..42cdea2d90 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCEditorActivity.java
@@ -2,16 +2,14 @@ package com.mapswithme.maps.ugc;
import android.app.Activity;
import android.content.Intent;
-import android.os.Bundle;
import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
import android.support.annotation.StyleRes;
import android.support.v4.app.Fragment;
-import com.mapswithme.maps.base.BaseToolbarActivity;
+import com.mapswithme.maps.base.BaseMwmFragmentActivity;
import com.mapswithme.util.ThemeUtils;
-public class UGCEditorActivity extends BaseToolbarActivity
+public class UGCEditorActivity extends BaseMwmFragmentActivity
{
private static final String EXTRA_FEATURE_INDEX = "extra_feature_index";
static final String EXTRA_UGC = "extra_ugc";
@@ -29,13 +27,6 @@ public class UGCEditorActivity extends BaseToolbarActivity
activity.startActivity(i);
}
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- getToolbar().setTitle(getIntent().getStringExtra(EXTRA_TITLE));
- }
-
@Override
@StyleRes
public int getThemeResourceId(@NonNull String theme)
diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
index 2ba0e07791..55c2e3bc4a 100644
--- a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
+++ b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java
@@ -1,5 +1,6 @@
package com.mapswithme.maps.ugc;
+import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -10,12 +11,12 @@ import android.view.View;
import android.view.ViewGroup;
import com.mapswithme.maps.R;
-import com.mapswithme.maps.base.BaseMwmFragment;
+import com.mapswithme.maps.base.BaseMwmToolbarFragment;
import java.util.ArrayList;
import java.util.List;
-public class UGCEditorFragment extends BaseMwmFragment
+public class UGCEditorFragment extends BaseMwmToolbarFragment
{
@NonNull
private final UGCRatingAdapter mUGCRatingAdapter = new UGCRatingAdapter();
@@ -25,22 +26,30 @@ public class UGCEditorFragment extends BaseMwmFragment
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
{
View root = inflater.inflate(R.layout.fragment_ugc_editor, container, false);
- RecyclerView rvRatingView = (RecyclerView) root.findViewById(R.id.rv__ratings);
+ RecyclerView rvRatingView = (RecyclerView) root.findViewById(R.id.ratings);
rvRatingView.setLayoutManager(new LinearLayoutManager(getContext()));
rvRatingView.getLayoutManager().setAutoMeasureEnabled(true);
rvRatingView.setNestedScrollingEnabled(false);
rvRatingView.setHasFixedSize(false);
rvRatingView.setAdapter(mUGCRatingAdapter);
- //TODO: use parcelable instead of seriliazable
- UGC ugc = (UGC) getActivity().getIntent().getSerializableExtra(UGCEditorActivity.EXTRA_UGC);
+ //TODO: use parcelable instead of serializable
+ Intent intent = getActivity().getIntent();
+ UGC ugc = (UGC) intent.getSerializableExtra(UGCEditorActivity.EXTRA_UGC);
List avgRatings = new ArrayList<>(ugc.getRatings());
for (UGC.Rating rating: avgRatings)
rating.setValue(getActivity().getIntent().getIntExtra(UGCEditorActivity.EXTRA_AVG_RATING, 3));
mUGCRatingAdapter.setItems(avgRatings);
- View submit = root.findViewById(R.id.submit);
- submit.setOnClickListener(new View.OnClickListener()
+ return root;
+ }
+
+ @Override
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
+ {
+ super.onViewCreated(view, savedInstanceState);
+ View save = mToolbarController.findViewById(R.id.send);
+ save.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
@@ -48,8 +57,7 @@ public class UGCEditorFragment extends BaseMwmFragment
getActivity().finish();
}
});
- return root;
-
-
+ Intent intent = getActivity().getIntent();
+ mToolbarController.setTitle(intent.getStringExtra(UGCEditorActivity.EXTRA_TITLE));
}
}