diff options
author | Dmitry Donskoy <donskdmitry@mail.ru> | 2018-06-05 21:13:29 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-06-06 11:53:13 +0300 |
commit | 726b12e844ed53bed4acf34c70db15a014a91f16 (patch) | |
tree | 4182d627c73f598147d33b1fb3c786328e439df5 | |
parent | 7fc352c99db06ed44fe129ba552a8496c551a661 (diff) |
[android] [release-only-tag] Added offset and viewport for whats new fragmentandroid-gr-829
-rw-r--r-- | android/res/layout-land/news_page.xml | 2 | ||||
-rw-r--r-- | android/src/com/mapswithme/maps/news/BaseNewsFragment.java | 3 | ||||
-rw-r--r-- | android/src/com/mapswithme/util/UiUtils.java | 8 |
3 files changed, 11 insertions, 2 deletions
diff --git a/android/res/layout-land/news_page.xml b/android/res/layout-land/news_page.xml index eb8def11b2..621d2f81fd 100644 --- a/android/res/layout-land/news_page.xml +++ b/android/res/layout-land/news_page.xml @@ -14,9 +14,11 @@ android:layout_marginStart="@dimen/margin_double_plus" android:layout_gravity="center_vertical"/> <ScrollView + android:fillViewport="true" android:layout_width="wrap_content" android:layout_height="match_parent"> <LinearLayout + android:layout_gravity="center" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/margin_double_plus" diff --git a/android/src/com/mapswithme/maps/news/BaseNewsFragment.java b/android/src/com/mapswithme/maps/news/BaseNewsFragment.java index 73278c0512..673375c478 100644 --- a/android/src/com/mapswithme/maps/news/BaseNewsFragment.java +++ b/android/src/com/mapswithme/maps/news/BaseNewsFragment.java @@ -282,6 +282,9 @@ public abstract class BaseNewsFragment extends BaseMwmDialogFragment View content = View.inflate(getActivity(), R.layout.fragment_news, null); res.setContentView(content); + int offset = UiUtils.getStatusBarNewsFragOffset(content.getContext()); + content.setPadding(content.getLeft(), content.getTop() + offset, content.getRight(), content.getBottom()); + mPager = (ViewPager)content.findViewById(R.id.pager); fixPagerSize(); diff --git a/android/src/com/mapswithme/util/UiUtils.java b/android/src/com/mapswithme/util/UiUtils.java index 9861f2071f..feef5865f3 100644 --- a/android/src/com/mapswithme/util/UiUtils.java +++ b/android/src/com/mapswithme/util/UiUtils.java @@ -51,11 +51,9 @@ public final class UiUtils @Override public void onAnimationStart(Animation animation) {} - @Override public void onAnimationEnd(Animation animation) {} - @Override public void onAnimationRepeat(Animation animation) {} @@ -269,6 +267,12 @@ public final class UiUtils return rotation; } + public static int getStatusBarNewsFragOffset(Context context) + { + int height = getStatusBarHeight(context); + return isLandscape(context) ? height : 0; + } + public static boolean isTablet() { return MwmApplication.get().getResources().getBoolean(R.bool.tabletLayout); |