Commit 6e68cae2 by Yujin Seo

Merge branch 'features/1.4.530_67550' into 'features/1.4.530'

#67550 【android15検証 Check】一部のボタンが、端末のボタン類に覆われ操作できない

See merge request !334
parents 27a84478 458fc1a8
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
<activity <activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity" android:name="jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="false" android:hardwareAccelerated="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" /> android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" />
<activity <activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity" android:name="jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity"
......
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/setting_bg" android:background="@drawable/setting_bg"
android:orientation="vertical" android:orientation="vertical"
android:padding="20dp" > android:fitsSystemWindows="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -37,4 +43,5 @@ ...@@ -37,4 +43,5 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:layout="@layout/setting_fragment" /> tools:layout="@layout/setting_fragment" />
</LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/app_color" android:background="@color/app_color"
android:fitsSystemWindows="true"
android:orientation="vertical" > android:orientation="vertical" >
<RelativeLayout <RelativeLayout
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
<item name="android:textColorHint">@android:color/darker_gray</item> <item name="android:textColorHint">@android:color/darker_gray</item>
<item name="android:editTextBackground">@drawable/bg_edit_text_view</item> <item name="android:editTextBackground">@drawable/bg_edit_text_view</item>
<!-- add EditText Style -->
<item name="android:fitsSystemWindows">true</item>
</style> </style>
<style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light"> <style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
...@@ -58,6 +60,7 @@ ...@@ -58,6 +60,7 @@
<item name="android:editTextColor">@android:color/black</item> <item name="android:editTextColor">@android:color/black</item>
<item name="android:textColorHint">@android:color/darker_gray</item> <item name="android:textColorHint">@android:color/darker_gray</item>
<item name="android:editTextBackground">@drawable/bg_edit_text_view</item> <item name="android:editTextBackground">@drawable/bg_edit_text_view</item>
<item name="android:fitsSystemWindows">true</item>
</style> </style>
<!-- add ProgressDialog Style --> <!-- add ProgressDialog Style -->
...@@ -65,6 +68,7 @@ ...@@ -65,6 +68,7 @@
<item name="android:colorAccent">@color/colorPrimary</item> <item name="android:colorAccent">@color/colorPrimary</item>
<item name="colorAccent">@color/colorPrimary</item> <item name="colorAccent">@color/colorPrimary</item>
<item name="android:background">#00FFFFFF</item> <item name="android:background">#00FFFFFF</item>
<item name="android:fitsSystemWindows">true</item>
</style> </style>
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"> <resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme_Contentdetailview" parent="android:style/Theme.Dialog"> <style name="Theme_Contentdetailview" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@null</item> <item name="android:windowBackground">@null</item>
<item name="android:fitsSystemWindows">true</item>
</style> </style>
<style name="Theme_NewDialog"> <style name="Theme_NewDialog">
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">false</item> <item name="android:backgroundDimEnabled">false</item>
<item name="android:background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item>
<item name="android:fitsSystemWindows">true</item>
</style> </style>
<style name="Theme_SpareBoardDialog" parent="@android:style/Theme.Dialog"> <style name="Theme_SpareBoardDialog" parent="@android:style/Theme.Dialog">
...@@ -45,17 +47,20 @@ ...@@ -45,17 +47,20 @@
<item name="android:bottomBright">@color/basic_blue1</item> <item name="android:bottomBright">@color/basic_blue1</item>
<item name="android:bottomDark">@color/basic_blue1</item> <item name="android:bottomDark">@color/basic_blue1</item>
<item name="android:bottomMedium">@color/basic_blue1</item> <item name="android:bottomMedium">@color/basic_blue1</item>
<item name="android:fitsSystemWindows">true</item>
</style> </style>
<style name="Theme_MyDialog" parent="@android:style/Theme.Dialog"> <style name="Theme_MyDialog" parent="@android:style/Theme.Dialog">
<item name="android:alertDialogStyle">@style/Theme_ABookAlertDialog</item> <item name="android:alertDialogStyle">@style/Theme_ABookAlertDialog</item>
<item name="android:buttonStyle">@style/ButtonABookDark</item> <item name="android:buttonStyle">@style/ButtonABookDark</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
<item name="android:fitsSystemWindows">true</item>
</style> </style>
<style name="Theme_CustomProgressDialog" parent="android:style/Theme.Dialog"> <style name="Theme_CustomProgressDialog" parent="android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item> <item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
<item name="android:fitsSystemWindows">true</item>
</style> </style>
......
...@@ -4,10 +4,13 @@ import jp.agentec.abook.abv.bl.common.log.Logger; ...@@ -4,10 +4,13 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.ui.common.vo.Size; import jp.agentec.abook.abv.ui.common.vo.Size;
import android.content.Context; import android.content.Context;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect;
import android.os.Build; import android.os.Build;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.Display; import android.view.Display;
import android.view.WindowInsets;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.WindowMetrics;
public class DisplayUtil { public class DisplayUtil {
...@@ -18,10 +21,30 @@ public class DisplayUtil { ...@@ -18,10 +21,30 @@ public class DisplayUtil {
*/ */
public static Point getDisplaySize(Context context) { public static Point getDisplaySize(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
int displayWidth;
int displayHeight;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
WindowMetrics metrics = wm.getCurrentWindowMetrics();
Rect bounds = metrics.getBounds();
WindowInsets windowInsets = metrics.getWindowInsets();
android.graphics.Insets insets = windowInsets.getInsets(
WindowInsets.Type.navigationBars() | WindowInsets.Type.displayCutout()
);
displayWidth = bounds.width() - (insets.left + insets.right);
displayHeight = bounds.height() - (insets.top + insets.bottom);
} else {
Display display = wm.getDefaultDisplay(); Display display = wm.getDefaultDisplay();
Point outSize = new Point(); Point size = new Point();
display.getSize(outSize); display.getSize(size);
return outSize; displayWidth = size.x;
displayHeight = size.y;
}
return new Point(displayWidth, displayHeight);
} }
public static Size getDisplaySize2(Context context) { public static Size getDisplaySize2(Context context) {
......
...@@ -632,15 +632,16 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -632,15 +632,16 @@ public class ContentViewActivity extends ABVContentViewActivity {
configureSize(); configureSize();
mMainLayout = new MmainLayout(getApplicationContext()); mMainLayout = new MmainLayout(this);
// ダミーのSurfaceViewを追加する。これを行わないとコンテンツの2ページ目に埋め込み動画がある場合は画面が一瞬真っ黒になる。 // ダミーのSurfaceViewを追加する。これを行わないとコンテンツの2ページ目に埋め込み動画がある場合は画面が一瞬真っ黒になる。
// SurfaceViewをLayoutにaddViewするタイミングで起きるが、大きさ0のSurfaceViewをここでセットすることで避けられる。 // SurfaceViewをLayoutにaddViewするタイミングで起きるが、大きさ0のSurfaceViewをここでセットすることで避けられる。
mMainLayout.addView(new SurfaceView(this), new ViewGroup.LayoutParams(0, 0)); mMainLayout.addView(new SurfaceView(this), new ViewGroup.LayoutParams(0, 0));
mMainLayout.setFitsSystemWindows(true);
mContentWrapLayout = new RelativeLayout(getApplicationContext()); mContentWrapLayout = new RelativeLayout(this);
mPageScrollView = new PageScrollView(getApplicationContext()); mPageScrollView = new PageScrollView(this);
mPageScrollView.setHorizontalScrollBarEnabled(false); // ScrollBarを非表示 mPageScrollView.setHorizontalScrollBarEnabled(false); // ScrollBarを非表示
mPageScrollView.addView(mContentWrapLayout, new ViewGroup.LayoutParams(mAllPageCount * mDisplaySize.width, FP)); mPageScrollView.addView(mContentWrapLayout, new ViewGroup.LayoutParams(mAllPageCount * mDisplaySize.width, FP));
mPageScrollView.setBackgroundColor(Color.BLACK); mPageScrollView.setBackgroundColor(Color.BLACK);
...@@ -661,6 +662,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -661,6 +662,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
mSeekBarLayout = new ThumbnailSeekBarLayout(this, mFoxitPdfCore, getContentId(), mAllPageCount, isLandscapeView, mDisplaySize.width, mDisplaySize.height, isNormalSize(), mPageNumberLayout); mSeekBarLayout = new ThumbnailSeekBarLayout(this, mFoxitPdfCore, getContentId(), mAllPageCount, isLandscapeView, mDisplaySize.width, mDisplaySize.height, isNormalSize(), mPageNumberLayout);
mSeekBarLayout.setId(id.seekbar_layout_id); // 番号は適当 mSeekBarLayout.setId(id.seekbar_layout_id); // 番号は適当
mSeekBarLayout.setVisibility(View.INVISIBLE); mSeekBarLayout.setVisibility(View.INVISIBLE);
mSeekBarLayout.setFitsSystemWindows(true);
RelativeLayout.LayoutParams param2 = createParam(ViewGroup.LayoutParams.MATCH_PARENT, height); RelativeLayout.LayoutParams param2 = createParam(ViewGroup.LayoutParams.MATCH_PARENT, height);
param2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); param2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
mMainLayout.addView(mSeekBarLayout, param2); mMainLayout.addView(mSeekBarLayout, param2);
...@@ -1541,6 +1543,10 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -1541,6 +1543,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
return false; return false;
} }
if (mSeekBarLayout != null && mSeekBarLayout.isSeeking()) {
return false;
}
if (mPageScrollView.isZooming() == false && !isEnqueteOpening) { if (mPageScrollView.isZooming() == false && !isEnqueteOpening) {
stopVideo(); stopVideo();
} }
......
...@@ -23,6 +23,7 @@ import android.graphics.BitmapFactory; ...@@ -23,6 +23,7 @@ import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options; import android.graphics.BitmapFactory.Options;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler; import android.os.Handler;
import android.os.Process; import android.os.Process;
import android.view.Gravity; import android.view.Gravity;
...@@ -30,6 +31,9 @@ import android.view.LayoutInflater; ...@@ -30,6 +31,9 @@ import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowMetrics;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
...@@ -110,9 +114,11 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -110,9 +114,11 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
seekBarLayout = (RelativeLayout)layoutInflater.inflate(R.layout.thumb_seekbar, null); seekBarLayout = (RelativeLayout)layoutInflater.inflate(R.layout.thumb_seekbar, null);
seekBarLayout.setFitsSystemWindows(true);
addView(seekBarLayout); addView(seekBarLayout);
linearLayout = (LinearLayout)seekBarLayout.findViewById(id.seekbar_liner); linearLayout = (LinearLayout)seekBarLayout.findViewById(id.seekbar_liner);
linearLayout.setFitsSystemWindows(true);
width = isLandscapeView? mPdfThumbnailProvider.landWidthS: mPdfThumbnailProvider.portWidthS; width = isLandscapeView? mPdfThumbnailProvider.landWidthS: mPdfThumbnailProvider.portWidthS;
height = isLandscapeView? mPdfThumbnailProvider.landHeightS: mPdfThumbnailProvider.portHeightS; height = isLandscapeView? mPdfThumbnailProvider.landHeightS: mPdfThumbnailProvider.portHeightS;
...@@ -217,17 +223,35 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -217,17 +223,35 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
params.setMargins(marginS, marginS, marginS, marginS); params.setMargins(marginS, marginS, marginS, marginS);
params.gravity = Gravity.CENTER_VERTICAL; params.gravity = Gravity.CENTER_VERTICAL;
int insetLeft;
int insetTop;
WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);
if (wm != null && Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
WindowMetrics metrics = wm.getCurrentWindowMetrics();
WindowInsets insets = metrics.getWindowInsets();
android.graphics.Insets systemBars = insets.getInsets(
WindowInsets.Type.systemBars() | WindowInsets.Type.displayCutout()
);
insetLeft = systemBars.left;
insetTop = systemBars.top;
} else {
insetTop = 0;
insetLeft = 0;
}
for (int i=0; i < maxThumCount; i++) { for (int i=0; i < maxThumCount; i++) {
ImageView smallImageView = new ImageView(getContext()); ImageView smallImageView = new ImageView(getContext());
final int page = indexToPages[i]; final int page = indexToPages[i];
smallImageView.setLayoutParams(params); smallImageView.setLayoutParams(params);
smallImageView.setImageBitmap(dummyThumWhite); smallImageView.setImageBitmap(dummyThumWhite);
smallImageView.setFitsSystemWindows(true);
smallImageView.setOnTouchListener(new OnTouchListener() { smallImageView.setOnTouchListener(new OnTouchListener() {
@Override @Override
public boolean onTouch(View v, MotionEvent ev) { public boolean onTouch(View v, MotionEvent ev) {
float x = ev.getRawX(); float x = ev.getRawX() - insetLeft;
float y = ev.getRawY(); float y = ev.getRawY() - insetTop;
Logger.d(TAG, "[onTouch]:page:" + page + " action=" + str(ev.getAction()) + ", count=" + ev.getPointerCount()+ " x=" + x + " y=" + y); Logger.d(TAG, "[onTouch]:page:" + page + " action=" + str(ev.getAction()) + ", count=" + ev.getPointerCount()+ " x=" + x + " y=" + y);
switch (ev.getAction() & MotionEvent.ACTION_MASK) { switch (ev.getAction() & MotionEvent.ACTION_MASK) {
...@@ -279,7 +303,6 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -279,7 +303,6 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
break; break;
case MotionEvent.ACTION_UP: case MotionEvent.ACTION_UP:
mSeekingFlag = false;
if (getContext() instanceof ContentViewActivity) { if (getContext() instanceof ContentViewActivity) {
((ContentViewActivity)getContext()).jumpToPage(newPage>=0 && newPage<maxPageCount? newPage: page); // ページ遷移 ((ContentViewActivity)getContext()).jumpToPage(newPage>=0 && newPage<maxPageCount? newPage: page); // ページ遷移
((ContentViewActivity)getContext()).setToolbarVisable(false); ((ContentViewActivity)getContext()).setToolbarVisable(false);
...@@ -289,6 +312,9 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -289,6 +312,9 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
((GuideViewActivity)getContext()).setToolbarVisable(false); ((GuideViewActivity)getContext()).setToolbarVisable(false);
((GuideViewActivity)getContext()).removeLargeThumView(); ((GuideViewActivity)getContext()).removeLargeThumView();
} }
v.post(() -> {
mSeekingFlag = false;
});
clearImageView(); clearImageView();
newPage = -1; newPage = -1;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment