Commit 36fd7757 by Yujin Seo

Merge branch 'contract/sato/1.0.620_67472' into 'contract/sato/1.0.630'

Contract/sato/1.0.620 67472

See merge request !333
parents 46bb4157 ca5601ac
......@@ -118,7 +118,7 @@
android:name="jp.agentec.abook.abv.ui.home.activity.PreSplashActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:launchMode="singleTask"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:exported="true" >
android:theme="@style/Theme_fits_full" android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
......@@ -157,45 +157,45 @@
<activity
android:name="jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
android:theme="@style/Theme_fits_full" />
<activity
android:name="jp.agentec.abook.abv.ui.home.activity.LoginActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="LoginActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
android:theme="@style/Theme_fits_full" />
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.ContentViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:hardwareAccelerated="false"
android:hardwareAccelerated="true"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.HTMLWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar" >
android:theme="@style/Theme_fits" >
</activity>
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.EnqueteWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar" >
android:theme="@style/Theme_fits" >
</activity>
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.PreviewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
android:theme="@style/Theme_fits_full" >
</activity>
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.VideoViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
android:theme="@style/Theme_fits_full" >
</activity>
<activity
android:name="jp.agentec.abook.abv.ui.home.activity.LoginPasswordChangeActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="LoginPasswordChangeActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
android:theme="@style/Theme_fits_full" >
</activity>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity" android:theme="@android:style/Theme.NoTitleBar"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChangePasswordActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity" android:theme="@style/Theme_fits"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChangePasswordActivity" android:theme="@style/Theme_fits_full"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.ChangePasswordActivityDialog" android:theme="@style/Theme.MyTheme.ModalDialog"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.HelpActivity" android:configChanges="orientation|screenSize"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.GuideViewActivity" android:configChanges="orientation|screenSize"/>
......@@ -204,11 +204,11 @@
<activity android:name="jp.agentec.abook.abv.ui.viewer.activity.AudioPlayActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
android:theme="@style/Theme_fits_full" />
<activity android:name="jp.agentec.abook.abv.ui.viewer.activity.ImageViewActivity"
android:hardwareAccelerated="false"
android:configChanges="keyboardHidden"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
android:theme="@style/Theme_fits_full" />
<activity android:name="jp.agentec.abook.abv.ui.common.activity.ShowPushMessageDailogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -237,10 +237,10 @@
<activity
android:name="jp.agentec.abook.abv.ui.viewer.activity.OnlineHTMLWebViewActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
android:theme="@style/Theme_fits_full" >
</activity>
<!-- @Form QRコードリーダー -->
<activity android:name="jp.agentec.abook.abv.ui.home.activity.CaptureQRCodeActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.CaptureQRCodeActivity" android:theme="@style/Theme_fits_full"/>
<activity android:name="jp.agentec.abook.abv.ui.home.activity.CaptureQRCodeActivityDialog" android:theme="@android:style/Theme.Holo.Dialog.NoActionBar"/>
</application>
......
......@@ -9,7 +9,9 @@
<item name="android:windowBackground">@color/transparent</item>
</style>
<style name="AppTheme" parent="android:Theme.Light" />
<style name="AppTheme" parent="android:Theme.Light">
<item name="android:fitsSystemWindows">true</item>
</style>
<style name="Theme_Contentdetailview" parent="android:style/Theme.Translucent">
<item name="android:windowContentOverlay">@null</item>
......
......@@ -21,4 +21,13 @@
<dimen name="operation_title_text_size">20sp</dimen>
<dimen name="operation_title_normal_width">200dp</dimen>
<dimen name="operation_title_large_width">400dp</dimen>
<dimen name="opeartion_title_text_size" />
<dimen name="report_status_height_1">48dp</dimen>
<dimen name="report_status_height_2">32dp</dimen>
<dimen name="report_status_height_3">24dp</dimen>
<dimen name="report_status_width_1">80dp</dimen>
<dimen name="report_status_width_2">36dp</dimen>
</resources>
......@@ -6,35 +6,41 @@
android:layout_height="match_parent"
android:background="@drawable/setting_bg"
android:orientation="vertical"
android:padding="20dp" >
android:fitsSystemWindows="true" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingBottom="10dp" >
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="20dp">
<ImageButton
android:id="@+id/app_icon"
android:layout_width="wrap_content"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:src="@null" />
android:gravity="center_vertical"
android:paddingBottom="10dp" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:text="@string/setting"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<ImageButton
android:id="@+id/app_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:src="@null" />
<fragment
android:id="@+id/pref_fragment"
android:name="jp.agentec.abook.abv.ui.home.activity.ABookSettingFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/setting_fragment" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:text="@string/setting"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
<fragment
android:id="@+id/pref_fragment"
android:name="jp.agentec.abook.abv.ui.home.activity.ABookSettingFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/setting_fragment" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="opeartion_title_text_size" />
<dimen name="report_status_height_1">48dp</dimen>
<dimen name="report_status_height_2">32dp</dimen>
<dimen name="report_status_height_3">24dp</dimen>
<dimen name="report_status_width_1">80dp</dimen>
<dimen name="report_status_width_2">36dp</dimen>
</resources>
......@@ -30,6 +30,7 @@
<item name="android:textViewStyle">@style/TextViewABook</item>
<item name="android:alertDialogStyle">@style/Theme_ABookAlertDialog</item>
<item name="android:fitsSystemWindows">true</item>
</style>
</resources>
\ No newline at end of file
......@@ -69,5 +69,10 @@
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@drawable/translucent_background</item>
</style> -->
<style name="Theme_fits_full" parent="android:style/Theme.NoTitleBar.Fullscreen">
<item name="android:fitsSystemWindows">true</item>
</style>
<style name="Theme_fits" parent="android:style/Theme.NoTitleBar">
<item name="android:fitsSystemWindows">true</item>
</style>
</resources>
\ No newline at end of file
......@@ -4,10 +4,13 @@ import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.ui.common.vo.Size;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Build;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowMetrics;
public class DisplayUtil {
......@@ -18,10 +21,29 @@ public class DisplayUtil {
*/
public static Point getDisplaySize(Context context) {
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
Point outSize = new Point();
display.getSize(outSize);
return outSize;
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();
Point size = new Point();
display.getSize(size);
displayWidth = size.x;
displayHeight = size.y;
}
return new Point(displayWidth, displayHeight);
}
public static Size getDisplaySize2(Context context) {
......
......@@ -472,9 +472,11 @@ public class GuideViewActivity extends ABVContentViewActivity {
mSeekBarLayout = new ThumbnailSeekBarLayout(this, mFoxitPdfCore, getContentId(), mAllPageCount, isLandscapeView, mDisplaySize.width, mDisplaySize.height, isNormalSize(), mPageNumberLayout);
mSeekBarLayout.setId(id.seekbar_layout_id); // 番号は適当
mSeekBarLayout.setVisibility(View.INVISIBLE);
mSeekBarLayout.setFitsSystemWindows(true);
RelativeLayout.LayoutParams param2 = createParam(ViewGroup.LayoutParams.MATCH_PARENT, height);
param2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
mMainLayout.addView(mSeekBarLayout, param2);
mMainLayout.setFitsSystemWindows(true);
mPageNumberLayout.setVisibility(View.INVISIBLE);
RelativeLayout.LayoutParams param = createParam(ViewGroup.LayoutParams.MATCH_PARENT, (int)(convertDensitySize(50) + 0.5f));
......
......@@ -40,6 +40,8 @@ import android.view.View.OnKeyListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
......@@ -605,17 +607,17 @@ public class ContentViewActivity extends ABVContentViewActivity {
configureSize();
mMainLayout = new MmainLayout(getApplicationContext());
mMainLayout = new MmainLayout(this);
// ダミーのSurfaceViewを追加する。これを行わないとコンテンツの2ページ目に埋め込み動画がある場合は画面が一瞬真っ黒になる。
// SurfaceViewをLayoutにaddViewするタイミングで起きるが、大きさ0のSurfaceViewをここでセットすることで避けられる。
mMainLayout.addView(new SurfaceView(this), new ViewGroup.LayoutParams(0, 0));
mMainLayout.setFitsSystemWindows(true);
mContentWrapLayout = new RelativeLayout(this);
mContentWrapLayout = new RelativeLayout(getApplicationContext());
mPageScrollView = new PageScrollView(getApplicationContext());
mPageScrollView = new PageScrollView(this);
mPageScrollView.setHorizontalScrollBarEnabled(false); // ScrollBarを非表示
mPageScrollView.addView(mContentWrapLayout, new ViewGroup.LayoutParams(mAllPageCount * mDisplaySize.width, FP));
mPageScrollView.addView(mContentWrapLayout, new ViewGroup.LayoutParams(mAllPageCount * mDisplaySize.width, FP));
RelativeLayout.LayoutParams param0 = createParam(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
param0.addRule(RelativeLayout.CENTER_IN_PARENT);
......@@ -633,9 +635,11 @@ public class ContentViewActivity extends ABVContentViewActivity {
mSeekBarLayout = new ThumbnailSeekBarLayout(this, mFoxitPdfCore, getContentId(), mAllPageCount, isLandscapeView, mDisplaySize.width, mDisplaySize.height, isNormalSize(), mPageNumberLayout);
mSeekBarLayout.setId(id.seekbar_layout_id); // 番号は適当
mSeekBarLayout.setVisibility(View.INVISIBLE);
mSeekBarLayout.setFitsSystemWindows(true);
RelativeLayout.LayoutParams param2 = createParam(ViewGroup.LayoutParams.MATCH_PARENT, height);
param2.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
mMainLayout.addView(mSeekBarLayout, param2);
mMainLayout.setFitsSystemWindows(true);
mPageNumberLayout.setVisibility(View.INVISIBLE);
RelativeLayout.LayoutParams param = createParam(ViewGroup.LayoutParams.MATCH_PARENT, (int)(convertDensitySize(50) + 0.5f));
......@@ -1476,6 +1480,10 @@ public class ContentViewActivity extends ABVContentViewActivity {
return false;
}
if (mSeekBarLayout != null && mSeekBarLayout.isSeeking()) {
return false;
}
if (mPageScrollView.isZooming() == false && !isEnqueteOpening) {
stopVideo();
}
......
......@@ -23,6 +23,7 @@ import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.os.Process;
import android.view.Gravity;
......@@ -30,6 +31,9 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowInsets;
import android.view.WindowManager;
import android.view.WindowMetrics;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
......@@ -100,7 +104,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
this.mPageNumberLayout = pageNumberLayout;
mPdfThumbnailProvider = new PdfThumbnailProvider(context, foxitPdfCore, contentId, isNormalSize);
mPdfThumbnailProvider.setIsLandscape(isLandscapeView);
landWidthDiffMS = mPdfThumbnailProvider.landWidthM - mPdfThumbnailProvider.landWidthS;
portWidthDiffMS = mPdfThumbnailProvider.portWidthM - mPdfThumbnailProvider.portWidthS;
marginL = (int) (marginL * mPdfThumbnailProvider.getRatio(isNormalSize));
......@@ -110,9 +114,11 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
seekBarLayout = (RelativeLayout)layoutInflater.inflate(R.layout.thumb_seekbar, null);
seekBarLayout.setFitsSystemWindows(true);
addView(seekBarLayout);
linearLayout = (LinearLayout)seekBarLayout.findViewById(id.seekbar_liner);
linearLayout.setFitsSystemWindows(true);
width = isLandscapeView? mPdfThumbnailProvider.landWidthS: mPdfThumbnailProvider.portWidthS;
height = isLandscapeView? mPdfThumbnailProvider.landHeightS: mPdfThumbnailProvider.portHeightS;
......@@ -217,19 +223,38 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
params.setMargins(marginS, marginS, marginS, marginS);
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++) {
ImageView smallImageView = new ImageView(getContext());
final int page = indexToPages[i];
smallImageView.setLayoutParams(params);
smallImageView.setImageBitmap(dummyThumWhite);
smallImageView.setFitsSystemWindows(true);
smallImageView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent ev) {
float x = ev.getRawX();
float y = ev.getRawY();
float x = ev.getRawX() - insetLeft;
float y = ev.getRawY() - insetTop;
Logger.d(TAG, "[onTouch]:page:" + page + " action=" + str(ev.getAction()) + ", count=" + ev.getPointerCount()+ " x=" + x + " y=" + y);
switch (ev.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
// 中サイズのサムネイル表示
......@@ -254,7 +279,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
}
int pageX = (int) (firstCenterX + newPage * interval); // 現在ページ(大サムネイルの表示ページ)のx座標(さらに正確にするには各小サムネイル間のページ数で割って計算すべきだが)
Logger.d(TAG, "newPage=" + newPage+ " x=" + x + " y=" + y + " firstX=" + firstCenterX + " lastX=" + lastCenterX + " interval=" + interval + " pageX=" + pageX);
if (x < pageX - interval && newPage > 0) { // 前のページ
newPage = (int) ((x - firstCenterX + interval) / interval);
}
......@@ -264,7 +289,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
else {
break;
}
if (newPage >= 0 && newPage < maxPageCount) {
// 中サイズのサムネイル表示
showMidThum(newPage, (int) (x - (isLandscapeView? mPdfThumbnailProvider.landWidthM: mPdfThumbnailProvider.portWidthM) / 2));
......@@ -276,10 +301,9 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
}
}
break;
case MotionEvent.ACTION_UP:
mSeekingFlag = false;
if (getContext() instanceof ContentViewActivity) {
((ContentViewActivity)getContext()).jumpToPage(newPage>=0 && newPage<maxPageCount? newPage: page); // ページ遷移
((ContentViewActivity)getContext()).setToolbarVisable(false);
......@@ -289,6 +313,9 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
((GuideViewActivity)getContext()).setToolbarVisable(false);
((GuideViewActivity)getContext()).removeLargeThumView();
}
v.post(() -> {
mSeekingFlag = false;
});
clearImageView();
newPage = -1;
break;
......@@ -444,7 +471,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
else {
clearImageView();
}
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(midWidth, midHeight);
params.setMargins(left, marginM, marginM, marginM);
params.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE);
......
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