From 5ea855ed618f3a90d14a06b9e3380b5f0a10dc71 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Wed, 3 Feb 2021 14:13:00 +0200 Subject: [PATCH] UI fixes --- OsmAnd/res/layout/fragment_opr_login.xml | 52 +++++++------------ .../openplacereviews/OprStartFragment.java | 19 +++++-- 2 files changed, 34 insertions(+), 37 deletions(-) diff --git a/OsmAnd/res/layout/fragment_opr_login.xml b/OsmAnd/res/layout/fragment_opr_login.xml index e941075f54..ee969b1a74 100644 --- a/OsmAnd/res/layout/fragment_opr_login.xml +++ b/OsmAnd/res/layout/fragment_opr_login.xml @@ -1,36 +1,22 @@ - + - + android:gravity="center_vertical" + android:padding="0dp" /> - - - - - + android:layout_height="0dp" + android:layout_weight="1"> + app:typeface="@string/font_roboto_regular" /> + - + + - \ No newline at end of file + \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java b/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java index 98517d0a70..e1f5b56e9d 100644 --- a/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java +++ b/OsmAnd/src/net/osmand/plus/openplacereviews/OprStartFragment.java @@ -16,10 +16,12 @@ import android.widget.TextView; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.appcompat.widget.Toolbar; import androidx.browser.customtabs.CustomTabsIntent; import androidx.fragment.app.FragmentActivity; import androidx.fragment.app.FragmentManager; +import net.osmand.AndroidUtils; import net.osmand.PlatformUtil; import net.osmand.plus.R; import net.osmand.plus.UiUtilities; @@ -37,15 +39,22 @@ public class OprStartFragment extends BaseOsmAndFragment implements OprAuthoriza @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { nightMode = getMyApplication().getDaynightHelper().isNightModeForMapControls(); - View v = UiUtilities.getInflater(requireMyActivity(), nightMode).inflate(R.layout.fragment_opr_login, container, - false); - View createAccount = v.findViewById(R.id.register_opr_create_account); - v.findViewById(R.id.back_button).setOnClickListener(new View.OnClickListener() { + + View v = UiUtilities.getInflater(requireMyActivity(), nightMode).inflate(R.layout.fragment_opr_login, container, false); + AndroidUtils.addStatusBarPadding21v(requireMyActivity(), v); + + Toolbar toolbar = (Toolbar) v.findViewById(R.id.toolbar); + int icBackResId = AndroidUtils.getNavigationIconResId(v.getContext()); + toolbar.setNavigationIcon(getContentIcon(icBackResId)); + toolbar.setNavigationContentDescription(R.string.access_shared_string_navigate_up); + toolbar.setNavigationOnClickListener(new View.OnClickListener() { @Override - public void onClick(View view) { + public void onClick(View v) { dismiss(); } }); + + View createAccount = v.findViewById(R.id.register_opr_create_account); UiUtilities.setupDialogButton(nightMode, createAccount, UiUtilities.DialogButtonType.PRIMARY, R.string.register_opr_create_new_account); createAccount.setOnClickListener(new View.OnClickListener() {