Commit ecff1391 by Lee Jaebin

Merge branch 'features/1.0.500' into feature/1.0.500_34190

parents d85b70e3 88bdeb21
......@@ -13,6 +13,7 @@ import android.provider.MediaStore;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.OrientationEventListener;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
......@@ -239,7 +240,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@Override
protected void onResume() {
super.onResume();
try {
if (readingLogFlg) {
readingLogId = ContentLogUtil.getInstance().startContentReadLog(this, contentId, getABVUIDataCache().getPermissionAccessLocation());
......@@ -1356,6 +1356,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}
if(FileUtil.exists(tempImagePath)){ //Tempパスにファイルがある場合、編集を実行
//編集画面をコール
setFixedOrientation(true); //回転固定
PhotoEditActivity dialog = new PhotoEditActivity(ABVContentViewActivity.this, tempImagePath); //ロードして編集するイメージのパスを設定
showPhotoEditDialog(dialog);
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
......@@ -1365,6 +1366,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
webViewLoadUrl(String.format("javascript:document.getElementById('reportForm').contentWindow.changeThumbnailTagForAnd('%s','%s')", mAttachedFileName, tempImagePath));
afterABookCheckApi(mCmd, mTaskKey, 0, "", null);
mPhotoEditDialog = null;
setFixedOrientation(false); ////回転可能
}
});
}
......
......@@ -11,11 +11,7 @@ import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.os.Bundle;
import android.text.Layout;
import android.util.Base64;
import android.util.Log;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
......@@ -23,11 +19,9 @@ import android.view.Window;
import android.view.WindowManager;
import android.webkit.DownloadListener;
import android.webkit.JavascriptInterface;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageButton;
import android.widget.Toast;
import java.io.File;
import java.io.FileOutputStream;
......@@ -71,8 +65,6 @@ public class PhotoEditActivity extends Dialog {
super.onCreate(savedInstanceState);
//ダイアローグの設定
screenRequestedOrientation = ((Activity) context).getRequestedOrientation(); //編集前の画面方向を保存する。
((Activity) context).setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LOCKED); // 縦画面固定
requestWindowFeature(Window.FEATURE_NO_TITLE); //ダイアローグのタイトルバーを消す
setContentView(R.layout.photo_edit_dialog); //ダイアローグにWebViewを設定
setCanceledOnTouchOutside(false); //編集画面の外をタッチしてもダイアローグを閉じらないようにする。
......@@ -94,7 +86,7 @@ public class PhotoEditActivity extends Dialog {
case Surface.ROTATION_0: case Surface.ROTATION_180: //横
float photoRatio = (float) photoWidth / (float) photoHeight; //画面の横と縦の割合
float displayHeight = displayRectangle.height() * 0.9f; //画面の縦幅の90パーセント
float displayWidth = displayRectangle.width() * 0.9f; //画面の幅の90パーセント
float displayWidth = displayRectangle.width() * 0.9f; //画面の幅の90パーセント
int dialogWidth = (int) (displayHeight * photoRatio); //ダイアローグの横幅を計算
if(dialogWidth < displayWidth){ //計算した横幅が画面より小さい場合はそのまま設定
getWindow().setLayout(dialogWidth, ViewGroup.LayoutParams.WRAP_CONTENT);
......@@ -209,7 +201,6 @@ public class PhotoEditActivity extends Dialog {
*/
private void superDismiss(){
super.dismiss();
((Activity) context).setRequestedOrientation(screenRequestedOrientation); // 縦画面固定
}
/**
......@@ -333,4 +324,9 @@ public class PhotoEditActivity extends Dialog {
return scaledBitmap;
}
@Override
public void onWindowAttributesChanged(WindowManager.LayoutParams params) {
return;
}
}
\ No newline at end of file
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