Commit 5ffd63b8 by Kim Jinsung

THETAプレビュー画面から転送後、THETAライブラリ画面に戻ると「転送済み」文字列非表示問題対応

parent 8b08286c
...@@ -134,4 +134,5 @@ public class ABookKeys { ...@@ -134,4 +134,5 @@ public class ABookKeys {
public static final String THETA_FILE_ID = "OBJECT_ID"; public static final String THETA_FILE_ID = "OBJECT_ID";
public static final String THETA_THUMBNAIL = "THUMBNAIL"; public static final String THETA_THUMBNAIL = "THUMBNAIL";
public static final String THETA_OLD_VERSION_FLG = "thetaOldVersionFlg"; //true:API2.0利用、false:API2.1利用 public static final String THETA_OLD_VERSION_FLG = "thetaOldVersionFlg"; //true:API2.0利用、false:API2.1利用
public static final String THETA_LIST_ACTIVITY_FLG = "thetaListActivityFlg";
} }
...@@ -33,6 +33,7 @@ import jp.agentec.abook.abv.ui.viewer.activity.theta.task.LoadPhotoTask; ...@@ -33,6 +33,7 @@ import jp.agentec.abook.abv.ui.viewer.activity.theta.task.LoadPhotoTask;
*/ */
public class ThetaImageListActivity extends ThetaActivity { public class ThetaImageListActivity extends ThetaActivity {
private static final String TAG = "ThetaImageListActivity"; private static final String TAG = "ThetaImageListActivity";
private static int THETA_PREVIEW_BACK_ACTIVITY = 1000;
private ListView mImageListView; private ListView mImageListView;
private List<ImageRow> mImageRows; private List<ImageRow> mImageRows;
private int mSelectedPosition; private int mSelectedPosition;
...@@ -113,8 +114,9 @@ public class ThetaImageListActivity extends ThetaActivity { ...@@ -113,8 +114,9 @@ public class ThetaImageListActivity extends ThetaActivity {
if (selectedItem.isPhoto()) { if (selectedItem.isPhoto()) {
Intent intent = new Intent(); Intent intent = new Intent();
intent.putExtra(ABookKeys.THETA_FILE_ID, selectedItem.getFileId()); intent.putExtra(ABookKeys.THETA_FILE_ID, selectedItem.getFileId());
intent.putExtra(ABookKeys.THETA_LIST_ACTIVITY_FLG, true);
intent.setClassName(getPackageName(), ThetaImagePreviewActivity.class.getName()); intent.setClassName(getPackageName(), ThetaImagePreviewActivity.class.getName());
startActivity(intent); startActivityForResult(intent, THETA_PREVIEW_BACK_ACTIVITY);
} else { } else {
Logger.e(TAG, "is not Photo"); Logger.e(TAG, "is not Photo");
} }
...@@ -191,4 +193,13 @@ public class ThetaImageListActivity extends ThetaActivity { ...@@ -191,4 +193,13 @@ public class ThetaImageListActivity extends ThetaActivity {
} }
} }
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
//THETAプレビュー画面から転送したあと、戻ったとき再描画を行う。
if (requestCode == THETA_PREVIEW_BACK_ACTIVITY && resultCode == RESULT_OK) {
showProgressPopup();
new ImageListTask(this).execute();
}
}
} }
...@@ -34,18 +34,23 @@ public class ThetaImagePreviewActivity extends ThetaActivity { ...@@ -34,18 +34,23 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
private GLPhotoView mGLPhotoView; private GLPhotoView mGLPhotoView;
private Photo mTexture; private Photo mTexture;
private String mFileId; private String mFileId;
private boolean isSavedSuccess;
private boolean isThetaListActivityBack;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Logger.d(TAG, "onCreate"); Logger.d(TAG, "onCreate");
setContentView(R.layout.ac_theta_image_preview); setContentView(R.layout.ac_theta_image_preview);
isSavedSuccess = false;
// 戻るボタン // 戻るボタン
Button backBtn = findViewById(R.id.btn_back); Button backBtn = findViewById(R.id.btn_back);
backBtn.setOnClickListener(new View.OnClickListener() { backBtn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
//転送後にTHETAライブラリ再描画のため
if (isThetaListActivityBack && isSavedSuccess) {
setResult(RESULT_OK);
}
finish(); finish();
} }
}); });
...@@ -62,6 +67,7 @@ public class ThetaImagePreviewActivity extends ThetaActivity { ...@@ -62,6 +67,7 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
showProgressPopup(); showProgressPopup();
if (mThetaHelper.thetaImageLocalSave(mTexture.getPhoto(), mFileId)) { if (mThetaHelper.thetaImageLocalSave(mTexture.getPhoto(), mFileId)) {
showSimpleAlertDialog(R.string.app_name, R.string.msg_theta_image_send_success); showSimpleAlertDialog(R.string.app_name, R.string.msg_theta_image_send_success);
isSavedSuccess = true;
} else { } else {
showSimpleAlertDialog(R.string.app_name, R.string.msg_theta_image_send_fail); showSimpleAlertDialog(R.string.app_name, R.string.msg_theta_image_send_fail);
} }
...@@ -73,6 +79,8 @@ public class ThetaImagePreviewActivity extends ThetaActivity { ...@@ -73,6 +79,8 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
Intent intent = getIntent(); Intent intent = getIntent();
this.mFileId = intent.getStringExtra(ABookKeys.THETA_FILE_ID); this.mFileId = intent.getStringExtra(ABookKeys.THETA_FILE_ID);
this.isThetaListActivityBack = intent.getBooleanExtra(ABookKeys.THETA_LIST_ACTIVITY_FLG, false);
mGLPhotoView = findViewById(R.id.photo_image); mGLPhotoView = findViewById(R.id.photo_image);
mGLPhotoView.setmRotateInertia(mRotateInertia); mGLPhotoView.setmRotateInertia(mRotateInertia);
......
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