Commit 9422fab7 by Kazuyuki Hida

中途半端だけれど、できるところまでWarningつぶしを行った。

parent 9922d073
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<inspection_tool class="ComparatorMethodParameterNotUsed" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="ComparatorMethodParameterNotUsed" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="CompareToUsesNonFinalVariable" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="CompareToUsesNonFinalVariable" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConstantAssertCondition" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="ConstantAssertCondition" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ConstantConditions" enabled="true" level="ERROR" enabled_by_default="true"> <inspection_tool class="ConstantConditions" enabled="true" level="WARNING" enabled_by_default="true">
<option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" /> <option name="SUGGEST_NULLABLE_ANNOTATIONS" value="false" />
<option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" /> <option name="DONT_REPORT_TRUE_ASSERT_STATEMENTS" value="false" />
</inspection_tool> </inspection_tool>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<inspection_tool class="CovariantCompareTo" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="CovariantCompareTo" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="CovariantEquals" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="CovariantEquals" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="CyclomaticComplexity" enabled="true" level="TODO" enabled_by_default="true"> <inspection_tool class="CyclomaticComplexity" enabled="true" level="TODO" enabled_by_default="true">
<option name="m_limit" value="10" /> <option name="m_limit" value="40" />
</inspection_tool> </inspection_tool>
<inspection_tool class="EmptyInitializer" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="EmptyInitializer" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="EmptyStatementBody" enabled="false" level="ERROR" enabled_by_default="false"> <inspection_tool class="EmptyStatementBody" enabled="false" level="ERROR" enabled_by_default="false">
...@@ -155,6 +155,7 @@ ...@@ -155,6 +155,7 @@
<option name="ignoreEqualsMethod" value="false" /> <option name="ignoreEqualsMethod" value="false" />
<option name="m_limit" value="1" /> <option name="m_limit" value="1" />
</inspection_tool> </inspection_tool>
<inspection_tool class="MultipleVariablesInDeclaration" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="NegatedIfElse" enabled="true" level="ERROR" enabled_by_default="true"> <inspection_tool class="NegatedIfElse" enabled="true" level="ERROR" enabled_by_default="true">
<option name="m_ignoreNegatedNullComparison" value="true" /> <option name="m_ignoreNegatedNullComparison" value="true" />
<option name="m_ignoreNegatedZeroComparison" value="false" /> <option name="m_ignoreNegatedZeroComparison" value="false" />
...@@ -169,7 +170,7 @@ ...@@ -169,7 +170,7 @@
<option name="onlyWarnOnBaseMethods" value="true" /> <option name="onlyWarnOnBaseMethods" value="true" />
</inspection_tool> </inspection_tool>
<inspection_tool class="NonCommentSourceStatements" enabled="true" level="TODO" enabled_by_default="true"> <inspection_tool class="NonCommentSourceStatements" enabled="true" level="TODO" enabled_by_default="true">
<option name="m_limit" value="30" /> <option name="m_limit" value="100" />
</inspection_tool> </inspection_tool>
<inspection_tool class="NonShortCircuitBoolean" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="NonShortCircuitBoolean" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="NullArgumentToVariableArgMethod" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="NullArgumentToVariableArgMethod" enabled="true" level="ERROR" enabled_by_default="true" />
...@@ -239,6 +240,9 @@ ...@@ -239,6 +240,9 @@
<inspection_tool class="SuspiciousNameCombination" enabled="false" level="ERROR" enabled_by_default="false"> <inspection_tool class="SuspiciousNameCombination" enabled="false" level="ERROR" enabled_by_default="false">
<group names="x,width,left,right" /> <group names="x,width,left,right" />
<group names="y,height,top,bottom" /> <group names="y,height,top,bottom" />
<ignored>
<option name="METHOD_MATCHER_CONFIG" value="java.io.PrintStream,println,java.io.PrintWriter,println,java.lang.System,identityHashCode,java.sql.PreparedStatement,set.*,java.sql.ResultSet,update.*,java.sql.SQLOutput,write.*,java.lang.Integer,compare.*,java.lang.Long,compare.*,java.lang.Short,compare,java.lang.Byte,compare,java.lang.Character,compare,java.lang.Boolean,compare,java.lang.Math,.*,java.lang.StrictMath,.*" />
</ignored>
</inspection_tool> </inspection_tool>
<inspection_tool class="SuspiciousSystemArraycopy" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="SuspiciousSystemArraycopy" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="SuspiciousToArrayCall" enabled="true" level="ERROR" enabled_by_default="true" /> <inspection_tool class="SuspiciousToArrayCall" enabled="true" level="ERROR" enabled_by_default="true" />
......
package jp.agentec.abook.abv.ui.common.activity; package jp.agentec.abook.abv.ui.common.activity;
import android.accounts.Account; import android.annotation.SuppressLint;
import android.accounts.AccountManager;
import android.app.Activity; import android.app.Activity;
import android.app.ActivityManager; import android.app.ActivityManager;
import android.app.ActivityManager.RunningTaskInfo; import android.app.ActivityManager.RunningTaskInfo;
import android.app.AlarmManager;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.PendingIntent;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.ContentValues; import android.content.ContentValues;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo; import android.content.pm.ActivityInfo;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Color; import android.graphics.Color;
...@@ -70,7 +64,6 @@ import jp.agentec.abook.abv.cl.util.PreferenceUtil; ...@@ -70,7 +64,6 @@ import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication; import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.launcher.android.ABVUIDataCache; import jp.agentec.abook.abv.launcher.android.ABVUIDataCache;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.PrefName;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
...@@ -103,7 +96,6 @@ public abstract class ABVActivity extends Activity { ...@@ -103,7 +96,6 @@ public abstract class ABVActivity extends Activity {
protected AlertDialog mAlertDialog = null; protected AlertDialog mAlertDialog = null;
private static boolean IsAppPaused = false; private static boolean IsAppPaused = false;
private static boolean IsAppVisible = false;
private static boolean isVisible = false; private static boolean isVisible = false;
public static final String CID="cid"; public static final String CID="cid";
...@@ -116,15 +108,7 @@ public abstract class ABVActivity extends Activity { ...@@ -116,15 +108,7 @@ public abstract class ABVActivity extends Activity {
protected static final int WC = android.view.ViewGroup.LayoutParams.WRAP_CONTENT; protected static final int WC = android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
protected static final int R_FP = ViewGroup.LayoutParams.MATCH_PARENT; protected static final int R_FP = ViewGroup.LayoutParams.MATCH_PARENT;
private HomeButtonReceiver mHomeButtonReceiver;
protected Uri imageUri; protected Uri imageUri;
private class HomeButtonReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
onClickHomeButton();
}
}
@Override @Override
protected void onUserLeaveHint() { protected void onUserLeaveHint() {
...@@ -170,10 +154,7 @@ public abstract class ABVActivity extends Activity { ...@@ -170,10 +154,7 @@ public abstract class ABVActivity extends Activity {
* @return true:表示、false:非表示 * @return true:表示、false:非表示
*/ */
public boolean progressDialogHorizontalShowing() { public boolean progressDialogHorizontalShowing() {
if (!isFinishing() && progressDialogHorizontal != null && !progressDialogHorizontal.isShowing()) { return isFinishing() || progressDialogHorizontal == null || progressDialogHorizontal.isShowing();
return false;
}
return true;
} }
public void showProgressPopup() { public void showProgressPopup() {
...@@ -327,9 +308,6 @@ public abstract class ABVActivity extends Activity { ...@@ -327,9 +308,6 @@ public abstract class ABVActivity extends Activity {
sendBroadcast(new Intent("jp.agentec.abook.saas.signage.off")); sendBroadcast(new Intent("jp.agentec.abook.saas.signage.off"));
closeAlertDialog(); closeAlertDialog();
isVisible = false; isVisible = false;
if (mHomeButtonReceiver != null) {
unregisterReceiver(mHomeButtonReceiver);
}
} }
protected void startActivity(Intent intend, NaviConsts ABVNavi) { protected void startActivity(Intent intend, NaviConsts ABVNavi) {
...@@ -349,12 +327,13 @@ public abstract class ABVActivity extends Activity { ...@@ -349,12 +327,13 @@ public abstract class ABVActivity extends Activity {
return super.onPrepareOptionsMenu(menu); return super.onPrepareOptionsMenu(menu);
} }
@SuppressLint("PrivateApi")
protected void setMenuBackground(Menu menu) { protected void setMenuBackground(Menu menu) {
LayoutInflater service = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE); LayoutInflater service = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
final Factory orgFactory = service.getFactory(); final Factory orgFactory = service.getFactory();
if (orgFactory == null) { if (orgFactory == null) {
final Factory factory = new Factory() { final Factory factory = new Factory() {
@Override @Override
public View onCreateView(String name, Context context, AttributeSet attrs) { public View onCreateView(String name, Context context, AttributeSet attrs) {
if (name.equals("com.android.internal.view.menu.IconMenuView")) { if (name.equals("com.android.internal.view.menu.IconMenuView")) {
...@@ -372,19 +351,19 @@ public abstract class ABVActivity extends Activity { ...@@ -372,19 +351,19 @@ public abstract class ABVActivity extends Activity {
return vg; return vg;
} }
catch (ClassNotFoundException e) { catch (ClassNotFoundException e) {
Logger.w(TAG, e); Logger.w(TAG, "ClassNotFoundException", e);
} catch (SecurityException e) { } catch (SecurityException e) {
Logger.w(TAG, e); Logger.w(TAG, "SecurityException", e);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
Logger.w(TAG, e); Logger.w(TAG, "NoSuchMethodException", e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
Logger.w(TAG, e); Logger.w(TAG, "IllegalArgumentException", e);
} catch (InstantiationException e) { } catch (InstantiationException e) {
Logger.w(TAG, e); Logger.w(TAG, "InstantiationException", e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
Logger.w(TAG, e); Logger.w(TAG, "IllegalAccessException", e);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
Logger.w(TAG, e); Logger.w(TAG, "InvocationTargetException", e);
} }
} }
return null; return null;
...@@ -401,17 +380,18 @@ public abstract class ABVActivity extends Activity { ...@@ -401,17 +380,18 @@ public abstract class ABVActivity extends Activity {
Method method = c.getDeclaredMethod("getItemView", paramTypesGetItemView); Method method = c.getDeclaredMethod("getItemView", paramTypesGetItemView);
method.setAccessible(true); method.setAccessible(true);
TextView view = (TextView) method.invoke(item, 0, null); TextView view = (TextView) method.invoke(item, 0, null);
assert view != null;
view.setTextColor(Color.WHITE); view.setTextColor(Color.WHITE);
} catch (SecurityException e) { } catch (SecurityException e) {
Logger.w(TAG, e); Logger.w(TAG, "SecurityException", e);
} catch (NoSuchMethodException e) { } catch (NoSuchMethodException e) {
//Logger.w(Tag, e); //Logger.w(Tag, "NoSuchMethodException", e);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
Logger.w(TAG, e); Logger.w(TAG, "IllegalArgumentException", e);
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
Logger.w(TAG, e); Logger.w(TAG, "IllegalAccessException", e);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
Logger.w(TAG, e); Logger.w(TAG, "InvocationTargetException", e);
} }
} }
} }
...@@ -421,13 +401,10 @@ public abstract class ABVActivity extends Activity { ...@@ -421,13 +401,10 @@ public abstract class ABVActivity extends Activity {
public boolean onKeyUp(int keyCode, KeyEvent event) { public boolean onKeyUp(int keyCode, KeyEvent event) {
boolean eventPrevent = false; boolean eventPrevent = false;
switch(keyCode) { if (keyCode == KeyEvent.KEYCODE_BACK) {
case KeyEvent.KEYCODE_BACK: super.finish();
overridePendingTransition(R.anim.viewin_right_to_left, R.anim.viewout_right_to_left);
super.finish(); eventPrevent = true;
overridePendingTransition(R.anim.viewin_right_to_left, R.anim.viewout_right_to_left);
eventPrevent = true;
} }
return eventPrevent; return eventPrevent;
...@@ -447,7 +424,6 @@ public abstract class ABVActivity extends Activity { ...@@ -447,7 +424,6 @@ public abstract class ABVActivity extends Activity {
super.onStop(); super.onStop();
if (getClass().getName().equals(getABVUIDataCache().visibleActivityName)) { if (getClass().getName().equals(getABVUIDataCache().visibleActivityName)) {
// IsAppPaused = !IsAppVisible;
IsAppPaused = true; IsAppPaused = true;
} }
...@@ -464,7 +440,6 @@ public abstract class ABVActivity extends Activity { ...@@ -464,7 +440,6 @@ public abstract class ABVActivity extends Activity {
if (getClass().getName().equals(getABVUIDataCache().visibleActivityName)) { if (getClass().getName().equals(getABVUIDataCache().visibleActivityName)) {
//Logger.d("focus", getClass().getName() + " " + hasFocus); //Logger.d("focus", getClass().getName() + " " + hasFocus);
IsAppVisible = hasFocus;
if (IsAppPaused) { if (IsAppPaused) {
new Handler().post(new Runnable() { new Handler().post(new Runnable() {
...@@ -481,7 +456,7 @@ public abstract class ABVActivity extends Activity { ...@@ -481,7 +456,7 @@ public abstract class ABVActivity extends Activity {
// つまり、Activity間の遷移により、hasFocusはfalseになったりtrueになったりするが、 // つまり、Activity間の遷移により、hasFocusはfalseになったりtrueになったりするが、
// 最終的にtrueになったということは、アプリ自体は画面に表示されていることを示す。 // 最終的にtrueになったということは、アプリ自体は画面に表示されていることを示す。
// falseの状態で、onStopが呼び出されると、このアプリはバックグラウンドになったが、またが終了したことを示す。 // falseの状態で、onStopが呼び出されると、このアプリはバックグラウンドになったが、またが終了したことを示す。
if (IsAppVisible) { if (hasFocus) {
IsAppPaused = false; IsAppPaused = false;
} }
} }
...@@ -513,7 +488,6 @@ public abstract class ABVActivity extends Activity { ...@@ -513,7 +488,6 @@ public abstract class ABVActivity extends Activity {
} }
} }
} catch (Exception e) { } catch (Exception e) {
result = false;
Logger.e("Exception LoginTimeOutCheck", e); Logger.e("Exception LoginTimeOutCheck", e);
} }
return result; return result;
...@@ -596,6 +570,7 @@ public abstract class ABVActivity extends Activity { ...@@ -596,6 +570,7 @@ public abstract class ABVActivity extends Activity {
return result; return result;
} }
@SuppressWarnings("unused")
private void showChangePasswordDialog(final int title, final SecurityPolicyType securityPolicyType, final String loginId, final String password, final DialogInterface.OnClickListener cancelListener) { private void showChangePasswordDialog(final int title, final SecurityPolicyType securityPolicyType, final String loginId, final String password, final DialogInterface.OnClickListener cancelListener) {
ABookAlertDialog passwordChangeDialog = AlertDialogUtil.createAlertDialog(this, title); ABookAlertDialog passwordChangeDialog = AlertDialogUtil.createAlertDialog(this, title);
View passwordChangeView = null; View passwordChangeView = null;
...@@ -608,15 +583,13 @@ public abstract class ABVActivity extends Activity { ...@@ -608,15 +583,13 @@ public abstract class ABVActivity extends Activity {
break; break;
case Enforcement: case Enforcement:
passwordChangeView = getLayoutInflater().inflate(R.layout.ac_setting_password_change_enforcement, null); passwordChangeView = getLayoutInflater().inflate(R.layout.ac_setting_password_change_enforcement, null);
EditText edtLoginId = (EditText)passwordChangeView.findViewById(R.id.edt_id); EditText edtLoginId = passwordChangeView.findViewById(R.id.edt_id);
edtLoginId.setText(loginId); edtLoginId.setText(loginId);
passwordChangeDialog.setCancelable(false); passwordChangeDialog.setCancelable(false);
passwordChangeDialog.setView(passwordChangeView); passwordChangeDialog.setView(passwordChangeView);
break; break;
case None: case None:
break; break;
default:
break;
} }
final EditText edtPwdNow = (EditText) (passwordChangeView != null ? passwordChangeView.findViewById(R.id.edt_pwd_now) : null); final EditText edtPwdNow = (EditText) (passwordChangeView != null ? passwordChangeView.findViewById(R.id.edt_pwd_now) : null);
...@@ -670,6 +643,8 @@ public abstract class ABVActivity extends Activity { ...@@ -670,6 +643,8 @@ public abstract class ABVActivity extends Activity {
showChangePasswordDialog(R.string.pwd_change, securityPolicyType, loginId, password, cancelListener); showChangePasswordDialog(R.string.pwd_change, securityPolicyType, loginId, password, cancelListener);
} }
} }
}); });
showAlertDialog(passwordChangeDialog); showAlertDialog(passwordChangeDialog);
...@@ -782,10 +757,12 @@ public abstract class ABVActivity extends Activity { ...@@ -782,10 +757,12 @@ public abstract class ABVActivity extends Activity {
return getResources().getBoolean(id); return getResources().getBoolean(id);
} }
@SuppressWarnings("deprecation")
protected Drawable getRDrawable(int id) { protected Drawable getRDrawable(int id) {
return getResources().getDrawable(id); return getResources().getDrawable(id);
} }
@SuppressWarnings("deprecation")
protected int getRColor(int id) { protected int getRColor(int id) {
return getResources().getColor(id); return getResources().getColor(id);
} }
...@@ -812,6 +789,7 @@ public abstract class ABVActivity extends Activity { ...@@ -812,6 +789,7 @@ public abstract class ABVActivity extends Activity {
} }
public void showSimpleAlertDialog(final String title, final String body) { public void showSimpleAlertDialog(final String title, final String body) {
final int DELAY = 500;
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
@Override @Override
public void run() { public void run() {
...@@ -819,7 +797,7 @@ public abstract class ABVActivity extends Activity { ...@@ -819,7 +797,7 @@ public abstract class ABVActivity extends Activity {
alertDialog.setPositiveButton(R.string.ok, null); alertDialog.setPositiveButton(R.string.ok, null);
showAlertDialog(alertDialog); showAlertDialog(alertDialog);
} }
}, 500); }, DELAY);
} }
public static boolean isVisible() { public static boolean isVisible() {
...@@ -882,6 +860,7 @@ public abstract class ABVActivity extends Activity { ...@@ -882,6 +860,7 @@ public abstract class ABVActivity extends Activity {
} }
} }
@SuppressWarnings("unused")
protected void showToastOnDebug(String... msgs) { protected void showToastOnDebug(String... msgs) {
if (msgs == null || msgs.length == 0) { if (msgs == null || msgs.length == 0) {
return; return;
...@@ -892,9 +871,9 @@ public abstract class ABVActivity extends Activity { ...@@ -892,9 +871,9 @@ public abstract class ABVActivity extends Activity {
msg = msgs[0]; msg = msgs[0];
} }
else { else {
String[] param = new String[msgs.length - 1]; Object[] param = new String[msgs.length - 1];
System.arraycopy(msgs, 1, param, 0, param.length); System.arraycopy(msgs, 1, param, 0, param.length);
msg = String.format(msgs[0], (Object[])param); msg = String.format(msgs[0], param);
} }
handleErrorMessageToast(msg); handleErrorMessageToast(msg);
} }
...@@ -927,6 +906,7 @@ public abstract class ABVActivity extends Activity { ...@@ -927,6 +906,7 @@ public abstract class ABVActivity extends Activity {
return true; return true;
} }
@SuppressLint("IntentReset")
private void showCameraOrAlbumSelectView(int requestCode , String title, String type, boolean cameraFlg) { private void showCameraOrAlbumSelectView(int requestCode , String title, String type, boolean cameraFlg) {
if (type.toLowerCase().equals(ABookKeys.IMAGE)) { if (type.toLowerCase().equals(ABookKeys.IMAGE)) {
Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI); Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
...@@ -952,7 +932,8 @@ public abstract class ABVActivity extends Activity { ...@@ -952,7 +932,8 @@ public abstract class ABVActivity extends Activity {
startActivityForResult(chooser, requestCode); startActivityForResult(chooser, requestCode);
} else if(type.toLowerCase().equals(ABookKeys.VIDEO)) { } else if(type.toLowerCase().equals(ABookKeys.VIDEO)) {
Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI); @SuppressLint("IntentReset")
Intent galleryIntent = new Intent(Intent.ACTION_PICK, MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
galleryIntent.setType("video/*"); galleryIntent.setType("video/*");
Intent chooser = new Intent(Intent.ACTION_CHOOSER); Intent chooser = new Intent(Intent.ACTION_CHOOSER);
chooser.putExtra(Intent.EXTRA_INTENT, galleryIntent); chooser.putExtra(Intent.EXTRA_INTENT, galleryIntent);
......
...@@ -4,57 +4,26 @@ import android.content.ActivityNotFoundException; ...@@ -4,57 +4,26 @@ import android.content.ActivityNotFoundException;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color; import android.graphics.Color;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.text.InputType; import android.text.InputType;
import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.CheckedTextView;
import android.widget.EditText; import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
//import com.google.firebase.iid.FirebaseInstanceId;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.messaging.FirebaseMessaging;
import com.google.zxing.WriterException;
import org.xwalk.core.XWalkView;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON; import jp.agentec.abook.abv.bl.acms.client.json.DownloadedContentInfoJSON;
import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON; import jp.agentec.abook.abv.bl.acms.client.json.content.ContentJSON;
import jp.agentec.abook.abv.bl.acms.type.DeliveryType;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.acms.type.LoginMode;
import jp.agentec.abook.abv.bl.acms.type.UpdateSelect;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.Callback; import jp.agentec.abook.abv.bl.common.Callback;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
...@@ -71,39 +40,28 @@ import jp.agentec.abook.abv.bl.common.util.ContentFileUtil; ...@@ -71,39 +40,28 @@ import jp.agentec.abook.abv.bl.common.util.ContentFileUtil;
import jp.agentec.abook.abv.bl.data.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao; import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.ContentDao; import jp.agentec.abook.abv.bl.data.dao.ContentDao;
import jp.agentec.abook.abv.bl.data.dao.MemberInfoDao;
import jp.agentec.abook.abv.bl.download.ContentDownloadListener; import jp.agentec.abook.abv.bl.download.ContentDownloadListener;
import jp.agentec.abook.abv.bl.download.ContentDownloader; import jp.agentec.abook.abv.bl.download.ContentDownloader;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.download.ContentRefresher; import jp.agentec.abook.abv.bl.download.ContentRefresher;
import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification; import jp.agentec.abook.abv.bl.download.ContentZipDownloadNotification;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic; import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.BookmarkLogic; import jp.agentec.abook.abv.bl.logic.BookmarkLogic;
import jp.agentec.abook.abv.bl.logic.CategoryLogic;
import jp.agentec.abook.abv.bl.logic.ContentLogic;
import jp.agentec.abook.abv.bl.logic.ContractLogic; import jp.agentec.abook.abv.bl.logic.ContractLogic;
import jp.agentec.abook.abv.bl.logic.GroupLogic;
import jp.agentec.abook.abv.bl.logic.MemoLogic; import jp.agentec.abook.abv.bl.logic.MemoLogic;
import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic; import jp.agentec.abook.abv.bl.logic.UserAuthenticateLogic;
import jp.agentec.abook.abv.cl.billing.Purchase;
import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler; import jp.agentec.abook.abv.cl.helper.ABVUncaughtExceptionHandler;
import jp.agentec.abook.abv.cl.push.FcmManager; import jp.agentec.abook.abv.cl.push.FcmManager;
import jp.agentec.abook.abv.cl.util.AndroidStringUtil;
import jp.agentec.abook.abv.cl.util.BitmapUtil;
import jp.agentec.abook.abv.cl.util.PreferenceUtil; import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.cl.util.RawResourceUtil;
import jp.agentec.abook.abv.cl.util.StorageUtil; import jp.agentec.abook.abv.cl.util.StorageUtil;
import jp.agentec.abook.abv.launcher.android.ABVApplication; import jp.agentec.abook.abv.launcher.android.ABVApplication;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.DefPrefKey;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType.UserPrefKey;
import jp.agentec.abook.abv.ui.common.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
import jp.agentec.abook.abv.ui.common.constant.ErrorMessage; import jp.agentec.abook.abv.ui.common.constant.ErrorMessage;
import jp.agentec.abook.abv.ui.common.constant.NaviConsts; import jp.agentec.abook.abv.ui.common.constant.NaviConsts;
import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.common.util.DisplayUtil; import jp.agentec.abook.abv.ui.common.util.DisplayUtil;
import jp.agentec.abook.abv.ui.common.util.Initializer; import jp.agentec.abook.abv.ui.common.util.Initializer;
...@@ -111,10 +69,8 @@ import jp.agentec.abook.abv.ui.common.view.ABVBatchSyncView; ...@@ -111,10 +69,8 @@ import jp.agentec.abook.abv.ui.common.view.ABVBatchSyncView;
import jp.agentec.abook.abv.ui.common.vo.Size; import jp.agentec.abook.abv.ui.common.vo.Size;
import jp.agentec.abook.abv.ui.home.activity.HelpActivity; import jp.agentec.abook.abv.ui.home.activity.HelpActivity;
import jp.agentec.abook.abv.ui.home.activity.LoginActivity; import jp.agentec.abook.abv.ui.home.activity.LoginActivity;
import jp.agentec.abook.abv.ui.home.activity.SplashScreenActivity;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper; import jp.agentec.abook.abv.ui.home.helper.ContentViewHelper;
import jp.agentec.abook.abv.ui.viewer.foxitPdf.PdfImageProvider;
import jp.agentec.adf.net.http.HttpDownloadSimpleNotification; import jp.agentec.adf.net.http.HttpDownloadSimpleNotification;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
...@@ -122,6 +78,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -122,6 +78,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
private final static String TAG = "ABVAuthenticatedActivity"; private final static String TAG = "ABVAuthenticatedActivity";
public static final String FILEPATH = "FILEPATH"; public static final String FILEPATH = "FILEPATH";
public static final int WAIT_FOR_START_CONTENT_ACTIVITY = 500;
protected ContentDao contentDao = AbstractDao.getDao(ContentDao.class); protected ContentDao contentDao = AbstractDao.getDao(ContentDao.class);
...@@ -130,8 +87,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -130,8 +87,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
protected ContentDownloader contentDownloader = ContentDownloader.getInstance(); protected ContentDownloader contentDownloader = ContentDownloader.getInstance();
protected ContentRefresher contentRefresher = ContentRefresher.getInstance(); protected ContentRefresher contentRefresher = ContentRefresher.getInstance();
private ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用 @SuppressWarnings("unused")
private final ExecutorService initilizeExecutor = Executors.newFixedThreadPool(2); // DL後の初期化専用
@SuppressWarnings("unused")
protected ImageButton btnDownload; protected ImageButton btnDownload;
protected ActivityHandlingHelper activityHandlingHelper; protected ActivityHandlingHelper activityHandlingHelper;
protected Size mDisplaySize; protected Size mDisplaySize;
...@@ -140,12 +99,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -140,12 +99,14 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
/** /**
* メッセージ表示タイプ * メッセージ表示タイプ
*/ */
@SuppressWarnings("unused")
public interface MessageType { public interface MessageType {
int TYPE_SHOW_NONE = 0; int TYPE_SHOW_NONE = 0;
int TYPE_SHOW_TOAST = 1; int TYPE_SHOW_TOAST = 1;
int TYPE_SHOW_ALERT = 2; int TYPE_SHOW_ALERT = 2;
} }
@SuppressWarnings("unused")
public interface ContentCheckResultType { public interface ContentCheckResultType {
int NETWORK_ERROR = -2; int NETWORK_ERROR = -2;
int ERROR = -1; int ERROR = -1;
...@@ -187,10 +148,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -187,10 +148,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
try { try {
// 既にMacAddress使用に同意している場合はMacAddressを使う // 既にMacAddress使用に同意している場合はMacAddressを使う
// 認証なしの場合はUUIDを使用する // 認証なしの場合はUUIDを使用する
if (ABVEnvironment.getInstance().deviceIdType != Constant.DeviceIdType.MAC_ADDRESS) { if (ABVEnvironment.getInstance().deviceIdType == Constant.DeviceIdType.MAC_ADDRESS) {
AbstractLogic.getLogic(UserAuthenticateLogic.class).updateDeviceTokenByUUID(fcmToken);
} else {
AbstractLogic.getLogic(UserAuthenticateLogic.class).updateDeviceTokenByMacAdress(fcmToken); AbstractLogic.getLogic(UserAuthenticateLogic.class).updateDeviceTokenByMacAdress(fcmToken);
} else {
AbstractLogic.getLogic(UserAuthenticateLogic.class).updateDeviceTokenByUUID(fcmToken);
} }
isSendSuccess = true; isSendSuccess = true;
} catch (NetworkDisconnectedException e) { } catch (NetworkDisconnectedException e) {
...@@ -300,7 +261,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -300,7 +261,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
// コンテンツアラートのサービスオプションがYの時はアラートを表示 // コンテンツアラートのサービスオプションがYの時はアラートを表示
if (AbstractLogic.getLogic(ContractLogic.class).getContentAlert()) { if (AbstractLogic.getLogic(ContractLogic.class).getContentAlert()) {
contentViewActivityMoveWithContentAlert(intent, contentId, NaviConsts.Right); contentViewActivityMoveWithContentAlert(intent, contentId);
} else { } else {
contentViewActivityMoveWithAccessLocationAlert(intent, contentId, NaviConsts.Right); contentViewActivityMoveWithAccessLocationAlert(intent, contentId, NaviConsts.Right);
} }
...@@ -310,42 +271,36 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -310,42 +271,36 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
* 360コンテンツ使用可能かのチェック * 360コンテンツ使用可能かのチェック
* バーチャルツアー:OS4.4以上 * バーチャルツアー:OS4.4以上
* 360動画:OS5.0以上 * 360動画:OS5.0以上
* @param contentId * @param contentId コンテントID
* @return * @return check360Contentかどうか
*/ */
private boolean checkPanoContent(long contentId) { private boolean checkPanoContent(long contentId) {
int ret = ContentViewHelper.getInstance().check360Content(contentId); int ret = ContentViewHelper.getInstance().check360Content(contentId);
return ret == 0 ? false : true; return ret != 0;
} }
private void contentViewActivityMoveWithContentAlert(final Intent intent, final long contentId, final NaviConsts ABVNavi) { private void contentViewActivityMoveWithContentAlert(final Intent intent, final long contentId) {
ContentDto contentDto = contentDao.getContent(contentId); ContentDto contentDto = contentDao.getContent(contentId);
// コンテンツ表示制限チェック // コンテンツ表示制限チェック
switch (contentDto.alertMessageLevel) { switch (contentDto.alertMessageLevel) {
case AlertMessageLevel.NONE : case AlertMessageLevel.NONE :
contentViewActivityMoveWithAccessLocationAlert(intent, contentId, ABVNavi); contentViewActivityMoveWithAccessLocationAlert(intent, contentId, NaviConsts.Right);
break; break;
case AlertMessageLevel.MESSAGE : case AlertMessageLevel.MESSAGE :
showContentMessageDialog(intent, contentId, contentDto.alertMessage, ABVNavi); showContentMessageDialog(intent, contentId, contentDto.alertMessage, NaviConsts.Right);
break; break;
case AlertMessageLevel.PASSWORD : case AlertMessageLevel.PASSWORD :
showPasswordCheckDialog(intent, contentId, null, ABVNavi); showPasswordCheckDialog(intent, contentId, null, NaviConsts.Right);
break; break;
} }
} }
@SuppressWarnings("unused")
private void contentViewActivityMoveWithAccessLocationAlert(final Intent intent, final long contentId, final NaviConsts ABVNavi) { private void contentViewActivityMoveWithAccessLocationAlert(final Intent intent, final long contentId, final NaviConsts ABVNavi) {
contentViewActivityMove(intent, contentId, ABVNavi); contentViewActivityMove(intent, contentId, ABVNavi);
//位置情報のアプリ内の許可しないように修正
// if (!getABVUIDataCache().isShowedPermissionAccessLocationAlert() && ( AbstractLogic.getLogic(ContractLogic.class).getUsableReadinglogGps())) {
// // 位置情報取得許可アラートを一度も表示していない場合表示する
// putUserPref(UserPrefKey.SHOWED_PERMISSION_ACCESS_LOCATION_ALERT, true);
// showPermissionAccessLocationAlert(intent, contentId, ABVNavi);
// } else {
// contentViewActivityMove(intent, contentId, ABVNavi);
// }
} }
@SuppressWarnings("unused")
private void showPermissionAccessLocationAlert(final Intent intent, final long contentId, final NaviConsts ABVNavi) { private void showPermissionAccessLocationAlert(final Intent intent, final long contentId, final NaviConsts ABVNavi) {
ABookAlertDialog dialog = AlertDialogUtil.createAlertDialog(this, R.string.app_name); ABookAlertDialog dialog = AlertDialogUtil.createAlertDialog(this, R.string.app_name);
dialog.setMessage(String.format(getString(R.string.access_location_message), getString(R.string.app_name))); dialog.setMessage(String.format(getString(R.string.access_location_message), getString(R.string.app_name)));
...@@ -377,7 +332,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -377,7 +332,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
@Override @Override
public void run() { public void run() {
try { try {
Thread.sleep(500); Thread.sleep(WAIT_FOR_START_CONTENT_ACTIVITY);
activityHandlingHelper.startContentActivity(context, intent, ABVNavi, null, contentId); activityHandlingHelper.startContentActivity(context, intent, ABVNavi, null, contentId);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
Logger.e(TAG, "startContentActivity " + contentId, e); Logger.e(TAG, "startContentActivity " + contentId, e);
...@@ -521,8 +476,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -521,8 +476,8 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
/** /**
* メッセージを表示しないコンテンツチェック * メッセージを表示しないコンテンツチェック
* 呼び出し元でチェック結果の処理を行う * 呼び出し元でチェック結果の処理を行う
* @param contentId * @param contentId コンテントID
* @return * @return チェック結果 int {@link ContentCheckResultType}
*/ */
//CustomUrlでダウンロードまたは権限のないコンテンツをダウンロードする前にコンテンツの有効性をチェックするため、(ActivityHandlingHelperで使う)protectedからpublicに変更 //CustomUrlでダウンロードまたは権限のないコンテンツをダウンロードする前にコンテンツの有効性をチェックするため、(ActivityHandlingHelperで使う)protectedからpublicに変更
public int contentValidCheck(long contentId) { public int contentValidCheck(long contentId) {
...@@ -531,7 +486,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -531,7 +486,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
/** /**
* コンテンツの有効性のチェックを行う * コンテンツの有効性のチェックを行う
* @param contentId * @param contentId コンテントID
* @param showMessageType {@link MessageType} * @param showMessageType {@link MessageType}
* @return チェック結果 int {@link ContentCheckResultType} * @return チェック結果 int {@link ContentCheckResultType}
*/ */
...@@ -611,16 +566,16 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -611,16 +566,16 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
return contentDownload(contentId, true); return contentDownload(contentId, true);
} }
protected boolean contentDownload(final long contentId, boolean needCheckWifiFlag) { protected boolean contentDownload(final long contentId, @SuppressWarnings("unused") boolean needCheckWifiFlag) {
return contentDownload(contentId, true, true); return contentDownload(contentId, true, true);
} }
/** /**
* ダウンロード処理 * ダウンロード処理
* @param contentId * @param contentId コンテントID
* @param needCheckWifiFlag * @param needCheckWifiFlag Wi-Fiのチェックを行うかどうか
* @param isShowToast * @param isShowToast エラー時にToastを出すかどうか
* @return * @return 失敗したらfalse
*/ */
protected boolean contentDownload(final long contentId, boolean needCheckWifiFlag, final boolean isShowToast) { protected boolean contentDownload(final long contentId, boolean needCheckWifiFlag, final boolean isShowToast) {
boolean result = true; boolean result = true;
...@@ -684,10 +639,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -684,10 +639,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
alertDialog.setTitle(titleId); alertDialog.setTitle(titleId);
View checkBoxAlert = getLayoutInflater().inflate(R.layout.item_check_box_alert, null); View checkBoxAlert = getLayoutInflater().inflate(R.layout.item_check_box_alert, null);
alertDialog.setView(checkBoxAlert); alertDialog.setView(checkBoxAlert);
TextView message = (TextView) checkBoxAlert.findViewById(R.id.message); TextView message = checkBoxAlert.findViewById(R.id.message);
message.setText(getString(messageId)); message.setText(getString(messageId));
final CheckBox checkBox = (CheckBox) checkBoxAlert.findViewById(R.id.check_box); final CheckBox checkBox = checkBoxAlert.findViewById(R.id.check_box);
alertDialog.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { alertDialog.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
...@@ -703,7 +658,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -703,7 +658,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
}); });
TextView checkBoxMessage = (TextView) checkBoxAlert.findViewById(R.id.check_box_message); TextView checkBoxMessage = checkBoxAlert.findViewById(R.id.check_box_message);
checkBoxMessage.setText(getString(R.string.not_show_nexttime)); checkBoxMessage.setText(getString(R.string.not_show_nexttime));
checkBoxMessage.setOnClickListener(new View.OnClickListener() { checkBoxMessage.setOnClickListener(new View.OnClickListener() {
@Override @Override
...@@ -719,8 +674,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -719,8 +674,10 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
} }
@SuppressWarnings("unused")
public abstract boolean contentValidCheckAndDownload(long contentId); public abstract boolean contentValidCheckAndDownload(long contentId);
@SuppressWarnings("unused")
public void startContentViewActivity(long contentId) { public void startContentViewActivity(long contentId) {
startContentViewActivity(contentId, 0); startContentViewActivity(contentId, 0);
} }
...@@ -771,7 +728,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co ...@@ -771,7 +728,7 @@ public abstract class ABVAuthenticatedActivity extends ABVActivity implements Co
} }
/** /**
* 一括同期処理中であるか確認 * 一括同期処理中であるか確認
* @return * @return BatchSyncが見えているかどうか
*/ */
public boolean isShowingBatchSync() { public boolean isShowingBatchSync() {
return batchSyncView != null && batchSyncView.isShowing(); return batchSyncView != null && batchSyncView.isShowing();
......
package jp.agentec.abook.abv.ui.common.activity; package jp.agentec.abook.abv.ui.common.activity;
import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
...@@ -9,12 +10,10 @@ import android.content.DialogInterface; ...@@ -9,12 +10,10 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.res.AssetFileDescriptor; import android.content.res.AssetFileDescriptor;
import android.location.LocationManager;
import android.media.AudioManager; import android.media.AudioManager;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.nfc.NdefMessage; import android.nfc.NdefMessage;
import android.nfc.NfcAdapter; import android.nfc.NfcAdapter;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Parcelable; import android.os.Parcelable;
import android.provider.Settings; import android.provider.Settings;
...@@ -32,8 +31,6 @@ import java.text.SimpleDateFormat; ...@@ -32,8 +31,6 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant.ABookPermissionType; import jp.agentec.abook.abv.bl.common.Constant.ABookPermissionType;
...@@ -52,7 +49,6 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog; ...@@ -52,7 +49,6 @@ import jp.agentec.abook.abv.ui.common.dialog.ABookAlertDialog;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
import jp.agentec.abook.abv.ui.home.activity.BarCodeReaderActivity; import jp.agentec.abook.abv.ui.home.activity.BarCodeReaderActivity;
import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper; import jp.agentec.abook.abv.ui.home.helper.ABookPermissionHelper;
import jp.agentec.adf.util.NumericUtil;
import jp.agentec.adf.util.StringUtil; import jp.agentec.adf.util.StringUtil;
public class ABVCheckContentViewActivity extends ABVContentViewActivity { public class ABVCheckContentViewActivity extends ABVContentViewActivity {
...@@ -119,7 +115,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -119,7 +115,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
private NfcAdapter mNfcAdapter; private NfcAdapter mNfcAdapter;
// SPP通信端末のデータベース管理クラス // SPP通信端末のデータベース管理クラス
private SppDeviceDao mSppDeviceDao = AbstractDao.getDao(SppDeviceDao.class); private final SppDeviceDao mSppDeviceDao = AbstractDao.getDao(SppDeviceDao.class);
// SPP通信機器のデバイスID(t_spp_device) // SPP通信機器のデバイスID(t_spp_device)
private Integer mSppDeviceId; private Integer mSppDeviceId;
...@@ -132,14 +128,12 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -132,14 +128,12 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
protected void onReceiveScanResult(BeaconData data) { protected void onReceiveScanResult(BeaconData data) {
//選択されたデバイスIDから端末検索 //選択されたデバイスIDから端末検索
if (data.getExtraId() == mScaningDeviceId) { if (data.getExtraId() == mScaningDeviceId) {
String value = "-1"; String value;
switch (mScaningServiceId) { switch (mScaningServiceId) {
case OKUDAKE_SERVICE_ID_TEMPERATURE:
value = String.valueOf(data.getTemperature());
break;
case OKUDAKE_SERVICE_ID_HUMIDITY: case OKUDAKE_SERVICE_ID_HUMIDITY:
value = String.valueOf(data.getHumidity()); value = String.valueOf(data.getHumidity());
break; break;
case OKUDAKE_SERVICE_ID_TEMPERATURE:
default: default:
value = String.valueOf(data.getTemperature()); value = String.valueOf(data.getTemperature());
break; break;
...@@ -156,29 +150,29 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -156,29 +150,29 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(LOG_SEPARATOR); sb.append(LOG_SEPARATOR);
sb.append("\nビーコンスキャン結果"); sb.append("\nビーコンスキャン結果");
sb.append("\n通知時刻: " + SDF.format(new Date())); sb.append("\n通知時刻: ").append(SDF.format(new Date()));
sb.append("\n検出時刻: " + SDF.format(new Date(data.getTimestamp()))); sb.append("\n検出時刻: ").append(SDF.format(new Date(data.getTimestamp())));
sb.append("\nベンダ識別子: " + data.getVendorId()); sb.append("\nベンダ識別子: ").append(data.getVendorId());
sb.append("\n個別番号: " + data.getExtraId()); sb.append("\n個別番号: ").append(data.getExtraId());
sb.append("\nRSSI値: " + data.getRssi()); sb.append("\nRSSI値: ").append(data.getRssi());
sb.append("\nバージョン: " + data.getVersion()); sb.append("\nバージョン: ").append(data.getVersion());
sb.append("\n距離種別: " + data.getDistance()); sb.append("\n距離種別: ").append(data.getDistance());
sb.append("\nTxパワー: " + data.getTxPower()); sb.append("\nTxパワー: ").append(data.getTxPower());
sb.append("\n温度(℃): " + data.getTemperature()); sb.append("\n温度(℃): ").append(data.getTemperature());
sb.append("\n湿度(%): " + data.getHumidity()); sb.append("\n湿度(%): ").append(data.getHumidity());
sb.append("\n気圧(hPa): " + data.getAtmosphericPressure()); sb.append("\n気圧(hPa): ").append(data.getAtmosphericPressure());
sb.append("\n電池残量低下(要充電)フラグ: " + data.getLowBattery()); sb.append("\n電池残量低下(要充電)フラグ: ").append(data.getLowBattery());
sb.append("\n電池残量(%): " + data.getBatteryPower()); sb.append("\n電池残量(%): ").append(data.getBatteryPower());
sb.append("\nボタン識別子: " + data.getButtonId()); sb.append("\nボタン識別子: ").append(data.getButtonId());
sb.append("\n開閉フラグ: " + data.getOpenCloseSensor()); sb.append("\n開閉フラグ: ").append(data.getOpenCloseSensor());
sb.append("\n人感反応有無フラグ: " + data.getHumanSensor()); sb.append("\n人感反応有無フラグ: ").append(data.getHumanSensor());
sb.append("\nRawデータ(ビーコンサービスID 8): " + data.getRawData8()); sb.append("\nRawデータ(ビーコンサービスID 8): ").append(data.getRawData8());
sb.append("\nRawデータ(ビーコンサービスID 9): " + data.getRawData9()); sb.append("\nRawデータ(ビーコンサービスID 9): ").append(data.getRawData9());
sb.append("\nRawデータ(ビーコンサービスID 10): " + data.getRawData10()); sb.append("\nRawデータ(ビーコンサービスID 10): ").append(data.getRawData10());
sb.append("\nRawデータ(ビーコンサービスID 11): " + data.getRawData11()); sb.append("\nRawデータ(ビーコンサービスID 11): ").append(data.getRawData11());
sb.append("\nRawデータ(ビーコンサービスID 12): " + data.getRawData12()); sb.append("\nRawデータ(ビーコンサービスID 12): ").append(data.getRawData12());
sb.append("\nRawデータ(ビーコンサービスID 13): " + data.getRawData13()); sb.append("\nRawデータ(ビーコンサービスID 13): ").append(data.getRawData13());
sb.append("\nRawデータ " + data.getRawData()); sb.append("\nRawデータ ").append(data.getRawData());
sb.append('\n'); sb.append('\n');
Logger.d(sb.toString()); Logger.d(sb.toString());
} }
...@@ -187,7 +181,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -187,7 +181,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
/** 置くだけセンサーデバイス関連 開始 **/ /* 置くだけセンサーデバイス関連 開始 */
//ビーコンスキャナー //ビーコンスキャナー
mScanner = new BeaconScanner(this); mScanner = new BeaconScanner(this);
...@@ -201,9 +195,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -201,9 +195,9 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
//Beacon受信開始 //Beacon受信開始
registerReceiver(mReceiver, filter); registerReceiver(mReceiver, filter);
/** 置くだけセンサーデバイス関連 終了 **/ /* 置くだけセンサーデバイス関連 終了 */
/** 中心温度計デバイス関連 開始 **/ /* 中心温度計デバイス関連 開始 */
bleManagerUtil = new BleManagerUtil(this, new BleManagerUtil.BleManagerUtilListener() { bleManagerUtil = new BleManagerUtil(this, new BleManagerUtil.BleManagerUtilListener() {
@Override @Override
public void onConnectionError(int status) { //bluetooth接続エラー public void onConnectionError(int status) { //bluetooth接続エラー
...@@ -290,7 +284,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -290,7 +284,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
}); });
bleManagerUtil.startDeviceInfo(); bleManagerUtil.startDeviceInfo();
/** 中心温度計デバイス関連 終了 **/ /* 中心温度計デバイス関連 終了 */
// アダプタのインスタンスを取得 // アダプタのインスタンスを取得
...@@ -333,7 +327,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -333,7 +327,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
* onPause処理でnfc検知を受け取らない処理が入っているため、 * onPause処理でnfc検知を受け取らない処理が入っているため、
* nfc検知処理を受け取らない処理を入れなくてもいい * nfc検知処理を受け取らない処理を入れなくてもいい
* *
* @param intent * @param intent 院展と
*/ */
@Override @Override
protected void onNewIntent(Intent intent) { protected void onNewIntent(Intent intent) {
...@@ -368,7 +362,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -368,7 +362,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
/** /**
* インテントからデータを読み込み、データを取得 * インテントからデータを読み込み、データを取得
* @param intent * @param intent インテント
* @return 変換したデータ * @return 変換したデータ
*/ */
private String readFromIntent(Intent intent) { private String readFromIntent(Intent intent) {
...@@ -377,7 +371,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -377,7 +371,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
|| NfcAdapter.ACTION_TECH_DISCOVERED.equals(action) || NfcAdapter.ACTION_TECH_DISCOVERED.equals(action)
|| NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) { || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action)) {
Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES); Parcelable[] rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
NdefMessage[] msgs = null; NdefMessage[] msgs;
if (rawMsgs != null) { if (rawMsgs != null) {
msgs = new NdefMessage[rawMsgs.length]; msgs = new NdefMessage[rawMsgs.length];
for (int i = 0; i < rawMsgs.length; i++) { for (int i = 0; i < rawMsgs.length; i++) {
...@@ -394,8 +388,11 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -394,8 +388,11 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
* @param msgs * @param msgs
* @return 変換したデータ * @return 変換したデータ
*/ */
@SuppressWarnings("magic_number")
private String parseNdfMessageString(NdefMessage[] msgs) { private String parseNdfMessageString(NdefMessage[] msgs) {
if (msgs == null || msgs.length == 0) return null; if (msgs == null || msgs.length == 0) {
return null;
}
String text = ""; String text = "";
byte[] payload = msgs[0].getRecords()[0].getPayload(); byte[] payload = msgs[0].getRecords()[0].getPayload();
...@@ -465,7 +462,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -465,7 +462,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
protected void getDeviceInfo(Map<String, String> abookCheckParam) { protected void getDeviceInfo(Map<String, String> abookCheckParam) {
if (abookCheckParam.containsKey(ABookKeys.TASK_DEVICE_TYPE)) { if (abookCheckParam.containsKey(ABookKeys.TASK_DEVICE_TYPE)) {
mDeviceType = Integer.valueOf(abookCheckParam.get(ABookKeys.TASK_DEVICE_TYPE)); // ディバイスのタイプ取得 mDeviceType = Integer.parseInt(abookCheckParam.get(ABookKeys.TASK_DEVICE_TYPE)); // ディバイスのタイプ取得
mQid = abookCheckParam.get(ABookKeys.TASK_QUESTION_ID); // 設問ID取得 mQid = abookCheckParam.get(ABookKeys.TASK_QUESTION_ID); // 設問ID取得
// 1:中心温度計 2:置くだけセンサー 3:バーコード 4:放射温度計 5: SPP通信機器 6: NFC通信 // 1:中心温度計 2:置くだけセンサー 3:バーコード 4:放射温度計 5: SPP通信機器 6: NFC通信
...@@ -481,8 +478,8 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -481,8 +478,8 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
return; return;
} }
try { try {
mScaningDeviceId = Integer.valueOf(param1); // デバイスID取得 mScaningDeviceId = Integer.parseInt(param1); // デバイスID取得
mScaningServiceId = Integer.valueOf(param2); // ServiceId ID取得 mScaningServiceId = Integer.parseInt(param2); // ServiceId ID取得
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
Logger.e("param is not Int", e); Logger.e("param is not Int", e);
errorAfterAbookCheckAip(getString(R.string.msg_fraud_parameter)); errorAfterAbookCheckAip(getString(R.string.msg_fraud_parameter));
...@@ -513,7 +510,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -513,7 +510,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
/** /**
* HTML側にNFC機器からのデータを転送する * HTML側にNFC機器からのデータを転送する
* @param strTemp * @param strTemp 機器から来た数値
*/ */
public void setNfcData(final String strTemp) { public void setNfcData(final String strTemp) {
Logger.i("setNfcData"); Logger.i("setNfcData");
...@@ -762,7 +759,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -762,7 +759,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
private void setNfcDeviceInfo() { private void setNfcDeviceInfo() {
if (mNfcAdapter == null) { if (mNfcAdapter == null) {
// デバイスがNFCをサポートしてないと見做す。 // デバイスがNFCをサポートしてないと見做す。
errorAfterAbookCheckAip(String.format(getString(R.string.msg_no_support_nfc))); errorAfterAbookCheckAip(getString(R.string.msg_no_support_nfc));
return; // 以下の処理にかからないようにreturnする return; // 以下の処理にかからないようにreturnする
} }
...@@ -802,7 +799,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -802,7 +799,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
/** /**
* SPP通信エラー処理 * SPP通信エラー処理
* @param deviceName * @param deviceName デバイス名
*/ */
private void connectErrorSppDevice(String deviceName, boolean dataFormatErrorFlg) { private void connectErrorSppDevice(String deviceName, boolean dataFormatErrorFlg) {
if (!mDisConnectSppBluetoothFlg) { if (!mDisConnectSppBluetoothFlg) {
...@@ -823,6 +820,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -823,6 +820,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
* Android端末のBluetooth機能の有効化要求 * Android端末のBluetooth機能の有効化要求
* @return true:bluetooth ON, false:bluetooth OFF * @return true:bluetooth ON, false:bluetooth OFF
*/ */
@SuppressLint("MissingPermission")
private boolean requestBluetoothFeature(int requestCode) { private boolean requestBluetoothFeature(int requestCode) {
if(bleManagerUtil.mBluetoothAdapter.isEnabled()) { if(bleManagerUtil.mBluetoothAdapter.isEnabled()) {
return true; return true;
...@@ -912,7 +910,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity { ...@@ -912,7 +910,7 @@ public class ABVCheckContentViewActivity extends ABVContentViewActivity {
/** /**
* mediaPlayerにmp3ファイルをセット * mediaPlayerにmp3ファイルをセット
* @return * @return 成功したらtrue
*/ */
private boolean audioSetup() { private boolean audioSetup() {
boolean fileCheck = false; boolean fileCheck = false;
......
...@@ -15,7 +15,6 @@ import android.view.Gravity; ...@@ -15,7 +15,6 @@ import android.view.Gravity;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener; import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button; import android.widget.Button;
...@@ -25,6 +24,8 @@ import android.widget.RelativeLayout; ...@@ -25,6 +24,8 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import androidx.core.content.ContextCompat;
import org.json.adf.JSONObject; import org.json.adf.JSONObject;
import java.io.File; import java.io.File;
...@@ -47,8 +48,6 @@ import jp.agentec.abook.abv.bl.common.Constant; ...@@ -47,8 +48,6 @@ import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.constant.ABookKeys; import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.bl.data.ABVDataCache; import jp.agentec.abook.abv.bl.data.ABVDataCache;
import jp.agentec.abook.abv.bl.data.dao.AbstractDao;
import jp.agentec.abook.abv.bl.data.dao.TaskReportDao;
import jp.agentec.abook.abv.bl.download.ContentFileExtractor; import jp.agentec.abook.abv.bl.download.ContentFileExtractor;
import jp.agentec.abook.abv.bl.dto.ContentDto; import jp.agentec.abook.abv.bl.dto.ContentDto;
import jp.agentec.abook.abv.bl.dto.MydataDto; import jp.agentec.abook.abv.bl.dto.MydataDto;
...@@ -150,7 +149,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -150,7 +149,6 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public boolean isLinkedContent; public boolean isLinkedContent;
public int pageNo; public int pageNo;
public int mButtonStatus; // 保存ボタンチェック
protected boolean mAddReport; // 作業追加区分 protected boolean mAddReport; // 作業追加区分
private boolean mLocationSendResult; // GPS送信フラグ private boolean mLocationSendResult; // GPS送信フラグ
...@@ -351,14 +349,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -351,14 +349,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public static void errorMessageDialog(final Context context,final int title, final ErrorCode value) { public static void errorMessageDialog(final Context context,final int title, final ErrorCode value) {
// アラート内レイアウト // アラート内レイアウト
TextView txtMsg = new TextView(context); final int TEXT_SIZE = 20;
TextView txtMsg = new TextView(context);
txtMsg.setText(R.string.delete_message); txtMsg.setText(R.string.delete_message);
txtMsg.setTextSize(20); txtMsg.setTextSize(TEXT_SIZE);
txtMsg.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL); txtMsg.setGravity(Gravity.LEFT|Gravity.CENTER_VERTICAL);
txtMsg.setText(ErrorMessage.getMessageByErrorCode(context, value)); txtMsg.setText(ErrorMessage.getMessageByErrorCode(context, value));
int WC = ViewGroup.LayoutParams.WRAP_CONTENT;
int FP = ViewGroup.LayoutParams.MATCH_PARENT;
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(FP, WC); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(FP, WC);
params.leftMargin = 10; params.leftMargin = 10;
LinearLayout layout = new LinearLayout(context); LinearLayout layout = new LinearLayout(context);
...@@ -568,7 +565,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -568,7 +565,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
protected void setMeetingParticipantCount(boolean isVisible, View toolBar) { protected void setMeetingParticipantCount(boolean isVisible, View toolBar) {
final TextView textView = (TextView)toolBar.findViewById(R.id.txt_meeting_participant); final TextView textView = toolBar.findViewById(R.id.txt_meeting_participant);
if (textView == null) { if (textView == null) {
return; return;
} }
...@@ -581,13 +578,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -581,13 +578,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public void run() { public void run() {
final int count = meetingManager.getParticipantCount(); final int count = meetingManager.getParticipantCount();
handler.post(new Runnable() { handler.post(new Runnable() {
@SuppressLint("SetTextI18n")
@Override @Override
public void run() { public void run() {
textView.setText(getRString(R.string.meeting_participant_count) + ":" + count); textView.setText(getRString(R.string.meeting_participant_count) + ":" + count);
} }
}); });
} }
}); });
} }
} }
...@@ -664,14 +662,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -664,14 +662,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
@SuppressLint("SourceLockedOrientationActivity") @SuppressLint("SourceLockedOrientationActivity")
protected void createCheckToolbar() { protected void createCheckToolbar() {
final RelativeLayout fl; final RelativeLayout fl;
if (operationDto != null && operationDto.operationType == OperationType.PDF && mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT) { if ((operationDto != null) && (operationDto.operationType == OperationType.PDF) && (mXWalkOpenType == Constant.XWalkOpenType.TASK_REPORT)) {
fl = (RelativeLayout) findViewById(R.id.RelativeLayout2); fl = findViewById(R.id.RelativeLayout2);
} else { } else {
fl = (RelativeLayout) findViewById(R.id.frameTopbar); fl = findViewById(R.id.frameTopbar);
} }
fl.setBackgroundColor(getResources().getColor(R.color.operation_color)); fl.setBackgroundColor(ContextCompat.getColor(this, R.color.operation_color));
operationHomeButton = findViewById(R.id.btn_operation_home);
operationHomeButton = (Button) findViewById(R.id.btn_operation_home);
operationHomeButton.setOnClickListener(new View.OnClickListener() { operationHomeButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -703,7 +700,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -703,7 +700,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
}); });
operationHomeButton.setVisibility(View.VISIBLE); operationHomeButton.setVisibility(View.VISIBLE);
taskListButton = (ImageButton) findViewById(R.id.btn_show_task_list); taskListButton = findViewById(R.id.btn_show_task_list);
taskListButton.setOnClickListener(new View.OnClickListener() { taskListButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
...@@ -730,7 +727,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -730,7 +727,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
mStatusCode = 0; mStatusCode = 0;
} }
operationNameTitle = (TextView) findViewById(R.id.title); operationNameTitle = findViewById(R.id.title);
operationNameTitle.setText(operationDto.operationName); operationNameTitle.setText(operationDto.operationName);
if (isNormalSize()) { if (isNormalSize()) {
operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_normal_width)); operationNameTitle.setWidth(getRDimensionSize(R.dimen.operation_title_normal_width));
...@@ -770,6 +767,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -770,6 +767,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
protected void finishActivity() {} protected void finishActivity() {}
protected void webViewLoadUrl(String url){} protected void webViewLoadUrl(String url){}
@SuppressWarnings("unused")
public void onClickOperationHome(View v) { public void onClickOperationHome(View v) {
if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) { if (mXWalkOpenType == Constant.XWalkOpenType.PANO_EDIT) {
// リソースパターンの適用 // リソースパターンの適用
...@@ -878,7 +876,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -878,7 +876,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
public void commonShouldOverrideUrlLoading (Uri uri, final OperationTaskDto operationTaskDto) { public void commonShouldOverrideUrlLoading (Uri uri, final OperationTaskDto operationTaskDto) {
//parent method //parent method
Map<String, String> abookCheckParam = new HashMap<String, String>(); Map<String, String> abookCheckParam = new HashMap<>();
for (String key : uri.getQueryParameterNames()) { for (String key : uri.getQueryParameterNames()) {
abookCheckParam.put(key, uri.getQueryParameter(key)); abookCheckParam.put(key, uri.getQueryParameter(key));
} }
...@@ -896,15 +894,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -896,15 +894,13 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 定期点検の場合、以下のフラグを変更しない(mAddReport trueのみ) // 定期点検の場合、以下のフラグを変更しない(mAddReport trueのみ)
if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) { if (abookCheckParam.containsKey(ABookKeys.ADD_REPORT)) {
mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0 ? true : false; mAddReport = Integer.parseInt(abookCheckParam.get(ABookKeys.ADD_REPORT)) > 0;
} }
long taskReportId = 0; long taskReportId = 0;
String reportStartDate = "";
if (operationDto.reportType == Constant.ReportType.RoutineTask && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) { if (operationDto.reportType == Constant.ReportType.RoutineTask && abookCheckParam.get(ABookKeys.TASK_REPORT_ID) != null && abookCheckParam.get(ABookKeys.REPORT_START_DATE) != null) {
taskReportId = Long.parseLong(abookCheckParam.get(ABookKeys.TASK_REPORT_ID)); taskReportId = Long.parseLong(abookCheckParam.get(ABookKeys.TASK_REPORT_ID));
reportStartDate = abookCheckParam.get(ABookKeys.REPORT_START_DATE);
} }
if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT, if (StringUtil.equalsAny(mCmd, ABookKeys.CMD_MOVE_HOT_SPOT, ABookKeys.CMD_INSERT_TASK_REPORT, ABookKeys.CMD_UPDATE_TASK_REPORT,
...@@ -928,9 +924,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -928,9 +924,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
if (abookCheckParam.get(ABookKeys.TASK_REPORT) != null) { if (abookCheckParam.get(ABookKeys.TASK_REPORT) != null) {
JSONObject tastReportJson = new JSONObject(abookCheckParam.get(ABookKeys.TASK_REPORT)); JSONObject tastReportJson = new JSONObject(abookCheckParam.get(ABookKeys.TASK_REPORT));
JSONObject taskJson = tastReportJson.getJSONObject(ABookKeys.TASK); JSONObject taskJson = tastReportJson.getJSONObject(ABookKeys.TASK);
Iterator taskKeys = taskJson.keys(); @SuppressWarnings("unchecked")
Iterator<String> taskKeys = taskJson.keys();
while (taskKeys.hasNext()) { while (taskKeys.hasNext()) {
String itemKey = (String) taskKeys.next(); String itemKey = taskKeys.next();
if (itemKey.startsWith("q_1_")) { if (itemKey.startsWith("q_1_")) {
taskCode = taskJson.getString(itemKey); taskCode = taskJson.getString(itemKey);
} }
...@@ -1034,7 +1031,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1034,7 +1031,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
onActionOperationPdfWebView(abookCheckParam, operationTaskDto); onActionOperationPdfWebView(abookCheckParam, operationTaskDto);
} }
} else if (mCmd.equals(ABookKeys.CMD_CHANGE_DISPLAY_STATUS)) { } else if (mCmd.equals(ABookKeys.CMD_CHANGE_DISPLAY_STATUS)) {
mStatusCode = Integer.valueOf(abookCheckParam.get(ABookKeys.STATUS_CODE)); mStatusCode = Integer.parseInt(abookCheckParam.get(ABookKeys.STATUS_CODE));
commonConfigureHeader(); commonConfigureHeader();
if(isOperationPdf) { if(isOperationPdf) {
onActionOperationPdfWebView(abookCheckParam, operationTaskDto); onActionOperationPdfWebView(abookCheckParam, operationTaskDto);
...@@ -1049,6 +1046,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1049,6 +1046,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
// 帳票コンポーネントを削除したので、ダイアログを表示するだけで何もしない // 帳票コンポーネントを削除したので、ダイアログを表示するだけで何もしない
showOzFileOpenErrorDialog(); showOzFileOpenErrorDialog();
} else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) { } else if (mCmd.equals(ABookKeys.CMD_CONTENT_EDIT_CLOSE)) {
final int DELAY = 5000;
showProgressPopup(); showProgressPopup();
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
@Override @Override
...@@ -1056,10 +1054,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1056,10 +1054,10 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
closeProgressPopup(); closeProgressPopup();
finish(); finish();
} }
}, 5000); }, DELAY);
} else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) { } else if (mCmd.equals(ABookKeys.CMD_GET_GPS_INFO)) {
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
setLocation((Integer.valueOf(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1)); setLocation((Integer.parseInt(abookCheckParam.get(ABookKeys.GPS_TYPE)) != 1));
// #32926 作業報告画面改善 end // #32926 作業報告画面改善 end
} else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) { } else if (mCmd.equals(ABookKeys.CMD_SCENE_REGIST)) {
String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG); String successFlg = abookCheckParam.get(ABookKeys.SUCCESS_FLG);
...@@ -1091,8 +1089,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1091,8 +1089,8 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
onActionOperationPdfWebView(abookCheckParam, operationTaskDto); onActionOperationPdfWebView(abookCheckParam, operationTaskDto);
} else if (mCmd.equals(ABookKeys.CMD_SHOW_RELATED_CONTENT)) { } else if (mCmd.equals(ABookKeys.CMD_SHOW_RELATED_CONTENT)) {
try { try {
long linkedContentId = Long.valueOf(abookCheckParam.get(ABookKeys.CONTENT_ID)); long linkedContentId = Long.parseLong(abookCheckParam.get(ABookKeys.CONTENT_ID));
int pageNum = Integer.valueOf(abookCheckParam.get(ABookKeys.CMD_PAGE_NUM)); int pageNum = Integer.parseInt(abookCheckParam.get(ABookKeys.CMD_PAGE_NUM));
//ダウンロード完了後、開く時に必要 //ダウンロード完了後、開く時に必要
isLinkedContent = true; isLinkedContent = true;
...@@ -1111,17 +1109,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1111,17 +1109,16 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
getDeviceInfo(abookCheckParam); getDeviceInfo(abookCheckParam);
} else if (mCmd.equals(ABookKeys.CMD_LOCK_REPORT)) { } else if (mCmd.equals(ABookKeys.CMD_LOCK_REPORT)) {
String taskKey = abookCheckParam.get(TaskKey); String taskKey = abookCheckParam.get(TaskKey);
Date startDate = dateOrNull(abookCheckParam.get("reportStartDate")); Date startDate = dateOrNull(abookCheckParam.get(ReportStartDate));
TaskReportDao dao = AbstractDao.getDao(TaskReportDao.class);
// ロック // ロック
LockReportLogic.Result r = LockReportLogic.newInstance().lock(taskKey, taskReportId, startDate); LockReportLogic.Result r = LockReportLogic.newInstance().lock(taskKey, taskReportId, startDate);
// JSコールバック // JSコールバック
afterABookCheckApi(mCmd, mTaskKey, r.getResult(), r.getMessage(), r.getExtParam().json()); afterABookCheckApi(mCmd, mTaskKey, r.getResult(), r.getMessage(), r.getExtParam().json());
} else if (mCmd.equals(ABookKeys.CMD_UNLOCK_REPORT)) { } else if (mCmd.equals(ABookKeys.CMD_UNLOCK_REPORT)) {
String taskKey = abookCheckParam.get(TaskKey); String taskKey = abookCheckParam.get(TaskKey);
Date startDate = dateOrNull(abookCheckParam.get("reportStartDate")); Date startDate = dateOrNull(abookCheckParam.get(ReportStartDate));
// アンロック // アンロック
UnlockReportLogic.Result r = UnlockReportLogic.newInstance().unlock(taskKey, taskReportId, startDate); UnlockReportLogic.newInstance().unlock(taskKey, taskReportId, startDate);
// JSコールバック // JSコールバック
JSONObject extParam = new JSONObject(); JSONObject extParam = new JSONObject();
extParam.put(ReportStatus, 0); extParam.put(ReportStatus, 0);
...@@ -1201,13 +1198,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1201,13 +1198,14 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
if (extParam != null) { final String formatted;
Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam)); if (extParam != null) {
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam)); formatted = String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s', %s)", finalParent, cmd, taskKey, result, message, extParam);
} else { } else {
Logger.i(TAG, String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message)); formatted = String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message);
webViewLoadUrl(String.format("javascript:%sCHK.afterABookCheckApi('%s', '%s', '%s', '%s')", finalParent, cmd, taskKey, result, message)); }
} Logger.i(TAG, formatted);
webViewLoadUrl(formatted);
} }
}); });
} }
...@@ -1229,7 +1227,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1229,7 +1227,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/** /**
* 位置情報取得 * 位置情報取得
* @param showPermissionDialogFlg * @param showPermissionDialogFlg ダイアログ表示するかどうか
*/ */
// #32926 作業報告画面改善 start // #32926 作業報告画面改善 start
protected void setLocation(final boolean showPermissionDialogFlg) { protected void setLocation(final boolean showPermissionDialogFlg) {
...@@ -1261,7 +1259,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1261,7 +1259,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
json.put("latitude", latitude); json.put("latitude", latitude);
json.put("longitude", longitude); json.put("longitude", longitude);
afterABookCheckApi(mCmd, "", 0, "", json.toString()); afterABookCheckApi(mCmd, "", 0, "", json.toString());
}; }
}); });
mLocationSendResult = true; mLocationSendResult = true;
} }
...@@ -1283,7 +1281,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1283,7 +1281,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/** /**
* 報告可能フラグ * 報告可能フラグ
* @return * @return 編集可能かどうか
*/ */
public boolean isReportEdit() { public boolean isReportEdit() {
return mEnableReportEdit == Constant.EnableReportEdit.YES; return mEnableReportEdit == Constant.EnableReportEdit.YES;
...@@ -1291,9 +1289,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1291,9 +1289,9 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
/** /**
* PDF操作インスタンスを作成 * PDF操作インスタンスを作成
* @param pdfFileName * @param pdfFileName ファイル名
* @return * @return PDFデータ
* @throws Exception * @throws Exception PDF処理失敗
*/ */
public FoxitPdfCore initPdf(String pdfFileName) throws Exception { public FoxitPdfCore initPdf(String pdfFileName) throws Exception {
Logger.d(TAG, "post intent to open file pdfFileName=" + pdfFileName); Logger.d(TAG, "post intent to open file pdfFileName=" + pdfFileName);
...@@ -1305,6 +1303,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1305,6 +1303,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
// 保存処理 // 保存処理
@SuppressWarnings("unused")
public void ozdSaveProcess() { public void ozdSaveProcess() {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
...@@ -1317,6 +1316,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1317,6 +1316,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
// 一時保存処理 // 一時保存処理
@SuppressWarnings("unused")
public void ozdLocalSaveProcess() { public void ozdLocalSaveProcess() {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
...@@ -1329,6 +1329,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1329,6 +1329,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
// 閉じる処理 // 閉じる処理
@SuppressWarnings("unused")
public void ozdCancelProcess() { public void ozdCancelProcess() {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
...@@ -1341,6 +1342,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1341,6 +1342,7 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
// 削除処理 // 削除処理
@SuppressWarnings("unused")
public void ozdDeleteProcess() { public void ozdDeleteProcess() {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
...@@ -1358,11 +1360,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity { ...@@ -1358,11 +1360,12 @@ public abstract class ABVContentViewActivity extends ABVAuthenticatedActivity {
} }
// 押したボタンによってHTML側の処理を行う // 押したボタンによってHTML側の処理を行う
@SuppressWarnings("unused")
public void doProcess() { public void doProcess() {
} }
// 作業終了する時、作業ID設定し、画面遷移処理 // 作業終了する時、作業ID設定し、画面遷移処理
public void closeCurrentScreen(int reportType) { public void closeCurrentScreen( @SuppressWarnings("unused") int reportType) {
if (mAddReport) { // 作業追加あり if (mAddReport) { // 作業追加あり
if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理 if (ActivityHandlingHelper.getInstance().searchOzdActivityStack()) { // OZD画面で画面遷移処理
......
...@@ -248,6 +248,7 @@ public class DashboardActivity extends OperationActivity { ...@@ -248,6 +248,7 @@ public class DashboardActivity extends OperationActivity {
private class JsInf { private class JsInf {
@SuppressWarnings("unused")
@JavascriptInterface @JavascriptInterface
public void existSetLocation(String ret) { public void existSetLocation(String ret) {
Logger.d(TAG, "existSetLocation=%s", ret); Logger.d(TAG, "existSetLocation=%s", ret);
...@@ -263,6 +264,7 @@ public class DashboardActivity extends OperationActivity { ...@@ -263,6 +264,7 @@ public class DashboardActivity extends OperationActivity {
} }
} }
@SuppressWarnings("unused")
@JavascriptInterface @JavascriptInterface
public void existSendLog(String ret) { public void existSendLog(String ret) {
Logger.d(TAG, "existSendLog=%s", ret); Logger.d(TAG, "existSendLog=%s", ret);
...@@ -282,11 +284,13 @@ public class DashboardActivity extends OperationActivity { ...@@ -282,11 +284,13 @@ public class DashboardActivity extends OperationActivity {
} }
} }
@SuppressWarnings("unused")
@JavascriptInterface @JavascriptInterface
public String getCachePath() { public String getCachePath() {
return getCacheDir().getAbsolutePath(); return getCacheDir().getAbsolutePath();
} }
@SuppressWarnings("unused")
@JavascriptInterface @JavascriptInterface
public void sendParam(String param) { public void sendParam(String param) {
Logger.i(TAG, "sendParam: %s", param); Logger.i(TAG, "sendParam: %s", param);
...@@ -300,6 +304,7 @@ public class DashboardActivity extends OperationActivity { ...@@ -300,6 +304,7 @@ public class DashboardActivity extends OperationActivity {
}); });
} }
@SuppressWarnings("unused")
@JavascriptInterface @JavascriptInterface
public void getAttachedDataUrl(String taskKey, String data) {} public void getAttachedDataUrl(String taskKey, String data) {}
} }
......
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