diff --git a/android/src/com/mapswithme/maps/base/BaseMwmToolbarFragment.java b/android/src/com/mapswithme/maps/base/BaseMwmToolbarFragment.java index 1b1131316f..582854946a 100644 --- a/android/src/com/mapswithme/maps/base/BaseMwmToolbarFragment.java +++ b/android/src/com/mapswithme/maps/base/BaseMwmToolbarFragment.java @@ -9,7 +9,7 @@ import com.mapswithme.maps.widget.ToolbarController; public class BaseMwmToolbarFragment extends BaseMwmFragment { - protected ToolbarController mToolbarController; + private ToolbarController mToolbarController; @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) @@ -23,7 +23,7 @@ public class BaseMwmToolbarFragment extends BaseMwmFragment } @NonNull - protected ToolbarController getToolbarController() + public ToolbarController getToolbarController() { return mToolbarController; } diff --git a/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java b/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java index b39633edd0..f03f9ff520 100644 --- a/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java +++ b/android/src/com/mapswithme/maps/discovery/DiscoveryFragment.java @@ -172,7 +172,7 @@ public class DiscoveryFragment extends BaseMwmToolbarFragment implements Discove public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle(R.string.discovery_button_title); + getToolbarController().setTitle(R.string.discovery_button_title); initHotelGallery(); initAttractionsGallery(); initFoodGallery(); diff --git a/android/src/com/mapswithme/maps/editor/AuthFragment.java b/android/src/com/mapswithme/maps/editor/AuthFragment.java index 4eb87fee58..37d975b394 100644 --- a/android/src/com/mapswithme/maps/editor/AuthFragment.java +++ b/android/src/com/mapswithme/maps/editor/AuthFragment.java @@ -26,7 +26,7 @@ public class AuthFragment extends BaseMwmToolbarFragment public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle(R.string.thank_you); + getToolbarController().setTitle(R.string.thank_you); OsmAuthFragmentDelegate osmAuthDelegate = new OsmAuthFragmentDelegate(this) { @Override diff --git a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java index ba06daa869..14c9454a53 100644 --- a/android/src/com/mapswithme/maps/editor/EditorHostFragment.java +++ b/android/src/com/mapswithme/maps/editor/EditorHostFragment.java @@ -127,8 +127,8 @@ public class EditorHostFragment extends BaseMwmToolbarFragment { super.onViewCreated(view, savedInstanceState); - mToolbarController.findViewById(R.id.save).setOnClickListener(this); - mToolbarController.getToolbar().setNavigationOnClickListener(new View.OnClickListener() + getToolbarController().findViewById(R.id.save).setOnClickListener(this); + getToolbarController().getToolbar().setNavigationOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) @@ -139,7 +139,7 @@ public class EditorHostFragment extends BaseMwmToolbarFragment if (getArguments() != null) mIsNewObject = getArguments().getBoolean(EditorActivity.EXTRA_NEW_OBJECT, false); - mToolbarController.setTitle(getTitle()); + getToolbarController().setTitle(getTitle()); fillNames(true /* addFakes */); } @@ -190,9 +190,9 @@ public class EditorHostFragment extends BaseMwmToolbarFragment protected void editMapObject(boolean focusToLastName) { mMode = Mode.MAP_OBJECT; - ((SearchToolbarController) mToolbarController).showControls(false); - mToolbarController.setTitle(getTitle()); - UiUtils.show(mToolbarController.findViewById(R.id.save)); + ((SearchToolbarController) getToolbarController()).showControls(false); + getToolbarController().setTitle(getTitle()); + UiUtils.show(getToolbarController().findViewById(R.id.save)); Bundle args = new Bundle(); if (focusToLastName) args.putInt(EditorFragment.LAST_INDEX_OF_NAMES_ARRAY, sNames.size() - 1); @@ -235,8 +235,8 @@ public class EditorHostFragment extends BaseMwmToolbarFragment return; mMode = newMode; - mToolbarController.setTitle(toolbarTitle); - ((SearchToolbarController) mToolbarController).showControls(showSearch); + getToolbarController().setTitle(toolbarTitle); + ((SearchToolbarController) getToolbarController()).showControls(showSearch); final Fragment fragment = Fragment.instantiate(getActivity(), fragmentClass.getName(), args); getChildFragmentManager().beginTransaction() .replace(R.id.fragment_container, fragment, fragmentClass.getName()) diff --git a/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java b/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java index 0a64aa329d..fb46f930c5 100644 --- a/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java +++ b/android/src/com/mapswithme/maps/editor/OsmAuthFragment.java @@ -68,7 +68,7 @@ public class OsmAuthFragment extends BaseMwmToolbarFragment implements View.OnCl } }; mDelegate.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle(R.string.login); + getToolbarController().setTitle(R.string.login); mEtLogin = (EditText) view.findViewById(R.id.osm_username); mEtPassword = (EditText) view.findViewById(R.id.osm_password); mTvLogin = (TextView) view.findViewById(R.id.login); diff --git a/android/src/com/mapswithme/maps/editor/ProfileFragment.java b/android/src/com/mapswithme/maps/editor/ProfileFragment.java index 4f340b8f90..361ec02d29 100644 --- a/android/src/com/mapswithme/maps/editor/ProfileFragment.java +++ b/android/src/com/mapswithme/maps/editor/ProfileFragment.java @@ -10,12 +10,10 @@ import android.support.annotation.StringRes; import android.support.v7.app.AlertDialog; import android.text.format.DateUtils; import android.view.View; -import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; import java.util.List; -import java.util.Locale; import com.cocosw.bottomsheet.BottomSheet; import com.mapswithme.maps.R; @@ -84,7 +82,7 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle(R.string.profile); + getToolbarController().setTitle(R.string.profile); initViews(view); refreshViews(); OsmOAuth.setUserStatsListener(this); @@ -93,7 +91,7 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene private void initViews(View view) { - mMore = mToolbarController.findViewById(R.id.more); + mMore = getToolbarController().findViewById(R.id.more); mMore.setOnClickListener(this); View editsBlock = view.findViewById(R.id.block_edits); UiUtils.show(editsBlock); diff --git a/android/src/com/mapswithme/maps/editor/ReportFragment.java b/android/src/com/mapswithme/maps/editor/ReportFragment.java index 44d2bf8f50..8734799bb2 100644 --- a/android/src/com/mapswithme/maps/editor/ReportFragment.java +++ b/android/src/com/mapswithme/maps/editor/ReportFragment.java @@ -35,9 +35,9 @@ public class ReportFragment extends BaseMwmToolbarFragment implements View.OnCli public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle(R.string.editor_report_problem_title); + getToolbarController().setTitle(R.string.editor_report_problem_title); - mSave = mToolbarController.findViewById(R.id.save); + mSave = getToolbarController().findViewById(R.id.save); mSave.setOnClickListener(this); mSimpleProblems = view.findViewById(R.id.ll__problems); mSimpleProblems.findViewById(R.id.problem_not_exist).setOnClickListener(this); @@ -58,13 +58,13 @@ public class ReportFragment extends BaseMwmToolbarFragment implements View.OnCli private void send(String text) { Editor.nativeCreateNote(text); - mToolbarController.onUpClick(); + getToolbarController().onUpClick(); } private void sendNotExist() { Editor.nativePlaceDoesNotExist(""); - mToolbarController.onUpClick(); + getToolbarController().onUpClick(); } @Override diff --git a/android/src/com/mapswithme/maps/search/FilterFragment.java b/android/src/com/mapswithme/maps/search/FilterFragment.java index 13beff2a57..214a938160 100644 --- a/android/src/com/mapswithme/maps/search/FilterFragment.java +++ b/android/src/com/mapswithme/maps/search/FilterFragment.java @@ -340,8 +340,8 @@ public class FilterFragment extends BaseMwmToolbarFragment public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle(R.string.booking_filters); - mToolbarController + getToolbarController().setTitle(R.string.booking_filters); + getToolbarController() .findViewById(R.id.reset) .setOnClickListener( v -> diff --git a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java index d2f0597886..02fd412f44 100644 --- a/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java +++ b/android/src/com/mapswithme/maps/ugc/UGCEditorFragment.java @@ -76,8 +76,8 @@ public class UGCEditorFragment extends BaseMwmAuthorizationFragment public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - mToolbarController.setTitle(getArguments().getString(ARG_TITLE)); - View submitButton = mToolbarController.findViewById(R.id.submit); + getToolbarController().setTitle(getArguments().getString(ARG_TITLE)); + View submitButton = getToolbarController().findViewById(R.id.submit); submitButton.setOnClickListener(v -> { onSubmitButtonClick();