Commit f077265b by onuma

Merge branch 'features/1.2.363_42647' into features/1.3.200

# Conflicts:
#	ABVJE_UI_Android/src/jp/agentec/abook/abv/ui/common/appinfo/AppDefType.java
#	gradle.properties
parents 19ae8790 4a4dfd74
...@@ -114,13 +114,6 @@ android { ...@@ -114,13 +114,6 @@ android {
abiFilters "x86_64", "" abiFilters "x86_64", ""
} }
} }
// 容量が大きいため、コメントアウト
// x86_armv7 {
// ndk {
// abiFilters "x86", "armeabi-v7a", ""
// }
// }
} else { } else {
armv7 { armv7 {
versionCode defaultConfig.versionCode versionCode defaultConfig.versionCode
...@@ -128,6 +121,7 @@ android { ...@@ -128,6 +121,7 @@ android {
abiFilters "armeabi-v7a", "" abiFilters "armeabi-v7a", ""
} }
} }
armv8 { armv8 {
versionCode defaultConfig.versionCode + 1 versionCode defaultConfig.versionCode + 1
ndk { ndk {
......
...@@ -6,7 +6,7 @@ buildscript { ...@@ -6,7 +6,7 @@ buildscript {
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion 26 compileSdkVersion 29
buildToolsVersion '28.0.3' buildToolsVersion '28.0.3'
defaultConfig { defaultConfig {
......
...@@ -26,7 +26,7 @@ dependencies { ...@@ -26,7 +26,7 @@ dependencies {
} }
android { android {
compileSdkVersion 26 compileSdkVersion 29
buildToolsVersion '28.0.3' buildToolsVersion '28.0.3'
defaultConfig { defaultConfig {
......
...@@ -131,7 +131,7 @@ public class ThetaHelper { ...@@ -131,7 +131,7 @@ public class ThetaHelper {
* @param ssid アクセスポイント * @param ssid アクセスポイント
* @return 接続パスワード * @return 接続パスワード
*/ */
private String getPassword(String ssid) { public String getPassword(String ssid) {
String password = ssid.replace("THETA",""); String password = ssid.replace("THETA","");
password = password.replace(".OSC",""); password = password.replace(".OSC","");
return password.substring(2); return password.substring(2);
...@@ -247,48 +247,14 @@ public class ThetaHelper { ...@@ -247,48 +247,14 @@ public class ThetaHelper {
* THETAカメラWi-Fiと非接続 * THETAカメラWi-Fiと非接続
*/ */
public void disConnectThetaCameraWifi(WifiManager wifiManager) { public void disConnectThetaCameraWifi(WifiManager wifiManager) {
Logger.d(TAG,"disConnectThetaCameraWifi");
//既存接続中のネットワーク切断 //既存接続中のネットワーク切断
WifiInfo wifi_inf = wifiManager.getConnectionInfo(); WifiInfo wifi_inf = wifiManager.getConnectionInfo();
if (wifi_inf.getNetworkId() != -1 ) { if (wifi_inf.getNetworkId() != -1 ) {
wifiManager.disableNetwork(wifi_inf.getNetworkId()); wifiManager.disableNetwork(wifi_inf.getNetworkId());
wifiManager.disconnect(); wifiManager.disconnect();
} }
//通常Wi-Fi再接続処理 wifiManager.disconnect();
// boolean disconnect = true;
// for (WifiConfiguration configuration : wifiManager.getConfiguredNetworks()) {
// if (wifi_inf.getNetworkId() == configuration.networkId) {
// String packageName = mContext.getPackageName();
// int result = configuration.toString().indexOf(packageName);
// if (result != -1) {
// disconnect = false;
// break;
// }
// }
// }
// if (disconnect) {
// //一番近くにあるの通常Wi-Fiに接続
// List<ScanResult> results = wifiManager.getScanResults();
// int level = 0;
// int networkId = -1;
// for (WifiConfiguration configuration : wifiManager.getConfiguredNetworks()) {
// int index = configuration.SSID.indexOf(ABookValues.THETA_MODEL_NAME_THETA);
// if (index != -1) {
// continue;
// }
// for (ScanResult scanResult : results) {
// if (configuration.SSID.indexOf(scanResult.SSID) != -1) {
// if (level == 0 || WifiManager.compareSignalLevel(level, scanResult.level) < 0) {
// level = scanResult.level;
// networkId = configuration.networkId;
// }
// break;
// }
// }
// }
// if (networkId != -1) {
// wifiManager.enableNetwork(networkId, true);
// }
// }
} }
......
...@@ -26,6 +26,22 @@ public class PreferenceUtil { ...@@ -26,6 +26,22 @@ public class PreferenceUtil {
return getPref(context).getBoolean(key, def); return getPref(context).getBoolean(key, def);
} }
/**
* SharedPreference から、指定のキーで値をとりだす。String[]
* @param context
* @param key キー
* @return String[] 、データがなければnull
*/
public static String[] get(Context context , String key) {
SharedPreferences prefs = getUserPreference(context);
String result = prefs.getString(key,"");
if (result.length() > 0) {
return result.split(",");
}
return null;
}
public static boolean contains(Context context, String key) { public static boolean contains(Context context, String key) {
return getPref(context).contains(key); return getPref(context).contains(key);
} }
...@@ -42,6 +58,26 @@ public class PreferenceUtil { ...@@ -42,6 +58,26 @@ public class PreferenceUtil {
getEditor(context).putString(key, val).commit(); getEditor(context).putString(key, val).commit();
} }
/**
* SharedPreference に String[] で値を保存します。
* @param context
* @param key キー
* @param vals 保存する値 String[]
*/
public static void put(Context context, String key, String[] vals) {
StringBuffer buffer = new StringBuffer();
String stringItem;
for(String val : vals){
buffer.append(val + ",");
};
String buf = buffer.toString();
stringItem = buf.substring(0, buf.length() - 1);
SharedPreferences prefs = getUserPreference(context);
Editor editor = prefs.edit();
editor.putString(key, stringItem).commit();
}
public static void clear(Context context) { public static void clear(Context context) {
getEditor(context).clear().commit(); getEditor(context).clear().commit();
} }
......
...@@ -3,74 +3,43 @@ package jp.agentec.abook.abv.ui.common.activity; ...@@ -3,74 +3,43 @@ package jp.agentec.abook.abv.ui.common.activity;
import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType; import jp.agentec.abook.abv.bl.acms.type.DownloadStatusType;
import jp.agentec.abook.abv.bl.common.ABVEnvironment; import jp.agentec.abook.abv.bl.common.ABVEnvironment;
import jp.agentec.abook.abv.bl.common.CommonExecutor; import jp.agentec.abook.abv.bl.common.CommonExecutor;
import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.exception.ABVException; import jp.agentec.abook.abv.bl.common.exception.ABVException;
import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode; import jp.agentec.abook.abv.bl.common.exception.ABVExceptionCode;
import jp.agentec.abook.abv.bl.common.exception.AcmsException; import jp.agentec.abook.abv.bl.common.exception.AcmsException;
import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException; import jp.agentec.abook.abv.bl.common.exception.NetworkDisconnectedException;
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.OperationDao;
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.ContentFileExtractor;
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.dto.FixPushMessageDto;
import jp.agentec.abook.abv.bl.dto.OperationDto;
import jp.agentec.abook.abv.bl.dto.PushMessageDto;
import jp.agentec.abook.abv.bl.logic.AbstractLogic;
import jp.agentec.abook.abv.bl.logic.PushMessageLogic;
import jp.agentec.abook.abv.cl.environment.DeviceInfo; import jp.agentec.abook.abv.cl.environment.DeviceInfo;
import jp.agentec.abook.abv.cl.helper.ContentMarkingFileHelper; import jp.agentec.abook.abv.cl.helper.ContentMarkingFileHelper;
import jp.agentec.abook.abv.cl.util.AndroidStringUtil; import jp.agentec.abook.abv.cl.util.AndroidStringUtil;
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.constant.ErrorCode; import jp.agentec.abook.abv.ui.common.constant.ErrorCode;
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.helper.ProgressDialogHelper;
import jp.agentec.abook.abv.ui.common.util.ABVToastUtil; 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.KeyboardUtils;
import jp.agentec.abook.abv.ui.common.util.LogUtil; import jp.agentec.abook.abv.ui.common.util.LogUtil;
import jp.agentec.abook.abv.ui.common.util.PatternStringUtil;
import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity; import jp.agentec.abook.abv.ui.home.activity.ABookSettingActivity;
import jp.agentec.abook.abv.ui.home.adapter.FixPushMessageAdapter;
import jp.agentec.abook.abv.ui.home.adapter.OperationSelectAdapter;
import jp.agentec.abook.abv.ui.home.adapter.PushMessageListAdapter;
import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper; import jp.agentec.abook.abv.ui.home.helper.ActivityHandlingHelper;
import jp.agentec.abook.abv.ui.viewer.activity.DeviceImageListActivity;
import jp.agentec.adf.util.DateTimeFormat;
import jp.agentec.adf.util.DateTimeUtil;
import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.LinearInterpolator; import android.view.animation.LinearInterpolator;
import android.view.animation.RotateAnimation; import android.view.animation.RotateAnimation;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioGroup;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.handmark.pulltorefresh.library.PullToRefreshBase; import com.handmark.pulltorefresh.library.PullToRefreshBase;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
public abstract class ABVUIActivity extends ABVAuthenticatedActivity { public abstract class ABVUIActivity extends ABVAuthenticatedActivity {
private final static String TAG = "ABVUIActivity"; private final static String TAG = "ABVUIActivity";
......
...@@ -26,6 +26,7 @@ public interface AppDefType { ...@@ -26,6 +26,7 @@ public interface AppDefType {
String DISPLAY_MARKING = "displayMarking"; String DISPLAY_MARKING = "displayMarking";
String APP_VERSIONUP_PROCESSING = "appVersionProcessingFlag"; String APP_VERSIONUP_PROCESSING = "appVersionProcessingFlag";
String ERROR_SEND_ENABLE = "errorSendEnable"; String ERROR_SEND_ENABLE = "errorSendEnable";
String THETA_SSID_STRING = "THETA_SSID";
} }
interface UserPrefKey { interface UserPrefKey {
......
...@@ -9,10 +9,16 @@ import android.content.IntentFilter; ...@@ -9,10 +9,16 @@ import android.content.IntentFilter;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.database.Cursor; import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkRequest;
import android.net.Uri; import android.net.Uri;
import android.net.wifi.ScanResult; import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager; import android.net.wifi.WifiManager;
import android.net.wifi.WifiNetworkSpecifier;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.BaseColumns; import android.provider.BaseColumns;
import android.provider.MediaStore; import android.provider.MediaStore;
...@@ -31,6 +37,7 @@ import com.theta.helper.ThetaHelper; ...@@ -31,6 +37,7 @@ import com.theta.helper.ThetaHelper;
import com.theta.network.ThetaDeviceInfo; import com.theta.network.ThetaDeviceInfo;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
...@@ -42,6 +49,7 @@ import jp.agentec.abook.abv.bl.common.constant.ABookKeys; ...@@ -42,6 +49,7 @@ import jp.agentec.abook.abv.bl.common.constant.ABookKeys;
import jp.agentec.abook.abv.bl.common.constant.ABookValues; import jp.agentec.abook.abv.bl.common.constant.ABookValues;
import jp.agentec.abook.abv.bl.common.log.Logger; import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.cl.environment.DeviceInfo; import jp.agentec.abook.abv.cl.environment.DeviceInfo;
import jp.agentec.abook.abv.cl.util.PreferenceUtil;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity; import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.appinfo.AppDefType; import jp.agentec.abook.abv.ui.common.appinfo.AppDefType;
...@@ -101,6 +109,10 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -101,6 +109,10 @@ public class DeviceImageListActivity extends ABVUIActivity {
private SceneSendHelper mSceneSendHelper = new SceneSendHelper(this); private SceneSendHelper mSceneSendHelper = new SceneSendHelper(this);
private WifiManager mWifiManager; private WifiManager mWifiManager;
private List<String> savedThetaList_ = new ArrayList<>();
private boolean isStartCamera_ = false; // THETAとの接続開始フラグ
private ConnectivityManager.NetworkCallback networkCallback_ = null; // ネットワーク状態更新時のコールバック
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "onCreate"); Logger.i(TAG, "onCreate");
...@@ -221,6 +233,17 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -221,6 +233,17 @@ public class DeviceImageListActivity extends ABVUIActivity {
displayGalleryGridView(); displayGalleryGridView();
} }
mIsOnResume = true; mIsOnResume = true;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
// Android10の場合は、コールバック登録解除で、THETAとの接続が切れる
if (networkCallback_ != null && isStartCamera_) {
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
cm.unregisterNetworkCallback(networkCallback_);
isStartCamera_ = false;
}
}
}
} }
//端末の戻るボタン禁止 //端末の戻るボタン禁止
...@@ -508,6 +531,7 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -508,6 +531,7 @@ public class DeviceImageListActivity extends ABVUIActivity {
registerButton.setOnClickListener(new View.OnClickListener() { registerButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Logger.v(TAG,"registerButton.onClick");
buttonDoubleTapControl(registerButton); buttonDoubleTapControl(registerButton);
if (deviceWifiEnable()) { if (deviceWifiEnable()) {
wifiScanStart(); wifiScanStart();
...@@ -561,6 +585,7 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -561,6 +585,7 @@ public class DeviceImageListActivity extends ABVUIActivity {
* ブロードキャスト リスナーを登録し、Wifiスキャンを開始する。 * ブロードキャスト リスナーを登録し、Wifiスキャンを開始する。
*/ */
private void wifiScanStart() { private void wifiScanStart() {
Logger.v(TAG,"wifiScanStart");
showProgressPopup(); showProgressPopup();
registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
mWifiManager.startScan(); mWifiManager.startScan();
...@@ -571,8 +596,60 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -571,8 +596,60 @@ public class DeviceImageListActivity extends ABVUIActivity {
* @param ssid アクセスポイント * @param ssid アクセスポイント
* @param networkId 接続可能なネットワークID * @param networkId 接続可能なネットワークID
*/ */
private void connectThetaWifi(String ssid, int networkId) { private void connectThetaWifi(final String ssid, int networkId) {
Logger.i(TAG,"connectThetaWifi ssid=%s, networdId=%s, Build.VERSION_CODE=%s", ssid, networkId, Build.VERSION.SDK_INT);
showProgressPopup(getString(R.string.msg_wifi_connecting)); showProgressPopup(getString(R.string.msg_wifi_connecting));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
WifiNetworkSpecifier.Builder builder = new WifiNetworkSpecifier.Builder();
builder.setSsid(ssid);
String pass = mThetaHelper.getPassword(ssid);
builder.setWpa2Passphrase(pass);
WifiNetworkSpecifier wifiNetworkSpecifier = builder.build();
NetworkRequest.Builder networkRequestBuilder = new NetworkRequest.Builder();
networkRequestBuilder.addTransportType(NetworkCapabilities.TRANSPORT_WIFI);
networkRequestBuilder.setNetworkSpecifier(wifiNetworkSpecifier);
NetworkRequest networkRequest = networkRequestBuilder.build();
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
networkCallback_ = new ConnectivityManager.NetworkCallback() {
@Override
public void onAvailable(Network network) {
super.onAvailable(network);
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (cm != null) {
// 接続したら保存
addThetaSSID(ssid);
PreferenceUtil.put(getApplicationContext(), AppDefType.DefPrefKey.THETA_SSID_STRING, savedThetaList_.toArray(new String[savedThetaList_.size()]));
cm.bindProcessToNetwork(network);
handler.postDelayed(new Runnable() {
@Override
public void run() {
new DeviceInfoTask(DeviceImageListActivity.this).execute();
}
}, GET_THETA_CAMERA_INFO_DELAY);
}
}
@Override
public void onLost(Network network) {
super.onLost(network);
closeProgressPopup();
}
@Override
public void onUnavailable() {
super.onUnavailable();
closeProgressPopup();
}
};
cm.requestNetwork(networkRequest, networkCallback_);
}
} else {
if (networkId == -1) { if (networkId == -1) {
networkId = mThetaHelper.saveThetaCameraWifi(ssid); networkId = mThetaHelper.saveThetaCameraWifi(ssid);
if (networkId == -1) { if (networkId == -1) {
...@@ -582,7 +659,6 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -582,7 +659,6 @@ public class DeviceImageListActivity extends ABVUIActivity {
return; return;
} }
} }
boolean isSuccess = mThetaHelper.connectThetaCameraWifi(networkId); boolean isSuccess = mThetaHelper.connectThetaCameraWifi(networkId);
if (isSuccess) { if (isSuccess) {
handler.postDelayed(new Runnable() { handler.postDelayed(new Runnable() {
...@@ -597,11 +673,13 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -597,11 +673,13 @@ public class DeviceImageListActivity extends ABVUIActivity {
AlertDialogUtil.showAlertDialog(this, R.string.app_name, R.string.msg_fail_connect_theta_wifi, true, new DialogInterface.OnClickListener() { AlertDialogUtil.showAlertDialog(this, R.string.app_name, R.string.msg_fail_connect_theta_wifi, true, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
Logger.i(TAG, "---AlertDialogUtil.onClick");
wifiScanStart(); wifiScanStart();
} }
}); });
} }
} }
}
/** /**
* ActivityをFinishする * ActivityをFinishする
...@@ -641,6 +719,7 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -641,6 +719,7 @@ public class DeviceImageListActivity extends ABVUIActivity {
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClassName(getPackageName(), ThetaCameraActivity.class.getName()); intent.setClassName(getPackageName(), ThetaCameraActivity.class.getName());
startActivity(intent); startActivity(intent);
isStartCamera_ = true;
} else { } else {
AlertDialogUtil.showAlertDialog(this, R.string.app_name, R.string.msg_fail_connect_theta_wifi, true, new DialogInterface.OnClickListener() { AlertDialogUtil.showAlertDialog(this, R.string.app_name, R.string.msg_fail_connect_theta_wifi, true, new DialogInterface.OnClickListener() {
@Override @Override
...@@ -681,6 +760,18 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -681,6 +760,18 @@ public class DeviceImageListActivity extends ABVUIActivity {
ThetaDeviceInfo deviceInfo = new ThetaDeviceInfo(); ThetaDeviceInfo deviceInfo = new ThetaDeviceInfo();
if (index != -1) { if (index != -1) {
int networkId = -1; int networkId = -1;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
deviceInfo.setSSID(scanSSID);
String[] ssid = PreferenceUtil.get(getApplicationContext(), AppDefType.DefPrefKey.THETA_SSID_STRING);
if (ssid != null) {
savedThetaList_ = new ArrayList<>(Arrays.asList(ssid));
if (findThetaSSID(scanSSID)) {
networkId = 0; // -1 だと未登録になるので
deviceInfo.setSSID(scanSSID);
deviceInfo.setNetworkId(networkId);
}
}
} else {
for (WifiConfiguration configuration : mWifiManager.getConfiguredNetworks()) { for (WifiConfiguration configuration : mWifiManager.getConfiguredNetworks()) {
// Android4.2以降よりダブルクォーテーションが付いてくるので除去 // Android4.2以降よりダブルクォーテーションが付いてくるので除去
String configurationSSID = configuration.SSID.replace("\"", ""); String configurationSSID = configuration.SSID.replace("\"", "");
...@@ -698,6 +789,7 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -698,6 +789,7 @@ public class DeviceImageListActivity extends ABVUIActivity {
if (isConnected) { if (isConnected) {
break; break;
} }
}
if (networkId == -1) { //保存されてない if (networkId == -1) { //保存されてない
deviceInfo.setSSID(scanSSID); deviceInfo.setSSID(scanSSID);
scanWifiList.add(deviceInfo); scanWifiList.add(deviceInfo);
...@@ -707,11 +799,12 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -707,11 +799,12 @@ public class DeviceImageListActivity extends ABVUIActivity {
} }
} }
} }
//THETA接続状態の場合、カメラ画面へ遷移
if (isConnected) { if (isConnected) {
//THETA接続状態の場合、カメラ画面へ遷移
changeProgressPopup(getString(R.string.msg_wifi_connecting)); changeProgressPopup(getString(R.string.msg_wifi_connecting));
new DeviceInfoTask(DeviceImageListActivity.this).execute(); new DeviceInfoTask(DeviceImageListActivity.this).execute();
} else { //カメラ選択画面再描画 } else {
//カメラ選択画面再描画
WifiThetaConnectAdapter savedAdapter = (WifiThetaConnectAdapter) savedListView.getAdapter(); WifiThetaConnectAdapter savedAdapter = (WifiThetaConnectAdapter) savedListView.getAdapter();
savedAdapter.setListItem(scanSavedWifiList); savedAdapter.setListItem(scanSavedWifiList);
savedAdapter.notifyDataSetChanged(); savedAdapter.notifyDataSetChanged();
...@@ -719,7 +812,32 @@ public class DeviceImageListActivity extends ABVUIActivity { ...@@ -719,7 +812,32 @@ public class DeviceImageListActivity extends ABVUIActivity {
notSaveAdapter.setListItem(scanWifiList); notSaveAdapter.setListItem(scanWifiList);
notSaveAdapter.notifyDataSetChanged(); notSaveAdapter.notifyDataSetChanged();
} }
closeProgressPopup(); closeProgressPopup();
} }
/**
* savedThetaList_ に新しい ssidを追加する
* @param ssid
* @return ssidの追加された、あたらしいsavedThetaList_
*/
private List<String> addThetaSSID(String ssid) {
if (!findThetaSSID(ssid)) {
savedThetaList_.add(ssid);
}
return savedThetaList_;
}
/**
* savedThetaList_ に、すでにssidが存在するか?
* @param ssid
* @return 存在するならtrue
*/
private boolean findThetaSSID(String ssid) {
for (String id : savedThetaList_) {
if (id.equals(ssid)) {
return true;
}
}
return false;
}
} }
...@@ -11,6 +11,7 @@ import android.os.Bundle; ...@@ -11,6 +11,7 @@ import android.os.Bundle;
import com.theta.helper.ThetaHelper; import com.theta.helper.ThetaHelper;
import jp.agentec.abook.abv.bl.common.Constant; import jp.agentec.abook.abv.bl.common.Constant;
import jp.agentec.abook.abv.bl.common.log.Logger;
import jp.agentec.abook.abv.launcher.android.R; import jp.agentec.abook.abv.launcher.android.R;
import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity; import jp.agentec.abook.abv.ui.common.activity.ABVUIActivity;
import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil; import jp.agentec.abook.abv.ui.common.util.AlertDialogUtil;
...@@ -89,6 +90,7 @@ public class ThetaActivity extends ABVUIActivity { ...@@ -89,6 +90,7 @@ public class ThetaActivity extends ABVUIActivity {
* Wi-Fiが接続状態かチェックする。 * Wi-Fiが接続状態かチェックする。
*/ */
protected void closeThetaCameraActivity() { protected void closeThetaCameraActivity() {
Logger.i(TAG,"closeThetaCameraActivity");
showProgressPopup(); showProgressPopup();
//現在接続状態なのかチェック //現在接続状態なのかチェック
registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION)); registerReceiver(wifiReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
......
...@@ -54,6 +54,7 @@ public class ThetaCameraActivity extends ThetaActivity { ...@@ -54,6 +54,7 @@ public class ThetaCameraActivity extends ThetaActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG,"onCreate");
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.ac_theta_camera); setContentView(R.layout.ac_theta_camera);
mLiveView = findViewById(R.id.live_view); mLiveView = findViewById(R.id.live_view);
...@@ -232,6 +233,7 @@ public class ThetaCameraActivity extends ThetaActivity { ...@@ -232,6 +233,7 @@ public class ThetaCameraActivity extends ThetaActivity {
* @param fileId ファイルID * @param fileId ファイルID
*/ */
public void shootTaskFinish(final String fileId) { public void shootTaskFinish(final String fileId) {
Logger.i(TAG,"shootTaskFinish : " + fileId);
handler.post(new Runnable() { handler.post(new Runnable() {
@Override @Override
public void run() { public void run() {
......
...@@ -40,6 +40,7 @@ public class ThetaImageListActivity extends ThetaActivity { ...@@ -40,6 +40,7 @@ public class ThetaImageListActivity extends ThetaActivity {
private boolean isSelected = false; private boolean isSelected = false;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
Logger.i(TAG, "--- onCreate");
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.ac_theta_image_list); setContentView(R.layout.ac_theta_image_list);
mImageListView = findViewById(R.id.lv_theta_image); mImageListView = findViewById(R.id.lv_theta_image);
......
...@@ -40,7 +40,7 @@ public class ThetaImagePreviewActivity extends ThetaActivity { ...@@ -40,7 +40,7 @@ public class ThetaImagePreviewActivity extends ThetaActivity {
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
Logger.d(TAG, "onCreate"); Logger.i(TAG, "onCreate");
setContentView(R.layout.ac_theta_image_preview); setContentView(R.layout.ac_theta_image_preview);
isSavedSuccess = false; isSavedSuccess = false;
// 戻るボタン // 戻るボタン
......
...@@ -35,7 +35,7 @@ public class ActionZoomLayout extends RelativeLayout { ...@@ -35,7 +35,7 @@ public class ActionZoomLayout extends RelativeLayout {
@Override @Override
protected void dispatchDraw(Canvas canvas) { protected void dispatchDraw(Canvas canvas) {
canvas.save(Canvas.ALL_SAVE_FLAG); canvas.save();
canvas.concat(imgMatrix); canvas.concat(imgMatrix);
super.dispatchDraw(canvas); super.dispatchDraw(canvas);
canvas.restore(); canvas.restore();
......
...@@ -179,7 +179,7 @@ public class ZoomRelativeLayout extends RelativeLayout { ...@@ -179,7 +179,7 @@ public class ZoomRelativeLayout extends RelativeLayout {
@Override @Override
protected void dispatchDraw(Canvas canvas) { protected void dispatchDraw(Canvas canvas) {
canvas.save(Canvas.ALL_SAVE_FLAG); canvas.save();
if (!isOperationPdf) { if (!isOperationPdf) {
canvas.concat(imgMatrix); canvas.concat(imgMatrix);
} }
......
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