Commit 95e80a19 by Kang Donghun

【android15検証 @Form】画面の上と下にあるボタンが、端末のボタンに覆われ操作できない

parent a23eeda9
...@@ -28,6 +28,7 @@ import android.provider.MediaStore; ...@@ -28,6 +28,7 @@ import android.provider.MediaStore;
import android.provider.Settings; import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException; import android.provider.Settings.SettingNotFoundException;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.LayoutInflater.Factory; import android.view.LayoutInflater.Factory;
...@@ -801,6 +802,12 @@ public abstract class ABVActivity extends Activity { ...@@ -801,6 +802,12 @@ public abstract class ABVActivity extends Activity {
return (int)(getResources().getDisplayMetrics().density * size); return (int)(getResources().getDisplayMetrics().density * size);
} }
protected int convertBarRatio() {
DisplayMetrics metrics = getResources().getDisplayMetrics();
int screenHeight = isOrientationPortrait() ? metrics.heightPixels : metrics.widthPixels;
return (int) (screenHeight * 0.0015);
}
/** /**
* アプリを終了orバックグラウンドに行った場合の時間を記録 * アプリを終了orバックグラウンドに行った場合の時間を記録
*/ */
......
...@@ -8,6 +8,7 @@ import android.content.pm.ActivityInfo; ...@@ -8,6 +8,7 @@ import android.content.pm.ActivityInfo;
import android.database.Cursor; import android.database.Cursor;
import android.location.Location; import android.location.Location;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.provider.MediaStore; import android.provider.MediaStore;
...@@ -157,6 +158,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -157,6 +158,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected boolean mAddReport; // 作業追加区分 protected boolean mAddReport; // 作業追加区分
private boolean mLocationSendResult; // GPS送信フラグ private boolean mLocationSendResult; // GPS送信フラグ
protected boolean isOver35 = false;
@SuppressLint("SourceLockedOrientationActivity") @SuppressLint("SourceLockedOrientationActivity")
@Override @Override
...@@ -172,6 +174,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -172,6 +174,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
path = intent.getStringExtra("path"); path = intent.getStringExtra("path");
isLinkedContent = intent.getBooleanExtra("isLinkedContent", false); isLinkedContent = intent.getBooleanExtra("isLinkedContent", false);
mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1); mOperationId = intent.getLongExtra(ABookKeys.OPERATION_ID, -1);
isOver35 = Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
if (!isLinkedContent) { if (!isLinkedContent) {
operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId); operationDto = AbstractLogic.getLogic(OperationLogic.class).getOperation(mOperationId);
......
...@@ -467,20 +467,21 @@ public class GuideViewActivity extends ABVContentViewActivity { ...@@ -467,20 +467,21 @@ public class GuideViewActivity extends ABVContentViewActivity {
hasMultiPages = mAllPageCount > 1; hasMultiPages = mAllPageCount > 1;
if (hasMultiPages) { // サムネイルバーとページ番号表示 if (hasMultiPages) { // サムネイルバーとページ番号表示
mPageNumberLayout = (RelativeLayout)getLayoutInflater().inflate(R.layout.page_number, null); mPageNumberLayout = (RelativeLayout)getLayoutInflater().inflate(R.layout.page_number, null);
int height = isOver35
int height = (int) ((isNormalSize()? ThumbnailSeekBarLayout.NORMAL_HEIGHT: ThumbnailSeekBarLayout.LARGE_HEIGHT) * getResources().getDisplayMetrics().density); // サムネイルバーの高さ ? (int) (isNormalSize() ? ThumbnailSeekBarLayout.NORMAL_HEIGHT * getResources().getDisplayMetrics().density : ThumbnailSeekBarLayout.LARGE_HEIGHT * convertBarRatio())
mLThumViewSize = (int) (200 * (float)height / ThumbnailSeekBarLayout.LARGE_HEIGHT); // 大サムネイル表示領域の設定 : (int) ((isNormalSize() ? ThumbnailSeekBarLayout.NORMAL_HEIGHT: ThumbnailSeekBarLayout.LARGE_HEIGHT) * getResources().getDisplayMetrics().density);
mLThumViewSize = (int) ((isOver35 ? 150 : 200) * (float)height / ThumbnailSeekBarLayout.LARGE_HEIGHT); // 大サムネイル表示領域の設定
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);
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);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { if (isOver35 && isNormalSize()) {
setLayoutInsets(mSeekBarLayout); setLayoutInsets(mSeekBarLayout);
} }
mPageNumberLayout.setVisibility(View.INVISIBLE); mPageNumberLayout.setVisibility(View.INVISIBLE);
RelativeLayout.LayoutParams param = createParam(ViewGroup.LayoutParams.MATCH_PARENT, (int)(convertDensitySize(50) + 0.5f)); RelativeLayout.LayoutParams param = createParam(ViewGroup.LayoutParams.MATCH_PARENT, (int) ((isOver35 ? 50 * convertBarRatio() : convertDensitySize(50)) + 0.5f));
param.setMargins(0, 0, 0, 10); param.setMargins(0, 0, 0, 10);
param.addRule(RelativeLayout.ABOVE, mSeekBarLayout.getId()); param.addRule(RelativeLayout.ABOVE, mSeekBarLayout.getId());
mMainLayout.addView(mPageNumberLayout, param); mMainLayout.addView(mPageNumberLayout, param);
......
...@@ -333,7 +333,7 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -333,7 +333,7 @@ public class ContentViewActivity extends ABVContentViewActivity {
public boolean mShowPinFlg = true; public boolean mShowPinFlg = true;
// 移動・タップモードのフラグ // 移動・タップモードのフラグ
public boolean mMoveTaskFlg = false; public boolean mMoveTaskFlg = false;
/** /**
* スクロールステータス * スクロールステータス
*/ */
...@@ -628,20 +628,21 @@ public class ContentViewActivity extends ABVContentViewActivity { ...@@ -628,20 +628,21 @@ public class ContentViewActivity extends ABVContentViewActivity {
hasMultiPages = mAllPageCount > 1; hasMultiPages = mAllPageCount > 1;
if (hasMultiPages) { // サムネイルバーとページ番号表示 if (hasMultiPages) { // サムネイルバーとページ番号表示
mPageNumberLayout = (RelativeLayout)getLayoutInflater().inflate(R.layout.page_number, null); mPageNumberLayout = (RelativeLayout)getLayoutInflater().inflate(R.layout.page_number, null);
int height = isOver35
int height = (int) ((isNormalSize()? ThumbnailSeekBarLayout.NORMAL_HEIGHT: ThumbnailSeekBarLayout.LARGE_HEIGHT) * getResources().getDisplayMetrics().density); // サムネイルバーの高さ ? (int) (isNormalSize() ? ThumbnailSeekBarLayout.NORMAL_HEIGHT * getResources().getDisplayMetrics().density : ThumbnailSeekBarLayout.LARGE_HEIGHT * convertBarRatio())
mLThumViewSize = (int) (200 * (float)height / ThumbnailSeekBarLayout.LARGE_HEIGHT); // 大サムネイル表示領域の設定 : (int) ((isNormalSize() ? ThumbnailSeekBarLayout.NORMAL_HEIGHT: ThumbnailSeekBarLayout.LARGE_HEIGHT) * getResources().getDisplayMetrics().density);
mLThumViewSize = (int) ((isOver35 ? 150 : 200) * (float)height / ThumbnailSeekBarLayout.LARGE_HEIGHT); // 大サムネイル表示領域の設定
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);
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);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { if (isOver35 && isNormalSize()) {
setLayoutInsets(mSeekBarLayout); setLayoutInsets(mSeekBarLayout);
} }
mPageNumberLayout.setVisibility(View.INVISIBLE); mPageNumberLayout.setVisibility(View.INVISIBLE);
RelativeLayout.LayoutParams param = createParam(ViewGroup.LayoutParams.MATCH_PARENT, (int)(convertDensitySize(50) + 0.5f)); RelativeLayout.LayoutParams param = createParam(ViewGroup.LayoutParams.MATCH_PARENT, (int) ((isOver35 ? 50 * convertBarRatio() : convertDensitySize(50)) + 0.5f));
param.setMargins(0, 0, 0, 10); param.setMargins(0, 0, 0, 10);
param.addRule(RelativeLayout.ABOVE, mSeekBarLayout.getId()); param.addRule(RelativeLayout.ABOVE, mSeekBarLayout.getId());
mMainLayout.addView(mPageNumberLayout, param); mMainLayout.addView(mPageNumberLayout, param);
......
...@@ -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;
...@@ -87,6 +88,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -87,6 +88,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
private boolean isReady; private boolean isReady;
private boolean mSeekingFlag = false; private boolean mSeekingFlag = false;
private boolean isOver35 = false;
public ThumbnailSeekBarLayout(Context context, FoxitPdfCore foxitPdfCore, long contentId, int maxPageCount, boolean isLandscapeView, int displayWidth, int displayHeight, boolean isNormalSize, RelativeLayout pageNumberLayout) { public ThumbnailSeekBarLayout(Context context, FoxitPdfCore foxitPdfCore, long contentId, int maxPageCount, boolean isLandscapeView, int displayWidth, int displayHeight, boolean isNormalSize, RelativeLayout pageNumberLayout) {
...@@ -100,7 +102,9 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -100,7 +102,9 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
this.mPageNumberLayout = pageNumberLayout; this.mPageNumberLayout = pageNumberLayout;
mPdfThumbnailProvider = new PdfThumbnailProvider(context, foxitPdfCore, contentId, isNormalSize); mPdfThumbnailProvider = new PdfThumbnailProvider(context, foxitPdfCore, contentId, isNormalSize);
mPdfThumbnailProvider.setIsLandscape(isLandscapeView); mPdfThumbnailProvider.setIsLandscape(isLandscapeView);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
isOver35 = true;
}
landWidthDiffMS = mPdfThumbnailProvider.landWidthM - mPdfThumbnailProvider.landWidthS; landWidthDiffMS = mPdfThumbnailProvider.landWidthM - mPdfThumbnailProvider.landWidthS;
portWidthDiffMS = mPdfThumbnailProvider.portWidthM - mPdfThumbnailProvider.portWidthS; portWidthDiffMS = mPdfThumbnailProvider.portWidthM - mPdfThumbnailProvider.portWidthS;
marginL = (int) (marginL * mPdfThumbnailProvider.getRatio(isNormalSize)); marginL = (int) (marginL * mPdfThumbnailProvider.getRatio(isNormalSize));
...@@ -233,7 +237,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -233,7 +237,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
switch (ev.getAction() & MotionEvent.ACTION_MASK) { switch (ev.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN: case MotionEvent.ACTION_DOWN:
// 中サイズのサムネイル表示 // 中サイズのサムネイル表示
showMidThum(page, ((View)v.getParent()).getLeft() + v.getLeft() - (isLandscapeView?landWidthDiffMS:portWidthDiffMS) / 2); showMidThum(page, (isOver35 ? v.getLeft() : ((View)v.getParent()).getLeft() + v.getLeft()) - (isLandscapeView?landWidthDiffMS:portWidthDiffMS) / 2);
// 大サイズのサムネイル表示 // 大サイズのサムネイル表示
if (getContext() instanceof ContentViewActivity) { if (getContext() instanceof ContentViewActivity) {
int left = ((View)v.getParent()).getLeft() + v.getLeft() + v.getWidth() / 2 - ((ContentViewActivity)getContext()).getLThumViewSize() / 2; int left = ((View)v.getParent()).getLeft() + v.getLeft() + v.getWidth() / 2 - ((ContentViewActivity)getContext()).getLThumViewSize() / 2;
...@@ -444,7 +448,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -444,7 +448,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
else { else {
clearImageView(); clearImageView();
} }
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(midWidth, midHeight); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(midWidth, midHeight);
params.setMargins(left, marginM, marginM, marginM); params.setMargins(left, marginM, marginM, marginM);
params.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE); params.addRule(RelativeLayout.CENTER_VERTICAL, RelativeLayout.TRUE);
...@@ -534,7 +538,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -534,7 +538,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
} }
else { else {
ImageView imageView = (ImageView) linearLayout.getChildAt(pageIndex); ImageView imageView = (ImageView) linearLayout.getChildAt(pageIndex);
showMidThum(page, linearLayout.getLeft() + imageView.getLeft() - (isLandscapeView?landWidthDiffMS:portWidthDiffMS) / 2); showMidThum(page, (isOver35 ? imageView.getLeft() : linearLayout.getLeft() + imageView.getLeft()) - (isLandscapeView?landWidthDiffMS:portWidthDiffMS) / 2);
} }
} }
...@@ -562,7 +566,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout { ...@@ -562,7 +566,7 @@ public class ThumbnailSeekBarLayout extends LinearLayout {
private void loadInterval() { private void loadInterval() {
ImageView firstView = (ImageView) linearLayout.getChildAt(0); ImageView firstView = (ImageView) linearLayout.getChildAt(0);
ImageView lastView = (ImageView) linearLayout.getChildAt(linearLayout.getChildCount() - 1); ImageView lastView = (ImageView) linearLayout.getChildAt(linearLayout.getChildCount() - 1);
firstLeftX = firstView.getLeft(); firstLeftX = isOver35 ? (linearLayout.getLeft() > firstView.getLeft() ? linearLayout.getLeft() : firstView.getLeft()) : firstView.getLeft();
firstCenterX = firstLeftX + firstView.getWidth() / 2; firstCenterX = firstLeftX + firstView.getWidth() / 2;
lastCenterX = lastView.getLeft() + lastView.getWidth() / 2; lastCenterX = lastView.getLeft() + lastView.getWidth() / 2;
interval = (lastCenterX - firstCenterX) / (float)(maxPageCount - 1); interval = (lastCenterX - firstCenterX) / (float)(maxPageCount - 1);
......
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