Skip to content

Commit

Permalink
[android] toolbar behavior is repalaced by sheet states callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
d5090c3bdec authored and velichkomarija committed Dec 24, 2020
1 parent 0f05b72 commit d22fe2b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 53 deletions.
1 change: 0 additions & 1 deletion android/res/layout/activity_map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
<include layout="@layout/guests_and_rooms_menu_bottom_sheet" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
app:layout_behavior="@string/placepage_toolbar_behavior"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="@dimen/appbar_elevation"
Expand Down
1 change: 0 additions & 1 deletion android/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
<string name="never_enum_value" translatable="false">NEVER</string>
<string name="always_enum_value" translatable="false">ALWAYS</string>
<string name="auto_enum_value" translatable="false">AUTO</string>
<string name="placepage_toolbar_behavior" translatable="false">com.mapswithme.maps.widget.placepage.ToolbarBehavior</string>
<string name="placepage_behavior" translatable="false">com.trafi.anchorbottomsheetbehavior.AnchorBottomSheetBehavior</string>
<string name="booking_filter_date_range" translatable="false">%s - %s</string>
</resources>
1 change: 0 additions & 1 deletion android/src/com/mapswithme/maps/intent/Factory.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import com.mapswithme.maps.ugc.EditParams;
import com.mapswithme.maps.ugc.UGC;
import com.mapswithme.maps.ugc.UGCEditorActivity;
import com.mapswithme.maps.widget.placepage.ToolbarBehavior;
import com.mapswithme.util.Constants;
import com.mapswithme.util.CrashlyticsUtils;
import com.mapswithme.util.KeyValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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.ads.CompoundNativeAdLoader;
Expand Down Expand Up @@ -63,6 +64,9 @@ public class RichPlacePageController implements PlacePageController, LocationLis
@SuppressWarnings("NullableProblems")
@NonNull
private Toolbar mToolbar;
@SuppressWarnings("NullableProblems")
@NonNull
private AppBarLayout mToolbarLayout;
private int mViewportMinHeight;
private int mCurrentTop;
private boolean mPeekHeightAnimating;
Expand Down Expand Up @@ -102,6 +106,7 @@ public void onSheetDetailsOpened()
{
mBannerController.onPlacePageDetails();
mPlacePageTracker.onDetails();
UiUtils.show(mToolbarLayout);
}

@Override
Expand All @@ -110,6 +115,7 @@ public void onSheetCollapsed()
mPlacePage.resetScroll();
mBannerController.onPlacePagePreview();
setPeekHeight();
UiUtils.show(mToolbarLayout);
}

@Override
Expand Down Expand Up @@ -141,6 +147,7 @@ private void onHiddenInternal()
PlacePageUtils.moveViewportUp(mPlacePage, mViewportMinHeight);
UiUtils.invisible(mButtonsLayout);
mPlacePageTracker.onHidden();
UiUtils.hide(mToolbarLayout);
}

private void resizeBanner()
Expand Down Expand Up @@ -212,6 +219,7 @@ public void initialize(@Nullable Activity activity)
mViewportMinHeight = res.getDimensionPixelSize(R.dimen.viewport_min_height);
mOpenBannerTouchSlop = res.getDimensionPixelSize(R.dimen.placepage_banner_open_touch_slop);
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));
Expand Down

This file was deleted.

0 comments on commit d22fe2b

Please sign in to comment.