[android] removed duplicating top panel for place

Signed-off-by: Endemion <d.ermolenko.1986@gmail.com>
This commit is contained in:
Dzmitry Yarmolenka 2021-06-30 17:33:51 +02:00 committed by Alexander Borsuk
parent 2df71e93df
commit 8095268b69
3 changed files with 1 additions and 36 deletions

View file

@ -97,19 +97,6 @@
</FrameLayout>
<include layout="@layout/elevation_profile_bottom_sheet" />
<include layout="@layout/main_menu_bottom_sheet" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="@dimen/appbar_elevation"
android:visibility="gone">
<androidx.appcompat.widget.Toolbar
android:id="@+id/pp_toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/MwmWidget.ToolbarTheme.DownButton"/>
</com.google.android.material.appbar.AppBarLayout>
<androidx.appcompat.widget.Toolbar
android:id="@+id/bookmark_category_toolbar"
style="@style/MwmWidget.ToolbarStyle"

View file

@ -224,8 +224,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
@SuppressWarnings("NullableProblems")
@NonNull
private MenuController mMainMenuController;
@NonNull
private Toolbar mPlacePageToolbar;
@SuppressWarnings("NotNullFieldNotInitialized")
@NonNull
private Toolbar mBookmarkCategoryToolbar;
@ -443,7 +441,6 @@ public class MwmActivity extends BaseMwmFragmentActivity
.addOnGlobalLayoutListener(new ToolbarLayoutChangeListener());
mSearchController.setVisibilityListener(this);
mPlacePageToolbar = findViewById(R.id.pp_toolbar);
mBookmarkCategoryToolbar = findViewById(R.id.bookmark_category_toolbar);
mBookmarkCategoryToolbar.inflateMenu(R.menu.menu_bookmark_catalog);
mBookmarkCategoryToolbar.setOnMenuItemClickListener(this::onBookmarkToolbarMenuClicked);

View file

@ -13,10 +13,8 @@ import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.GestureDetectorCompat;
import com.google.android.material.appbar.AppBarLayout;
import com.mapswithme.maps.Framework;
import com.mapswithme.maps.R;
import com.mapswithme.maps.bookmarks.data.MapObject;
@ -47,14 +45,7 @@ public class RichPlacePageController implements PlacePageController, LocationLis
@SuppressWarnings("NullableProblems")
@NonNull
private PlacePageView mPlacePage;
@SuppressWarnings("NullableProblems")
@NonNull
private Toolbar mToolbar;
@SuppressWarnings("NullableProblems")
@NonNull
private AppBarLayout mToolbarLayout;
private int mViewportMinHeight;
private int mCurrentTop;
private boolean mPeekHeightAnimating;
@NonNull
private final SlideListener mSlideListener;
@ -78,7 +69,7 @@ public class RichPlacePageController implements PlacePageController, LocationLis
@Override
public void onSheetDetailsOpened()
{
UiUtils.show(mToolbarLayout);
// No op.
}
@Override
@ -86,7 +77,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
{
mPlacePage.resetScroll();
setPeekHeight();
UiUtils.show(mToolbarLayout);
}
@Override
@ -116,7 +106,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
mDeactivateMapSelection = true;
PlacePageUtils.moveViewportUp(mPlacePage, mViewportMinHeight);
UiUtils.invisible(mButtonsLayout);
UiUtils.hide(mToolbarLayout);
}
RichPlacePageController(@NonNull SlideListener listener,
@ -133,11 +122,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
Objects.requireNonNull(activity);
Resources res = activity.getResources();
mViewportMinHeight = res.getDimensionPixelSize(R.dimen.viewport_min_height);
mToolbar = activity.findViewById(R.id.pp_toolbar);
mToolbarLayout = activity.findViewById(R.id.app_bar);
UiUtils.extendViewWithStatusBar(mToolbar);
UiUtils.showHomeUpButton(mToolbar);
mToolbar.setNavigationOnClickListener(v -> close(true));
mPlacePage = activity.findViewById(R.id.placepage);
mPlacePageBehavior = AnchorBottomSheetBehavior.from(mPlacePage);
mPlacePageBehavior.addBottomSheetCallback(mSheetCallback);
@ -152,7 +136,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
ViewGroup buttons = mButtonsLayout.findViewById(R.id.container);
mPlacePage.initButtons(buttons);
UiUtils.bringViewToFrontOf(mButtonsLayout, mPlacePage);
UiUtils.bringViewToFrontOf(activity.findViewById(R.id.app_bar), mPlacePage);
LocationHelper.INSTANCE.addListener(this);
}
@ -185,7 +168,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
openPlacePage();
});
mToolbar.setTitle(object.getTitle());
}
private void openPlacePage()
@ -369,7 +351,6 @@ public class RichPlacePageController implements PlacePageController, LocationLis
mPlacePage.setMapObject(object, (isSameObject) -> {
restorePlacePageState(object, state);
});
mToolbar.setTitle(object.getTitle());
}
private void restorePlacePageState(@NonNull MapObject object, @AnchorBottomSheetBehavior.State int state)