|
@@ -38,6 +38,9 @@ import android.widget.ImageButton;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.Toast;
|
|
|
|
|
|
+import androidx.annotation.Nullable;
|
|
|
+import androidx.annotation.VisibleForTesting;
|
|
|
+
|
|
|
import com.box.androidsdk.content.models.BoxFile;
|
|
|
import com.box.androidsdk.content.requests.BoxRequestsMetadata;
|
|
|
import com.epson.iprint.prtlogger.Analytics;
|
|
@@ -116,76 +119,76 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
}
|
|
|
|
|
|
public void onPageStarted(WebView webView, String str, Bitmap bitmap) {
|
|
|
- if (!WebviewActivity.this.checkSharepage) {
|
|
|
- WebviewActivity.mLoadWebLayout.setVisibility(View.VISIBLE);
|
|
|
+ if (!checkSharepage) {
|
|
|
+ mLoadWebLayout.setVisibility(View.VISIBLE);
|
|
|
} else {
|
|
|
- WebviewActivity.this.showLoadingDialog();
|
|
|
+ showLoadingDialog();
|
|
|
}
|
|
|
WebviewActivity webviewActivity = WebviewActivity.this;
|
|
|
- webviewActivity.setTextOnUrlEditText(webviewActivity.fixUrl(str));
|
|
|
- boolean unused = WebviewActivity.mIsFinish = false;
|
|
|
- boolean unused2 = WebviewActivity.mCanStop = true;
|
|
|
- WebviewActivity.this.setClearButtonAppearance(0);
|
|
|
- boolean unused3 = WebviewActivity.mCanRefresh = false;
|
|
|
- WebviewActivity.this.invalidateOptionsMenu();
|
|
|
+ setTextOnUrlEditText(fixUrl(str));
|
|
|
+ boolean unused = mIsFinish = false;
|
|
|
+ boolean unused2 = mCanStop = true;
|
|
|
+ setClearButtonAppearance(0);
|
|
|
+ boolean unused3 = mCanRefresh = false;
|
|
|
+ invalidateOptionsMenu();
|
|
|
}
|
|
|
|
|
|
public void onPageFinished(WebView webView, String str) {
|
|
|
boolean z;
|
|
|
Map<String, ?> all;
|
|
|
- EPLog.d(WebviewActivity.TAG, "onPageFinished: " + str);
|
|
|
- boolean unused = WebviewActivity.mIsFinish = true;
|
|
|
- boolean unused2 = WebviewActivity.mCanRefresh = true;
|
|
|
- boolean unused3 = WebviewActivity.mCanStop = false;
|
|
|
- WebviewActivity.this.setClearButtonAppearance(1);
|
|
|
- if (!WebviewActivity.this.getTitle().toString().equals("Web page not available")) {
|
|
|
- String unused4 = WebviewActivity.this.strUrlIn = str;
|
|
|
- String unused5 = WebviewActivity.this.inURL = null;
|
|
|
- WebviewActivity.mIsLoadError = false;
|
|
|
+ EPLog.d(TAG, "onPageFinished: " + str);
|
|
|
+ boolean unused = mIsFinish = true;
|
|
|
+ boolean unused2 = mCanRefresh = true;
|
|
|
+ boolean unused3 = mCanStop = false;
|
|
|
+ setClearButtonAppearance(1);
|
|
|
+ if (!getTitle().toString().equals("Web page not available")) {
|
|
|
+ String unused4 = strUrlIn = str;
|
|
|
+ String unused5 = inURL = null;
|
|
|
+ mIsLoadError = false;
|
|
|
} else {
|
|
|
- WebviewActivity.mIsLoadError = true;
|
|
|
+ mIsLoadError = true;
|
|
|
}
|
|
|
- WebviewActivity.this.invalidateOptionsMenu();
|
|
|
- if (!WebviewActivity.this.isBuy && !WebviewActivity.this.isFaq && !WebviewActivity.this.isInfo) {
|
|
|
- WebviewActivity.mStrictMode.permitAll();
|
|
|
+ invalidateOptionsMenu();
|
|
|
+ if (!isBuy && !isFaq && !isInfo) {
|
|
|
+ mStrictMode.permitAll();
|
|
|
WebviewActivity webviewActivity = WebviewActivity.this;
|
|
|
- SharedPreferences unused6 = webviewActivity.statePre = webviewActivity.getSharedPreferences("history", 0);
|
|
|
- if (WebviewActivity.mIsFistLoad || (all = WebviewActivity.this.statePre.getAll()) == null) {
|
|
|
+ SharedPreferences unused6 = statePre = getSharedPreferences("history", 0);
|
|
|
+ if (mIsFistLoad || (all = statePre.getAll()) == null) {
|
|
|
z = false;
|
|
|
} else {
|
|
|
- WebviewActivity.mListUrl.clear();
|
|
|
+ mListUrl.clear();
|
|
|
for (String next : all.keySet()) {
|
|
|
HashMap hashMap = new HashMap();
|
|
|
hashMap.put("key", next);
|
|
|
hashMap.put(BoxRequestsMetadata.UpdateItemMetadata.BoxMetadataUpdateTask.VALUE, all.get(next).toString());
|
|
|
- WebviewActivity.mListUrl.add(hashMap);
|
|
|
+ mListUrl.add(hashMap);
|
|
|
}
|
|
|
WebviewActivity webviewActivity2 = WebviewActivity.this;
|
|
|
int unused7 = webviewActivity2.countUrl = webviewActivity2.mListUrl.size();
|
|
|
z = false;
|
|
|
- for (int i = 0; i < WebviewActivity.mListUrl.size(); i++) {
|
|
|
- if (str.equalsIgnoreCase((String) ((HashMap) WebviewActivity.mListUrl.get(i)).get(BoxRequestsMetadata.UpdateItemMetadata.BoxMetadataUpdateTask.VALUE))) {
|
|
|
+ for (int i = 0; i < mListUrl.size(); i++) {
|
|
|
+ if (str.equalsIgnoreCase((String) ((HashMap) mListUrl.get(i)).get(BoxRequestsMetadata.UpdateItemMetadata.BoxMetadataUpdateTask.VALUE))) {
|
|
|
z = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (!z || WebviewActivity.mIsFistLoad) {
|
|
|
+ if (!z || mIsFistLoad) {
|
|
|
HashMap hashMap2 = new HashMap();
|
|
|
- WebviewActivity.access$1308(WebviewActivity.this);
|
|
|
+ access$1308(WebviewActivity.this);
|
|
|
WebviewActivity webviewActivity3 = WebviewActivity.this;
|
|
|
SharedPreferences.Editor unused8 = webviewActivity3.stateEditor = webviewActivity3.statePre.edit();
|
|
|
- WebviewActivity.this.stateEditor.putString(String.valueOf(WebviewActivity.this.countUrl), str);
|
|
|
- EPLog.i("Save countUrl " + WebviewActivity.this.countUrl + " : ", str);
|
|
|
- WebviewActivity.this.stateEditor.commit();
|
|
|
- hashMap2.put("key", String.valueOf(WebviewActivity.this.countUrl));
|
|
|
+ stateEditor.putString(String.valueOf(countUrl), str);
|
|
|
+ EPLog.i("Save countUrl " + countUrl + " : ", str);
|
|
|
+ stateEditor.commit();
|
|
|
+ hashMap2.put("key", String.valueOf(countUrl));
|
|
|
hashMap2.put(BoxRequestsMetadata.UpdateItemMetadata.BoxMetadataUpdateTask.VALUE, str);
|
|
|
- WebviewActivity.mListUrl.add(hashMap2);
|
|
|
- WebviewActivity.mIsFistLoad = false;
|
|
|
- for (int i2 = 0; i2 < WebviewActivity.mListUrl.size(); i2++) {
|
|
|
- EPLog.i(((String) ((HashMap) WebviewActivity.mListUrl.get(i2)).get("key")) + " : ", (String) ((HashMap) WebviewActivity.mListUrl.get(i2)).get(BoxRequestsMetadata.UpdateItemMetadata.BoxMetadataUpdateTask.VALUE));
|
|
|
+ mListUrl.add(hashMap2);
|
|
|
+ mIsFistLoad = false;
|
|
|
+ for (int i2 = 0; i2 < mListUrl.size(); i2++) {
|
|
|
+ EPLog.i(((String) ((HashMap) mListUrl.get(i2)).get("key")) + " : ", (String) ((HashMap) mListUrl.get(i2)).get(BoxRequestsMetadata.UpdateItemMetadata.BoxMetadataUpdateTask.VALUE));
|
|
|
}
|
|
|
} else {
|
|
|
- WebviewActivity.mIsFistLoad = false;
|
|
|
+ mIsFistLoad = false;
|
|
|
EPLog.i("Link: " + str, " already exist");
|
|
|
}
|
|
|
if (!str.startsWith("file://")) {
|
|
@@ -193,29 +196,29 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
SharedPreferences unused9 = webviewActivity4.statePre = webviewActivity4.getSharedPreferences(CommonDefine.SAVE_URL, 0);
|
|
|
WebviewActivity webviewActivity5 = WebviewActivity.this;
|
|
|
SharedPreferences.Editor unused10 = webviewActivity5.stateEditor = webviewActivity5.statePre.edit();
|
|
|
- WebviewActivity.this.stateEditor.putString(CommonDefine.SAVE_URL, str);
|
|
|
- WebviewActivity.this.stateEditor.commit();
|
|
|
+ stateEditor.putString(CommonDefine.SAVE_URL, str);
|
|
|
+ stateEditor.commit();
|
|
|
}
|
|
|
- WebviewActivity.mStrictMode.restoreStatus();
|
|
|
+ mStrictMode.restoreStatus();
|
|
|
}
|
|
|
- if (WebviewActivity.this.checkSharepage && !WebviewActivity.this.captureStart) {
|
|
|
- WebviewActivity.this.previewWeb();
|
|
|
+ if (checkSharepage && !captureStart) {
|
|
|
+ previewWeb();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void onReceivedError(WebView webView, int i, String str, String str2) {
|
|
|
WebviewActivity webviewActivity = WebviewActivity.this;
|
|
|
- webviewActivity.mErrorDialog = webviewActivity.createDialog(str);
|
|
|
+ mErrorDialog = createDialog(str);
|
|
|
try {
|
|
|
- WebviewActivity.mErrorDialog.show();
|
|
|
+ mErrorDialog.show();
|
|
|
} catch (WindowManager.BadTokenException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void onReceivedSslError(WebView webView, final SslErrorHandler sslErrorHandler, SslError sslError) {
|
|
|
- EPLog.d(WebviewActivity.TAG, "SSL error: " + sslError);
|
|
|
- if (!WebviewActivity.this.isFinishing()) {
|
|
|
+ EPLog.d(TAG, "SSL error: " + sslError);
|
|
|
+ if (!isFinishing()) {
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(WebviewActivity.this);
|
|
|
builder.setIcon(R.drawable.ic_action_warning);
|
|
|
builder.setTitle("SSL error");
|
|
@@ -223,13 +226,13 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
sslErrorHandler.proceed();
|
|
|
}
|
|
|
- }).setNegativeButton(WebviewActivity.this.getResources().getString(R.string.str_cancel), new DialogInterface.OnClickListener() {
|
|
|
+ }).setNegativeButton(getResources().getString(R.string.str_cancel), new DialogInterface.OnClickListener() {
|
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
sslErrorHandler.cancel();
|
|
|
- if (WebviewActivity.this.checkSharepage) {
|
|
|
- boolean unused = WebviewActivity.this.checkSharepage = false;
|
|
|
- WebviewActivity.this.setResult(0);
|
|
|
- WebviewActivity.this.finish();
|
|
|
+ if (checkSharepage) {
|
|
|
+ boolean unused = checkSharepage = false;
|
|
|
+ setResult(0);
|
|
|
+ finish();
|
|
|
}
|
|
|
}
|
|
|
}).show();
|
|
@@ -266,20 +269,20 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
|
|
|
public void onScaleChanged(WebView webView, float f, float f2) {
|
|
|
super.onScaleChanged(webView, f, f2);
|
|
|
- float unused = WebviewActivity.this.onScaleChangedCurrent = f2;
|
|
|
+ float unused = onScaleChangedCurrent = f2;
|
|
|
}
|
|
|
};
|
|
|
private WebChromeClient mWebCromClient = new WebChromeClient() {
|
|
|
public void onProgressChanged(WebView webView, int i) {
|
|
|
if (i == 100) {
|
|
|
- WebviewActivity.mLoadWebLayout.setVisibility(View.GONE);
|
|
|
+ mLoadWebLayout.setVisibility(View.GONE);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void onReceivedTitle(WebView webView, String str) {
|
|
|
super.onReceivedTitle(webView, str);
|
|
|
- if (!WebviewActivity.this.isBuy && !WebviewActivity.this.isFaq && !WebviewActivity.this.isInfo) {
|
|
|
- WebviewActivity.this.setTitle(str);
|
|
|
+ if (!isBuy && !isFaq && !isInfo) {
|
|
|
+ setTitle(str);
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -288,30 +291,30 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
public void handleMessage(Message message) {
|
|
|
switch (message.what) {
|
|
|
case 1:
|
|
|
- Toast.makeText(WebviewActivity.this.getBaseContext(), WebviewActivity.this.getString(R.string.str_err_msg_out_of_memory_title), 1).show();
|
|
|
+ Toast.makeText(getBaseContext(), getString(R.string.str_err_msg_out_of_memory_title), 1).show();
|
|
|
return;
|
|
|
case 2:
|
|
|
try {
|
|
|
- Utils.makeMessageBox(WebviewActivity.this, WebviewActivity.this.getString(R.string.str_err_msg_out_of_memory_title), WebviewActivity.this.getString(R.string.str_ok)).show();
|
|
|
+ Utils.makeMessageBox(this, getString(R.string.str_err_msg_out_of_memory_title), getString(R.string.str_ok)).show();
|
|
|
return;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return;
|
|
|
}
|
|
|
case 3:
|
|
|
- if (!WebviewActivity.mPreviewWebInterrupted) {
|
|
|
- float access$2000 = WebviewActivity.this.getScaleValue();
|
|
|
- if (WebviewActivity.mWebview.getProgress() < 100) {
|
|
|
- WebviewActivity.myHandler.sendEmptyMessageDelayed(3, 2000);
|
|
|
+ if (!mPreviewWebInterrupted) {
|
|
|
+ float access$2000 = getScaleValue();
|
|
|
+ if (mWebview.getProgress() < 100) {
|
|
|
+ myHandler.sendEmptyMessageDelayed(3, 2000);
|
|
|
return;
|
|
|
- } else if (WebviewActivity.mLastHeight == 0 || WebviewActivity.mLastHeight < ((((float) WebviewActivity.mWebview.getContentHeight()) * access$2000))) {
|
|
|
+ } else if (mLastHeight == 0 || mLastHeight < ((((float) mWebview.getContentHeight()) * access$2000))) {
|
|
|
WebviewActivity webviewActivity = WebviewActivity.this;
|
|
|
- int unused = webviewActivity.mLastHeight = (((float) webviewActivity.mWebview.getContentHeight()) * access$2000);
|
|
|
- WebviewActivity.myHandler.sendEmptyMessageDelayed(3, 5000);
|
|
|
- EPLog.d(WebviewActivity.TAG, "Waiting not change mLastHeight = " + WebviewActivity.mLastHeight);
|
|
|
+ int unused = mLastHeight = (((float) mWebview.getContentHeight()) * access$2000);
|
|
|
+ myHandler.sendEmptyMessageDelayed(3, 5000);
|
|
|
+ EPLog.d(TAG, "Waiting not change mLastHeight = " + mLastHeight);
|
|
|
return;
|
|
|
} else {
|
|
|
- WebviewActivity.this.startPreviewWebThread();
|
|
|
+ startPreviewWebThread();
|
|
|
return;
|
|
|
}
|
|
|
} else {
|
|
@@ -334,8 +337,8 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
}
|
|
|
|
|
|
static /* synthetic */ int access$1308(WebviewActivity webviewActivity) {
|
|
|
- int i = webviewActivity.countUrl;
|
|
|
- webviewActivity.countUrl = i + 1;
|
|
|
+ int i = countUrl;
|
|
|
+ countUrl = i + 1;
|
|
|
return i;
|
|
|
}
|
|
|
|
|
@@ -357,9 +360,9 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
teInurl.setOnKeyListener(this);
|
|
|
teInurl.setOnTouchListener(new View.OnTouchListener() {
|
|
|
public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
- WebviewActivity.this.setClearButtonAppearance(0);
|
|
|
- boolean unused = WebviewActivity.mCanRefresh = false;
|
|
|
- boolean unused2 = WebviewActivity.mCanClear = true;
|
|
|
+ setClearButtonAppearance(0);
|
|
|
+ boolean unused = mCanRefresh = false;
|
|
|
+ boolean unused2 = mCanClear = true;
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
@@ -391,8 +394,8 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
mWebview.setWebChromeClient(mWebCromClient);
|
|
|
mWebview.setOnTouchListener(new View.OnTouchListener() {
|
|
|
public boolean onTouch(View view, MotionEvent motionEvent) {
|
|
|
- WebviewActivity.this.teInurl.clearFocus();
|
|
|
- WebviewActivity.mWebview.requestFocus();
|
|
|
+ teInurl.clearFocus();
|
|
|
+ mWebview.requestFocus();
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
@@ -637,7 +640,7 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
L_0x001a:
|
|
|
throw r2
|
|
|
*/
|
|
|
- throw new UnsupportedOperationException("Method not decompiled: epson.print.WebviewActivity.saveJPG(android.graphics.Bitmap, java.lang.String):void");
|
|
|
+ throw new UnsupportedOperationException("Method not decompiled: epson.print.saveJPG(android.graphics.Bitmap, java.lang.String):void");
|
|
|
}
|
|
|
|
|
|
public void showLoadingDialog() {
|
|
@@ -674,18 +677,18 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
View inflate = getLayoutInflater().inflate(mLayoutId, (ViewGroup) null);
|
|
|
((Button) inflate.findViewById(R.id.close_btn)).setOnClickListener(new View.OnClickListener() {
|
|
|
public void onClick(View view) {
|
|
|
- if (WebviewActivity.this.checkSharepage) {
|
|
|
- WebviewActivity.mWebview.stopLoading();
|
|
|
- WebviewActivity.this.finish();
|
|
|
+ if (checkSharepage) {
|
|
|
+ mWebview.stopLoading();
|
|
|
+ finish();
|
|
|
}
|
|
|
- WebviewActivity.this.stopDoBackGroundThread();
|
|
|
+ stopDoBackGroundThread();
|
|
|
}
|
|
|
});
|
|
|
setContentView(inflate);
|
|
|
}
|
|
|
|
|
|
public void onBackPressed() {
|
|
|
- WebviewActivity.this.stopDoBackGroundThread();
|
|
|
+ stopDoBackGroundThread();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -797,7 +800,7 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
bitmap.setDensity(i);
|
|
|
mBitmap = bitmap;
|
|
|
mExRate = d;
|
|
|
- EPLog.i(WebviewActivity.TAG, "expand => " + d);
|
|
|
+ EPLog.i(TAG, "expand => " + d);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -814,27 +817,27 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
if (interuptChecker.check()) {
|
|
|
return false;
|
|
|
}
|
|
|
- String tempViewDir = ExternalFileUtils.getInstance(WebviewActivity.this).getTempViewDir();
|
|
|
+ String tempViewDir = ExternalFileUtils.getInstance(this).getTempViewDir();
|
|
|
String path = new File(tempViewDir, "multi_cut_" + i + ".jpg").getPath();
|
|
|
canvas.drawRGB(255, 255, 255);
|
|
|
synchronized (obj) {
|
|
|
- WebviewActivity.this.runOnUiThread(new Runnable() {
|
|
|
+ runOnUiThread(new Runnable() {
|
|
|
public void run() {
|
|
|
synchronized (obj) {
|
|
|
webView.draw(canvas);
|
|
|
obj.notifyAll();
|
|
|
- EPLog.m316v(WebviewActivity.TAG, "webView.draw() finish");
|
|
|
+ EPLog.v(TAG, "webView.draw() finish");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
try {
|
|
|
- EPLog.m316v(WebviewActivity.TAG, "webView.draw() wait page = " + i);
|
|
|
+ EPLog.v(TAG, "webView.draw() wait page = " + i);
|
|
|
obj.wait();
|
|
|
} catch (InterruptedException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- WebviewActivity.saveJPG(mBitmap, path);
|
|
|
+ saveJPG(mBitmap, path);
|
|
|
arrayList.add(path);
|
|
|
height -= width;
|
|
|
canvas.translate(0.0f, -((float) width));
|
|
@@ -910,32 +913,32 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
}
|
|
|
|
|
|
public void run() {
|
|
|
- if (!WebviewActivity.mPreviewWebInterrupted) {
|
|
|
- ExternalFileUtils.getInstance(WebviewActivity.this).initTempViewDir();
|
|
|
+ if (!mPreviewWebInterrupted) {
|
|
|
+ ExternalFileUtils.getInstance(this).initTempViewDir();
|
|
|
mImageFileCreator = new ImageFileCreator();
|
|
|
mImageFileCreator.setPicture(mPicture);
|
|
|
if (!mImageFileCreator.prepareBitmap()) {
|
|
|
- ExternalFileUtils.getInstance(WebviewActivity.this).initTempViewDir();
|
|
|
- WebviewActivity.this.cancelShowingDialog();
|
|
|
- WebviewActivity.myHandler.sendEmptyMessage(1);
|
|
|
- WebviewActivity.this.finish();
|
|
|
+ ExternalFileUtils.getInstance(this).initTempViewDir();
|
|
|
+ cancelShowingDialog();
|
|
|
+ myHandler.sendEmptyMessage(1);
|
|
|
+ finish();
|
|
|
} else if (isInterrupted()) {
|
|
|
freeLargeMem();
|
|
|
- ExternalFileUtils.getInstance(WebviewActivity.this).initTempViewDir();
|
|
|
- WebviewActivity.this.cancelShowingDialog();
|
|
|
+ ExternalFileUtils.getInstance(this).initTempViewDir();
|
|
|
+ cancelShowingDialog();
|
|
|
} else {
|
|
|
try {
|
|
|
- if (!mImageFileCreator.createImageFile(WebviewActivity.mWebview, WebviewActivity.mAddImageView, this) || isInterrupted()) {
|
|
|
- ExternalFileUtils.getInstance(WebviewActivity.this).initTempViewDir();
|
|
|
- WebviewActivity.this.cancelShowingDialog();
|
|
|
+ if (!mImageFileCreator.createImageFile(mWebview, mAddImageView, this) || isInterrupted()) {
|
|
|
+ ExternalFileUtils.getInstance(this).initTempViewDir();
|
|
|
+ cancelShowingDialog();
|
|
|
return;
|
|
|
}
|
|
|
- WebviewActivity.this.startPrintActivity();
|
|
|
+ startPrintActivity();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
- ExternalFileUtils.getInstance(WebviewActivity.this).initTempViewDir();
|
|
|
- WebviewActivity.this.cancelShowingDialog();
|
|
|
- WebviewActivity.myHandler.sendEmptyMessage(2);
|
|
|
+ ExternalFileUtils.getInstance(this).initTempViewDir();
|
|
|
+ cancelShowingDialog();
|
|
|
+ myHandler.sendEmptyMessage(2);
|
|
|
} finally {
|
|
|
freeLargeMem();
|
|
|
}
|
|
@@ -965,10 +968,10 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
create.setMessage(str);
|
|
|
create.setButton(-1, getString(R.string.str_ok), new DialogInterface.OnClickListener() {
|
|
|
public void onClick(DialogInterface dialogInterface, int i) {
|
|
|
- if (str.equals(WebviewActivity.this.getString(R.string.str_no_sdcard))) {
|
|
|
- WebviewActivity.this.cancelShowingDialog();
|
|
|
- if (WebviewActivity.this.checkImage || WebviewActivity.this.checkSharepage) {
|
|
|
- WebviewActivity.this.finish();
|
|
|
+ if (str.equals(getString(R.string.str_no_sdcard))) {
|
|
|
+ cancelShowingDialog();
|
|
|
+ if (checkImage || checkSharepage) {
|
|
|
+ finish();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -990,43 +993,43 @@ public class WebviewActivity extends ActivityIACommon implements CommonDefine, V
|
|
|
|
|
|
protected void onPreExecute() {
|
|
|
super.onPreExecute();
|
|
|
- WebviewActivity.this.showLoadingDialog();
|
|
|
+ showLoadingDialog();
|
|
|
}
|
|
|
|
|
|
protected Void doInBackground(Void... voidArr) {
|
|
|
- Uri parse = Uri.parse(WebviewActivity.this.inURL);
|
|
|
+ Uri parse = Uri.parse(inURL);
|
|
|
if (String.valueOf(BoxFile.TYPE).equals(parse.getScheme())) {
|
|
|
imagePath.add(parse.getPath());
|
|
|
} else {
|
|
|
String lastPathSegment = parse.getLastPathSegment();
|
|
|
- String downloadDir = ExternalFileUtils.getInstance(WebviewActivity.this).getDownloadDir();
|
|
|
- ExternalFileUtils.getInstance(WebviewActivity.this).initDownloadDir();
|
|
|
+ String downloadDir = ExternalFileUtils.getInstance(this).getDownloadDir();
|
|
|
+ ExternalFileUtils.getInstance(this).initDownloadDir();
|
|
|
if (isCancelled()) {
|
|
|
return null;
|
|
|
}
|
|
|
epson.print.Util.Utils.getInstance();
|
|
|
- epson.print.Util.Utils.mUtils.downloadFile(WebviewActivity.this.inURL, downloadDir, lastPathSegment, WebviewActivity.this);
|
|
|
+ epson.print.Util.Utils.mUtils.downloadFile(inURL, downloadDir, lastPathSegment, this);
|
|
|
imagePath.add(new File(downloadDir, lastPathSegment).getPath());
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
protected void onPostExecute(Void voidR) {
|
|
|
- EPLog.i(WebviewActivity.TAG, "previewImage::onPostExecute() Share image: " + imagePath.toString());
|
|
|
- WebviewActivity webviewActivity = WebviewActivity.this;
|
|
|
- Intent unused = webviewActivity.mIntent = new Intent(webviewActivity, ActivityViewImageSelect.class);
|
|
|
- WebviewActivity.mIntent.putExtra(ActivityViewImageSelect.LIST_ALBUM, imagePath);
|
|
|
- WebviewActivity.mIntent.putExtra(CommonDefine.STYPE, true);
|
|
|
- WebviewActivity.mIntent.putExtra("print_log", WebviewActivity.this.getPrintLog());
|
|
|
- WebviewActivity webviewActivity2 = WebviewActivity.this;
|
|
|
+ EPLog.i(TAG, "previewImage::onPostExecute() Share image: " + imagePath.toString());
|
|
|
+ WebviewActivity webviewActivity = this;
|
|
|
+ Intent unused = mIntent = new Intent(webviewActivity, ActivityViewImageSelect.class);
|
|
|
+ mIntent.putExtra(ActivityViewImageSelect.LIST_ALBUM, imagePath);
|
|
|
+ mIntent.putExtra(CommonDefine.STYPE, true);
|
|
|
+ mIntent.putExtra("print_log", getPrintLog());
|
|
|
+ WebviewActivity webviewActivity2 = this;
|
|
|
webviewActivity2.startActivity(webviewActivity2.mIntent);
|
|
|
- WebviewActivity.this.finish();
|
|
|
+ finish();
|
|
|
}
|
|
|
|
|
|
protected void onCancelled() {
|
|
|
- EPLog.i(WebviewActivity.TAG, "Cancel: OK");
|
|
|
- if (WebviewActivity.this.checkImage) {
|
|
|
- WebviewActivity.this.finish();
|
|
|
+ EPLog.i(TAG, "Cancel: OK");
|
|
|
+ if (checkImage) {
|
|
|
+ finish();
|
|
|
}
|
|
|
}
|
|
|
};
|