OSDN Git Service

APIレベルを30に引き上げる。その2
authorMRSa <mrsa@myad.jp>
Sun, 29 Nov 2020 04:03:54 +0000 (13:03 +0900)
committerMRSa <mrsa@myad.jp>
Sun, 29 Nov 2020 04:03:54 +0000 (13:03 +0900)
47 files changed:
.idea/caches/build_file_checksums.ser [new file with mode: 0644]
.idea/caches/gradle_models.ser [new file with mode: 0644]
.idea/codeStyles/Project.xml [new file with mode: 0644]
.idea/compiler.xml
.idea/gradle.xml
.idea/jarRepositories.xml [new file with mode: 0644]
.idea/misc.xml
.idea/modules.xml
.idea/render.experimental.xml [new file with mode: 0644]
app/build.gradle
build.gradle
gradle.properties
gradle/wrapper/gradle-wrapper.properties
wear/build.gradle
wear/src/main/AndroidManifest.xml
wear/src/main/java/jp/sfjp/gokigen/a01c/ICameraConnection.java [moved from wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/IOlyCameraConnection.java with 55% similarity]
wear/src/main/java/jp/sfjp/gokigen/a01c/MainActivity.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/CameraLiveImageView.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea1.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea2.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea3.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedArea4.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedButton1.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedButton2.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedButton3.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedButton4.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedButton5.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedButton6.java
wear/src/main/java/jp/sfjp/gokigen/a01c/liveview/button/PushedLowerArea.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/IOlyCameraCoordinator.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/OlyCameraConnection.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/OlyCameraCoordinator.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/property/LoadSaveCameraProperties.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/property/favorite/LoadMyCameraPropertyFragment.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/property/favorite/LoadSaveMyCameraPropertyDialog.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/property/favorite/LoadSaveMyCameraPropertyPagerAdapter.java
wear/src/main/java/jp/sfjp/gokigen/a01c/olycamerawrapper/property/favorite/SaveMyCameraPropertyFragment.java
wear/src/main/res/layout-notround/dialog_my_camera_properties.xml
wear/src/main/res/layout-round/activity_main.xml
wear/src/main/res/layout-round/dialog_my_camera_properties.xml
wear/src/main/res/values-ja/arrays.xml [new file with mode: 0644]
wear/src/main/res/values-round-xhdpi/dimens.xml [new file with mode: 0644]
wear/src/main/res/values-round/dimens.xml [new file with mode: 0644]
wear/src/main/res/values/arrays.xml [new file with mode: 0644]
wear/src/main/res/values/colors.xml [new file with mode: 0644]
wear/src/main/res/values/dimens.xml [new file with mode: 0644]
wear/src/main/res/values/styles.xml [new file with mode: 0644]

diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser
new file mode 100644 (file)
index 0000000..627f5b7
Binary files /dev/null and b/.idea/caches/build_file_checksums.ser differ
diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser
new file mode 100644 (file)
index 0000000..e11b3fa
Binary files /dev/null and b/.idea/caches/gradle_models.ser differ
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644 (file)
index 0000000..30aa626
--- /dev/null
@@ -0,0 +1,29 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <Objective-C-extensions>
+      <file>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
+      </file>
+      <class>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
+      </class>
+      <extensions>
+        <pair source="cpp" header="h" fileNamingConvention="NONE" />
+        <pair source="c" header="h" fileNamingConvention="NONE" />
+      </extensions>
+    </Objective-C-extensions>
+  </code_scheme>
+</component>
\ No newline at end of file
index 96cc43e..61a9130 100644 (file)
@@ -1,22 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="CompilerConfiguration">
-    <resourceExtensions />
-    <wildcardResourcePatterns>
-      <entry name="!?*.java" />
-      <entry name="!?*.form" />
-      <entry name="!?*.class" />
-      <entry name="!?*.groovy" />
-      <entry name="!?*.scala" />
-      <entry name="!?*.flex" />
-      <entry name="!?*.kt" />
-      <entry name="!?*.clj" />
-      <entry name="!?*.aj" />
-    </wildcardResourcePatterns>
-    <annotationProcessing>
-      <profile default="true" name="Default" enabled="false">
-        <processorPath useClasspath="true" />
-      </profile>
-    </annotationProcessing>
+    <bytecodeTargetLevel target="1.8" />
   </component>
 </project>
\ No newline at end of file
index f667599..0239736 100644 (file)
@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
+        <option name="testRunner" value="PLATFORM" />
         <option name="distributionType" value="LOCAL" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
         <option name="gradleHome" value="C:\APL\Android\Android Studio\gradle\gradle-2.14.1" />
@@ -14,6 +16,7 @@
           </set>
         </option>
         <option name="resolveModulePerSourceSet" value="false" />
+        <option name="useQualifiedModuleNames" value="true" />
       </GradleProjectSettings>
     </option>
   </component>
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644 (file)
index 0000000..028b0dc
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google" />
+      <option name="name" value="Google" />
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="C:\APL\Android\sdk\extras\m2repository" />
+      <option name="name" value="C:\APL\Android\sdk\extras\m2repository" />
+      <option name="url" value="file:/$PROJECT_DIR$/../../../../APL/Android/sdk/extras/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="C:\APL\Android\sdk\extras\android\m2repository" />
+      <option name="name" value="C:\APL\Android\sdk\extras\android\m2repository" />
+      <option name="url" value="file:/$PROJECT_DIR$/../../../../APL/Android/sdk/extras/android/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="C:\APL\Android\sdk\extras\google\m2repository" />
+      <option name="name" value="C:\APL\Android\sdk\extras\google\m2repository" />
+      <option name="url" value="file:/$PROJECT_DIR$/../../../../APL/Android/sdk/extras/google/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="https://maven.google.com" />
+    </remote-repository>
+  </component>
+</project>
\ No newline at end of file
index ba7052b..9e762bb 100644 (file)
@@ -5,26 +5,37 @@
     <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
     <option name="myNullables">
       <value>
-        <list size="4">
+        <list size="10">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+          <item index="4" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
+          <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
+          <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
+          <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
         </list>
       </value>
     </option>
     <option name="myNotNulls">
       <value>
-        <list size="4">
+        <list size="9">
           <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
           <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
           <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
           <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
+          <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
+          <item index="6" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
+          <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
         </list>
       </value>
     </option>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">
index 9638333..77ef43e 100644 (file)
@@ -3,8 +3,8 @@
   <component name="ProjectModuleManager">
     <modules>
       <module fileurl="file://$PROJECT_DIR$/A01c.iml" filepath="$PROJECT_DIR$/A01c.iml" />
-      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
-      <module fileurl="file://$PROJECT_DIR$/wear/wear.iml" filepath="$PROJECT_DIR$/wear/wear.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/modules/app/A01c.app.iml" filepath="$PROJECT_DIR$/.idea/modules/app/A01c.app.iml" />
+      <module fileurl="file://$PROJECT_DIR$/.idea/modules/wear/A01c.wear.iml" filepath="$PROJECT_DIR$/.idea/modules/wear/A01c.wear.iml" />
     </modules>
   </component>
 </project>
\ No newline at end of file
diff --git a/.idea/render.experimental.xml b/.idea/render.experimental.xml
new file mode 100644 (file)
index 0000000..8ec256a
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RenderSettings">
+    <option name="showDecorations" value="true" />
+  </component>
+</project>
\ No newline at end of file
index 33392e2..1872263 100644 (file)
@@ -1,14 +1,14 @@
 apply plugin: 'com.android.application'
 
 android {
-    compileSdkVersion 27
-    buildToolsVersion "27.0.3"
+    compileSdkVersion 30
+    //buildToolsVersion "30.0.3"
     defaultConfig {
         applicationId "jp.sfjp.gokigen.a01c"
         minSdkVersion 14
-        targetSdkVersion 27
-        versionCode 33
-        versionName "1.3.1"
+        targetSdkVersion 30
+        versionCode 35
+        versionName "1.3.2"
     }
     buildTypes {
         release {
@@ -32,15 +32,19 @@ android {
 dependencies {
     api fileTree(dir: 'libs', include: ['*.jar'])
     wearApp project(path: ':wear')
-    compileOnly 'com.google.android.wearable:wearable:2.3.0'
-    api 'com.google.android.support:wearable:2.3.0'
-    api 'com.google.android.gms:play-services-wearable:15.0.1'
 
-    api 'com.android.support:animated-vector-drawable:27.1.1'
-    api 'com.android.support:percent:27.1.1'
-    api 'com.android.support:support-vector-drawable:27.1.1'
-    api 'com.android.support:appcompat-v7:27.1.1'
-    api 'com.android.support:preference-v7:27.1.1'
-    api 'com.android.support:exifinterface:27.1.1'
-    api 'com.android.support:support-v4:27.1.1'
+    compileOnly 'com.google.android.wearable:wearable:2.8.1'
+
+    implementation 'com.google.android.support:wearable:2.8.1'
+    implementation 'com.google.android.gms:play-services-wearable:17.0.0'
+    implementation 'com.android.support:wear:30.0.0'
+
+    implementation 'androidx.wear:wear:1.1.0'
+    implementation 'androidx.preference:preference-ktx:1.1.1'
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'androidx.exifinterface:exifinterface:1.3.1'
+    implementation 'com.google.android.material:material:1.2.1'
+    implementation "androidx.core:core-ktx:1.3.2"
+    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+
 }
index 44bac8f..d54177e 100644 (file)
@@ -1,12 +1,13 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
-
 buildscript {
+    ext.kotlin_version = "1.4.20"
     repositories {
-        jcenter()
         google()
+        jcenter()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.1.2'
+        classpath 'com.android.tools.build:gradle:4.1.1'
+        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
@@ -15,8 +16,11 @@ buildscript {
 
 allprojects {
     repositories {
-        jcenter()
         google()
+        jcenter()
+        maven {
+            url "https://maven.google.com"
+        }
     }
 }
 
index aac7c9b..a13bff3 100644 (file)
@@ -15,3 +15,11 @@ org.gradle.jvmargs=-Xmx1536m
 # This option should only be used with decoupled projects. More details, visit
 # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 # org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
+# Kotlin code style for this project: "official" or "obsolete":
+kotlin.code.style=official
index 1a81a5f..44f46e2 100644 (file)
@@ -1,6 +1,6 @@
-#Sun Jun 03 16:59:12 JST 2018
+#Sat Nov 28 22:21:59 JST 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
index a6c760c..b9da5c5 100644 (file)
@@ -1,14 +1,15 @@
 apply plugin: 'com.android.application'
+apply plugin: 'kotlin-android'
 
 android {
-    compileSdkVersion 27
-    buildToolsVersion "27.0.3"
+    compileSdkVersion 30
+    //buildToolsVersion "30.0.3"
     defaultConfig {
         applicationId "jp.sfjp.gokigen.a01c"
         minSdkVersion 23
-        targetSdkVersion 27
-        versionCode 34
-        versionName "1.3.1"
+        targetSdkVersion 30
+        versionCode 36
+        versionName "1.3.2"
     }
     buildTypes {
         release {
@@ -21,17 +22,19 @@ android {
 dependencies {
     api fileTree(include: ['*.jar'], dir: 'libs')
 
-    compileOnly 'com.google.android.wearable:wearable:2.3.0'
-    api 'com.google.android.support:wearable:2.3.0'
-    api 'com.google.android.gms:play-services-wearable:15.0.1'
+    compileOnly 'com.google.android.wearable:wearable:2.8.1'
+
+    implementation 'com.google.android.support:wearable:2.8.1'
+    implementation 'com.google.android.gms:play-services-wearable:17.0.0'
+    implementation 'com.android.support:wear:30.0.0'
+
+    implementation 'androidx.wear:wear:1.1.0'
+    implementation 'androidx.preference:preference-ktx:1.1.1'
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'androidx.exifinterface:exifinterface:1.3.1'
+    implementation 'com.google.android.material:material:1.2.1'
+    implementation "androidx.core:core-ktx:1.3.2"
+    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
 
-    //compile 'com.android.support:wear:26.0.0'
-    api 'com.android.support:animated-vector-drawable:27.1.1'
-    api 'com.android.support:percent:27.1.1'
-    api 'com.android.support:support-vector-drawable:27.1.1'
-    api 'com.android.support:appcompat-v7:27.1.1'
-    api 'com.android.support:preference-v7:27.1.1'
-    api 'com.android.support:exifinterface:27.1.1'
-    api 'com.android.support:support-v4:27.1.1'
     api files('libs/olycamerakit.jar')
 }
index 38b15cd..4a87c8c 100644 (file)
@@ -18,7 +18,8 @@
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:supportsRtl="true"
-        android:theme="@android:style/Theme.DeviceDefault">
+        android:theme="@style/AppTheme">
+        <!--android:theme="@android:style/Theme.DeviceDefault"-->
         <uses-library android:name="com.google.android.wearable" android:required="false" />
         <meta-data android:name="com.google.android.wearable.standalone" android:value="true" />
         <activity
@@ -1,17 +1,19 @@
-package jp.sfjp.gokigen.a01c.olycamerawrapper;
+package jp.sfjp.gokigen.a01c;
 
 import android.content.Context;
 
+import androidx.annotation.NonNull;
+
 /**
  *   カメラの接続/切断
  *
  * Created by MRSa on 2017/02/28.
  */
-public interface IOlyCameraConnection
+public interface ICameraConnection
 {
     // WIFI 接続系
-    void startWatchWifiStatus(Context context);
-    void stopWatchWifiStatus(Context context);
+    void startWatchWifiStatus(@NonNull Context context);
+    void stopWatchWifiStatus(@NonNull Context context);
     boolean isWatchWifiStatus();
 
     /** カメラ接続系 **/
index d871391..1c1500f 100644 (file)
@@ -3,19 +3,21 @@ package jp.sfjp.gokigen.a01c;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.graphics.Color;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.PowerManager;
 import android.os.Vibrator;
 import android.preference.PreferenceManager;
 import android.provider.Settings;
-import android.support.wearable.activity.WearableActivity;
 import android.util.Log;
 import android.widget.ImageButton;
 import android.widget.TextView;
 import android.Manifest;
 import android.content.pm.PackageManager;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.content.ContextCompat;
+
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.app.ActivityCompat;
+import androidx.core.content.ContextCompat;
 
 import jp.sfjp.gokigen.a01c.liveview.CameraLiveImageView;
 import jp.sfjp.gokigen.a01c.liveview.CameraLiveViewListenerImpl;
@@ -33,7 +35,7 @@ import jp.sfjp.gokigen.a01c.preference.IPreferenceCameraPropertyAccessor;
  *   メインのActivity
  *
  */
-public class MainActivity extends WearableActivity implements  IChangeScene, IShowInformation, ICameraStatusReceiver, IDialogDismissedNotifier
+public class MainActivity extends AppCompatActivity implements  IChangeScene, IShowInformation, ICameraStatusReceiver, IDialogDismissedNotifier
 {
     private final String TAG = toString();
     static final int REQUEST_NEED_PERMISSIONS = 1010;
@@ -47,7 +49,7 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
     private FavoriteSettingSelectionDialog selectionDialog = null;
     private Vibrator vibrator = null;
     private boolean cameraDisconnectedHappened = false;
-    private boolean ambientMode = false;
+    //private boolean ambientMode = false;
 
     /**
      *
@@ -59,7 +61,7 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
         Log.v(TAG, "onCreate()");
 
         // Ambientモードを許してみる...
-        setAmbientEnabled();
+        //setAmbientEnabled();
 
         //  画面全体の設定
         setContentView(R.layout.activity_main);
@@ -87,23 +89,30 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
                     REQUEST_NEED_PERMISSIONS);
         }
 
-        if (!hasGps())
+        try
         {
-            // GPS機能が搭載されていない場合...
-            Log.d(TAG, "This hardware doesn't have GPS.");
-            // Fall back to functionality that does not use location or
-            // warn the user that location function is not available.
-        }
+            if (!hasGps())
+            {
+                // GPS機能が搭載されていない場合...
+                Log.d(TAG, "This hardware doesn't have GPS.");
+                // Fall back to functionality that does not use location or
+                // warn the user that location function is not available.
+            }
 
-        // バイブレータをつかまえる
-        vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
+            // バイブレータをつかまえる
+            vibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
 
-        // パワーマネージャをつかまえる
-        powerManager = (PowerManager) getSystemService(POWER_SERVICE);
+            // パワーマネージャをつかまえる
+            powerManager = (PowerManager) getSystemService(POWER_SERVICE);
 
-        setupCameraCoordinator();
-        setupInitialButtonIcons();
-        setupActionListener();
+            setupCameraCoordinator();
+            setupInitialButtonIcons();
+            setupActionListener();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
     }
 
     /**
@@ -149,10 +158,7 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
         exitApplication();
     }
 
-    /**
-     *
-     *
-     */
+/*
      @Override
      public void onEnterAmbient(Bundle ambientDetails)
      {
@@ -161,10 +167,6 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
          ambientMode =true;
      }
 
-    /**
-     *
-     *
-     */
     @Override
     public void onExitAmbient()
     {
@@ -173,16 +175,13 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
         ambientMode = false;
     }
 
-    /**
-     *
-     *
-     */
     @Override
     public void onUpdateAmbient()
     {
         super.onUpdateAmbient();
         Log.v(TAG, "onUpdateAmbient()");
     }
+*/
 
     /**
      *   ボタンが押された、画面がタッチされた、、は、リスナクラスで処理するよう紐づける
@@ -190,53 +189,60 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
      */
     private void setupActionListener()
     {
-        final ImageButton btn1 = findViewById(R.id.btn_1);
-        btn1.setOnClickListener(listener);
-        btn1.setOnLongClickListener(listener);
+        try
+        {
+            final ImageButton btn1 = findViewById(R.id.btn_1);
+            btn1.setOnClickListener(listener);
+            btn1.setOnLongClickListener(listener);
 
-        final ImageButton btn2 = findViewById(R.id.btn_2);
-        btn2.setOnClickListener(listener);
-        btn2.setOnLongClickListener(listener);
+            final ImageButton btn2 = findViewById(R.id.btn_2);
+            btn2.setOnClickListener(listener);
+            btn2.setOnLongClickListener(listener);
 
-        final ImageButton btn3 = findViewById(R.id.btn_3);
-        btn3.setOnClickListener(listener);
-        btn3.setOnLongClickListener(listener);
+            final ImageButton btn3 = findViewById(R.id.btn_3);
+            btn3.setOnClickListener(listener);
+            btn3.setOnLongClickListener(listener);
 
-        final ImageButton btn4 = findViewById(R.id.btn_4);
-        btn4.setOnClickListener(listener);
-        btn4.setOnLongClickListener(listener);
+            final ImageButton btn4 = findViewById(R.id.btn_4);
+            btn4.setOnClickListener(listener);
+            btn4.setOnLongClickListener(listener);
 
-        final ImageButton btn5 = findViewById(R.id.btn_5);
-        btn5.setOnClickListener(listener);
-        btn5.setOnLongClickListener(listener);
+            final ImageButton btn5 = findViewById(R.id.btn_5);
+            btn5.setOnClickListener(listener);
+            btn5.setOnLongClickListener(listener);
 
-        final ImageButton btn6 = findViewById(R.id.btn_6);
-        btn6.setOnClickListener(listener);
-        btn6.setOnLongClickListener(listener);
+            final ImageButton btn6 = findViewById(R.id.btn_6);
+            btn6.setOnClickListener(listener);
+            btn6.setOnLongClickListener(listener);
 
-        final TextView textArea1 = findViewById(R.id.text_1);
-        textArea1.setOnClickListener(listener);
-        textArea1.setOnLongClickListener(listener);
+            final TextView textArea1 = findViewById(R.id.text_1);
+            textArea1.setOnClickListener(listener);
+            textArea1.setOnLongClickListener(listener);
 
-        final TextView textArea2 = findViewById(R.id.text_2);
-        textArea2.setOnClickListener(listener);
-        textArea2.setOnLongClickListener(listener);
+            final TextView textArea2 = findViewById(R.id.text_2);
+            textArea2.setOnClickListener(listener);
+            textArea2.setOnLongClickListener(listener);
 
-        final TextView textArea3 = findViewById(R.id.text_3);
-        textArea3.setOnClickListener(listener);
-        textArea3.setOnLongClickListener(listener);
+            final TextView textArea3 = findViewById(R.id.text_3);
+            textArea3.setOnClickListener(listener);
+            textArea3.setOnLongClickListener(listener);
 
-        final TextView textArea4 = findViewById(R.id.text_4);
-        textArea4.setOnClickListener(listener);
-        textArea4.setOnLongClickListener(listener);
+            final TextView textArea4 = findViewById(R.id.text_4);
+            textArea4.setOnClickListener(listener);
+            textArea4.setOnLongClickListener(listener);
 
-        if (liveView == null)
+            if (liveView == null)
+            {
+                liveView = findViewById(R.id.liveview);
+            }
+            liveView.setOnTouchListener(listener);
+            messageDrawer = liveView.getMessageDrawer();
+            messageDrawer.setLevelGauge(coordinator.getLevelGauge());
+        }
+        catch (Exception e)
         {
-            liveView = findViewById(R.id.liveview);
+            e.printStackTrace();
         }
-        liveView.setOnTouchListener(listener);
-        messageDrawer = liveView.getMessageDrawer();
-        messageDrawer.setLevelGauge(coordinator.getLevelGauge());
     }
 
     /**
@@ -245,21 +251,25 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
      */
     private void setupInitialButtonIcons()
     {
-        if (coordinator != null)
+        try
         {
-            int resId;
-            SharedPreferences preferences = android.support.v7.preference.PreferenceManager.getDefaultSharedPreferences(this);
-            if (preferences.getBoolean(IPreferenceCameraPropertyAccessor.SHOW_GRID_STATUS, true))
+            if (coordinator != null)
             {
-                // ボタンをGrid OFFアイコンにする
-                resId = R.drawable.btn_ic_grid_off;
-            }
-            else
-            {
-                // ボタンをGrid ONアイコンにする
-                resId = R.drawable.btn_ic_grid_on;
+                int resId;
+                SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
+                if (preferences.getBoolean(IPreferenceCameraPropertyAccessor.SHOW_GRID_STATUS, true)) {
+                    // ボタンをGrid OFFアイコンにする
+                    resId = R.drawable.btn_ic_grid_off;
+                } else {
+                    // ボタンをGrid ONアイコンにする
+                    resId = R.drawable.btn_ic_grid_on;
+                }
+                setButtonDrawable(IShowInformation.BUTTON_1, resId);
             }
-            setButtonDrawable(IShowInformation.BUTTON_1, resId);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
         }
     }
 
@@ -330,16 +340,22 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
      */
     private void setupCameraCoordinator()
     {
-        if (liveView == null)
+        try
+        {
+            if (liveView == null) {
+                liveView = findViewById(R.id.liveview);
+            }
+            coordinator = null;
+            coordinator = new OlyCameraCoordinator(this, liveView, this, this);
+            coordinator.setLiveViewListener(new CameraLiveViewListenerImpl(liveView));
+            listener = new OlyCameraLiveViewOnTouchListener(this, new FeatureDispatcher(this, coordinator, liveView), this);
+            selectionDialog = new FavoriteSettingSelectionDialog(this, coordinator.getCameraPropertyLoadSaveOperations(), this);
+            connectToCamera();
+        }
+        catch (Exception e)
         {
-            liveView = findViewById(R.id.liveview);
+            e.printStackTrace();
         }
-        coordinator = null;
-        coordinator = new OlyCameraCoordinator(this, liveView, this, this);
-        coordinator.setLiveViewListener(new CameraLiveViewListenerImpl(liveView));
-        listener = new OlyCameraLiveViewOnTouchListener(this, new FeatureDispatcher(this, coordinator, liveView), this);
-        selectionDialog = new FavoriteSettingSelectionDialog(this, coordinator.getCameraPropertyLoadSaveOperations(), this);
-        connectToCamera();
     }
 
     /**
@@ -373,36 +389,45 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
     @Override
     public void exitApplication()
     {
-        Log.v(TAG, "exitApplication()");
-        if (ambientMode)
+        try
         {
-            // アンビエントモードの時(≒自分でアプリを終了しなかったとき)は、何もしない
-            // (接続したままとする)
-            Log.v(TAG, "keep liveview.");
-            return;
-        }
+            Log.v(TAG, "exitApplication()");
+/*
+            if (ambientMode)
+            {
+                // アンビエントモードの時(≒自分でアプリを終了しなかったとき)は、何もしない
+                // (接続したままとする)
+                Log.v(TAG, "keep liveview.");
+                return;
+            }
+*/
 
-        // パワーマネージャを確認し、interactive modeではない場合は、ライブビューも止めず、カメラの電源も切らない
-        if ((powerManager != null)&&(!powerManager.isInteractive()))
-        {
-            Log.v(TAG, "not interactive, keep liveview.");
-            return;
-        }
+            // パワーマネージャを確認し、interactive modeではない場合は、ライブビューも止めず、カメラの電源も切らない
+            if ((powerManager != null) && (!powerManager.isInteractive()))
+            {
+                Log.v(TAG, "not interactive, keep liveview.");
+                return;
+            }
 
-        // ライブビューを停止させる
-        coordinator.stopLiveView();
+            // ライブビューを停止させる
+            coordinator.stopLiveView();
 
-        //  パラメータを確認し、カメラの電源を切る
-        if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(IPreferenceCameraPropertyAccessor.EXIT_APPLICATION_WITH_DISCONNECT, true))
-        {
-            Log.v(TAG, "Shutdown camera...");
+            //  パラメータを確認し、カメラの電源を切る
+            if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(IPreferenceCameraPropertyAccessor.EXIT_APPLICATION_WITH_DISCONNECT, true))
+            {
+                Log.v(TAG, "Shutdown camera...");
 
-            // カメラの電源をOFFにする
-            coordinator.getConnectionInterface().disconnect(true);
+                // カメラの電源をOFFにする
+                coordinator.getConnectionInterface().disconnect(true);
+            }
+            //finish();
+            //finishAndRemoveTask();
+            //android.os.Process.killProcess(android.os.Process.myPid());
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
         }
-        //finish();
-        //finishAndRemoveTask();
-        //android.os.Process.killProcess(android.os.Process.myPid());
     }
 
     /**
@@ -440,12 +465,18 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
     @Override
     public boolean showConnectionStatus()
     {
-        if ((listener.isEnabledOperation() == IShowInformation.operation.ONLY_CONNECT)&&(cameraDisconnectedHappened))
+        try
         {
-            // カメラが切断されたとき、再接続を指示する
-            connectToCamera();
-            cameraDisconnectedHappened = false;
-            return (true);
+            if ((listener.isEnabledOperation() == IShowInformation.operation.ONLY_CONNECT) && (cameraDisconnectedHappened)) {
+                // カメラが切断されたとき、再接続を指示する
+                connectToCamera();
+                cameraDisconnectedHappened = false;
+                return (true);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
         }
         return (false);
     }
@@ -466,13 +497,19 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
     public void onCameraConnected()
     {
         Log.v(TAG, "onCameraConnected()");
-
-        // ライブビューの開始 & タッチ/ボタンの操作を可能にする
-        coordinator.startLiveView();
-        coordinator.setRecViewMode(false);
-        listener.setEnableOperation(operation.ENABLE);
-        setMessage(IShowInformation.AREA_C, Color.WHITE, "");
-        coordinator.updateStatusAll();
+        try
+        {
+            // ライブビューの開始 & タッチ/ボタンの操作を可能にする
+            coordinator.startLiveView();
+            coordinator.setRecViewMode(false);
+            listener.setEnableOperation(operation.ENABLE);
+            setMessage(IShowInformation.AREA_C, Color.WHITE, "");
+            coordinator.updateStatusAll();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
     }
 
     /**
@@ -483,9 +520,16 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
     public void onCameraDisconnected()
     {
         Log.v(TAG, "onCameraDisconnected()");
-        setMessage(IShowInformation.AREA_C, Color.YELLOW, getString(R.string.camera_disconnected));
-        listener.setEnableOperation(operation.ONLY_CONNECT);
-        cameraDisconnectedHappened = true;
+        try
+        {
+            setMessage(IShowInformation.AREA_C, Color.YELLOW, getString(R.string.camera_disconnected));
+            listener.setEnableOperation(operation.ONLY_CONNECT);
+            cameraDisconnectedHappened = true;
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
     }
 
     /**
@@ -495,9 +539,17 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
     public void onCameraOccursException(String message, Exception e)
     {
         Log.v(TAG, "onCameraOccursException()");
-        setMessage(IShowInformation.AREA_C, Color.YELLOW, message);
-        listener.setEnableOperation(operation.ONLY_CONNECT);
-        cameraDisconnectedHappened = true;
+        try
+        {
+            setMessage(IShowInformation.AREA_C, Color.YELLOW, message);
+            listener.setEnableOperation(operation.ONLY_CONNECT);
+            cameraDisconnectedHappened = true;
+        }
+        catch (Exception ee)
+        {
+            e.printStackTrace();
+            ee.printStackTrace();
+        }
     }
 
     /**s
@@ -641,11 +693,19 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
             @Override
             public void run()
             {
-                final ImageButton button = findViewById(areaId);
-                if (button != null)
+                try
                 {
-                    button.setImageDrawable(getDrawable(labelId));
-                    button.invalidate();
+                    final ImageButton button = findViewById(areaId);
+                    final Drawable drawTarget = ContextCompat.getDrawable(getApplicationContext(), labelId);
+                    if (button != null)
+                    {
+                        button.setImageDrawable(drawTarget);
+                        button.invalidate();
+                    }
+                }
+                catch (Exception e)
+                {
+                    e.printStackTrace();
                 }
             }
         });
@@ -740,11 +800,18 @@ public class MainActivity extends WearableActivity implements  IChangeScene, ISh
     @Override
     public void dialogDismissed(boolean isExecuted)
     {
-        if ((liveView != null)&&(listener != null))
+        try
         {
-            liveView.hideDialog();
-            listener.setEnableOperation(operation.ENABLE);
+            if ((liveView != null) && (listener != null))
+            {
+                liveView.hideDialog();
+                listener.setEnableOperation(operation.ENABLE);
 
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
         }
     }
 }
index b6fc648..71ab3dc 100644 (file)
@@ -10,7 +10,7 @@ import android.graphics.Paint;
 import android.graphics.PointF;
 import android.graphics.Rect;
 import android.graphics.RectF;
-import android.media.ExifInterface;
+import androidx.exifinterface.media.ExifInterface;
 import android.os.Looper;
 import android.preference.PreferenceManager;
 import android.util.AttributeSet;
@@ -240,9 +240,16 @@ public class CameraLiveImageView extends View implements CameraLiveViewListenerI
 
             // Acquire a rotation degree of image.
             int orientation = ExifInterface.ORIENTATION_UNDEFINED;
-            if (metadata.containsKey(EXIF_ORIENTATION))
+            try
             {
-                orientation = Integer.parseInt((String) metadata.get(EXIF_ORIENTATION));
+                if (metadata.containsKey(EXIF_ORIENTATION))
+                {
+                    orientation = Integer.parseInt((String) metadata.get(EXIF_ORIENTATION));
+                }
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
             }
             switch (orientation)
             {
@@ -946,7 +953,7 @@ public class CameraLiveImageView extends View implements CameraLiveViewListenerI
     public void setShowGridFrame(boolean isShowGridFeature)
     {
         showGridFeature = isShowGridFeature;
-        SharedPreferences preferences = android.support.v7.preference.PreferenceManager.getDefaultSharedPreferences(getContext());
+        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
         SharedPreferences.Editor editor = preferences.edit();
         editor.putBoolean(IPreferenceCameraPropertyAccessor.SHOW_GRID_STATUS, showGridFeature);
         editor.apply();
@@ -970,7 +977,7 @@ public class CameraLiveImageView extends View implements CameraLiveViewListenerI
     {
         Log.v(TAG, "setShowLevelGauge : " + isShowLevelGaugeFeature);
         showLevelGaugeFeature = isShowLevelGaugeFeature;
-        SharedPreferences preferences = android.support.v7.preference.PreferenceManager.getDefaultSharedPreferences(getContext());
+        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
         SharedPreferences.Editor editor = preferences.edit();
         editor.putBoolean(IPreferenceCameraPropertyAccessor.SHOW_LEVEL_GAUGE_STATUS, showLevelGaugeFeature);
         editor.apply();
index 38f00ad..718c69e 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index 4b46e7f..1c0fa45 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index 4677370..db7863f 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index baf0529..6636e2f 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index 42d9fad..bb0a0f5 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index b769a0f..ffd323c 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index 2639104..3ac5c6d 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index 0c7534a..0c5c9d9 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index 4a83aaa..0a875b2 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index a636b8d..6aacc1b 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index d65376c..65d3fbb 100644 (file)
@@ -2,7 +2,8 @@ package jp.sfjp.gokigen.a01c.liveview.button;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.support.v7.preference.PreferenceManager;
+
+import androidx.preference.PreferenceManager;
 
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.dispatcher.ICameraFeatureDispatcher;
index 88e4138..3a139fa 100644 (file)
@@ -4,6 +4,7 @@ import android.view.MotionEvent;
 
 import jp.co.olympus.camerakit.OLYCameraLiveViewListener;
 import jp.co.olympus.camerakit.OLYCameraStatusListener;
+import jp.sfjp.gokigen.a01c.ICameraConnection;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.property.ILoadSaveCameraProperties;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.property.IOlyCameraPropertyProvider;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.property.ICameraPropertyLoadSaveOperations;
@@ -73,7 +74,7 @@ public interface IOlyCameraCoordinator
     // カメラの動作モード変更インタフェース
     ICameraRunMode getChangeRunModeExecutor();
 
-    IOlyCameraConnection getConnectionInterface();
+    ICameraConnection getConnectionInterface();
 
     /** ズームレンズの状態ホルダを応答 **/
     IZoomLensHolder getZoomLensHolder();
index a101e9c..9daeffa 100644 (file)
@@ -15,6 +15,8 @@ import android.os.Handler;
 import android.os.Message;
 import android.util.Log;
 
+import androidx.annotation.NonNull;
+
 import java.util.concurrent.Executor;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
@@ -22,6 +24,7 @@ import java.util.concurrent.TimeUnit;
 import jp.co.olympus.camerakit.OLYCamera;
 import jp.co.olympus.camerakit.OLYCameraConnectionListener;
 import jp.co.olympus.camerakit.OLYCameraKitException;
+import jp.sfjp.gokigen.a01c.ICameraConnection;
 import jp.sfjp.gokigen.a01c.R;
 import jp.sfjp.gokigen.a01c.liveview.ICameraStatusReceiver;
 
@@ -32,7 +35,7 @@ import jp.sfjp.gokigen.a01c.liveview.ICameraStatusReceiver;
  *
  * Created by MRSa on 2017/02/28.
  */
-class OlyCameraConnection implements IOlyCameraConnection, OLYCameraConnectionListener
+class OlyCameraConnection implements ICameraConnection, OLYCameraConnectionListener
 {
     private final String TAG = toString();
     private final Activity context;
@@ -43,11 +46,11 @@ class OlyCameraConnection implements IOlyCameraConnection, OLYCameraConnectionLi
 
     private boolean isWatchingWifiStatus = false;
 
-    private ConnectivityManager connectivityManager;
+    private final ConnectivityManager connectivityManager;
     private ConnectivityManager.NetworkCallback networkCallback = null;
 
     // Handler for dealing with network connection timeouts.
-    private Handler networkConnectionTimeoutHandler;
+    private final Handler networkConnectionTimeoutHandler;
 
 
     // Message to notify the network request timout handler that too much time has passed.
@@ -196,7 +199,7 @@ class OlyCameraConnection implements IOlyCameraConnection, OLYCameraConnectionLi
      * (接続の実処理は onReceiveBroadcastOfConnection() で実施)
      */
     @Override
-    public void startWatchWifiStatus(Context context)
+    public void startWatchWifiStatus(@NonNull Context context)
     {
         Log.v(TAG, "startWatchWifiStatus()");
         statusReceiver.onStatusNotify("prepare");
@@ -212,7 +215,7 @@ class OlyCameraConnection implements IOlyCameraConnection, OLYCameraConnectionLi
      * Wifi接続状態の監視終了
      */
     @Override
-    public void stopWatchWifiStatus(Context context)
+    public void stopWatchWifiStatus(@NonNull Context context)
     {
         Log.v(TAG, "stopWatchWifiStatus()");
         context.unregisterReceiver(connectionReceiver);
index bfe9f8e..bfce1a0 100644 (file)
@@ -7,10 +7,13 @@ import android.util.Log;
 import android.view.MotionEvent;
 import android.widget.Toast;
 
+import androidx.preference.PreferenceManager;
+
 import jp.co.olympus.camerakit.OLYCamera;
 import jp.co.olympus.camerakit.OLYCameraLiveViewListener;
 import jp.co.olympus.camerakit.OLYCameraStatusListener;
 
+import jp.sfjp.gokigen.a01c.ICameraConnection;
 import jp.sfjp.gokigen.a01c.IShowInformation;
 import jp.sfjp.gokigen.a01c.R;
 import jp.sfjp.gokigen.a01c.liveview.IAutoFocusFrameDisplay;
@@ -92,7 +95,7 @@ public class OlyCameraCoordinator implements IOlyCameraCoordinator, IIndicatorCo
         bracketingShot = new BracketingShotControl(camera, focusFrameDisplay, this, showInformation);  // ブラケッティング&インターバル撮影
         propertyProxy = new OlyCameraPropertyProxy(camera); // カメラプロパティ
         cameraStatusDisplay = new CameraStatusDisplay(propertyProxy, showInformation);  // 画面表示
-        this.levelMeter = new LevelMeterHolder(showInformation, android.support.v7.preference.PreferenceManager.getDefaultSharedPreferences(context).getBoolean(IPreferenceCameraPropertyAccessor.SHOW_LEVEL_GAUGE_STATUS, false));  // デジタル水準器
+        this.levelMeter = new LevelMeterHolder(showInformation, PreferenceManager.getDefaultSharedPreferences(context).getBoolean(IPreferenceCameraPropertyAccessor.SHOW_LEVEL_GAUGE_STATUS, false));  // デジタル水準器
         camera.setCameraStatusListener(new CameraStatusListenerImpl(context, cameraStatusDisplay, levelMeter));
         camera.setCameraPropertyListener(new CameraPropertyListenerImpl(cameraStatusDisplay));
         camera.setRecordingListener(new CameraRecordingListenerImpl(context, showInformation));
@@ -468,7 +471,7 @@ public class OlyCameraCoordinator implements IOlyCameraCoordinator, IIndicatorCo
     }
 
     @Override
-    public IOlyCameraConnection getConnectionInterface()
+    public ICameraConnection getConnectionInterface()
     {
         return (cameraConnection);
     }
index d01027a..f12f253 100644 (file)
@@ -2,12 +2,12 @@ package jp.sfjp.gokigen.a01c.olycamerawrapper.property;
 
 import android.content.Context;
 import android.content.SharedPreferences;
-import android.preference.PreferenceManager;
 import android.util.Log;
 
+import androidx.preference.PreferenceManager;
+
 import java.text.DateFormat;
 import java.util.Date;
-//import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
index 9b73011..9f06594 100644 (file)
@@ -1,8 +1,7 @@
 package jp.sfjp.gokigen.a01c.olycamerawrapper.property.favorite;
+
 import android.content.SharedPreferences;
 import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.support.v4.app.ListFragment;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -10,6 +9,9 @@ import android.view.ViewGroup;
 import android.widget.AdapterView;
 import android.widget.ListView;
 
+import androidx.fragment.app.ListFragment;
+import androidx.preference.PreferenceManager;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
index 41b952c..d514728 100644 (file)
@@ -1,16 +1,17 @@
 package jp.sfjp.gokigen.a01c.olycamerawrapper.property.favorite;
 
 import android.os.Bundle;
-import android.support.v4.app.DialogFragment;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTabHost;
-import android.support.v4.view.ViewPager;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.TabHost;
 
+import androidx.fragment.app.DialogFragment;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentTabHost;
+import androidx.viewpager.widget.ViewPager;
+
 import jp.sfjp.gokigen.a01c.R;
 import jp.sfjp.gokigen.a01c.olycamerawrapper.property.ICameraPropertyLoadSaveOperations;
 
index f4eaca6..8b577c7 100644 (file)
@@ -1,10 +1,12 @@
 package jp.sfjp.gokigen.a01c.olycamerawrapper.property.favorite;
 
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.FragmentPagerAdapter;
+
 import android.util.Log;
 
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+
 class LoadSaveMyCameraPropertyPagerAdapter extends FragmentPagerAdapter
 {
     private final String TAG = toString();
index b05d118..be2af63 100644 (file)
@@ -2,12 +2,14 @@ package jp.sfjp.gokigen.a01c.olycamerawrapper.property.favorite;
 
 import android.content.SharedPreferences;
 import android.os.Bundle;
-import android.preference.PreferenceManager;
-import android.support.v4.app.ListFragment;
+
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 
+import androidx.fragment.app.ListFragment;
+import androidx.preference.PreferenceManager;
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
index c2ac6c7..287e293 100644 (file)
@@ -4,14 +4,13 @@
     android:layout_width="match_parent"
     android:orientation="vertical"
     >
-    <android.support.v4.app.FragmentTabHost
+    <androidx.fragment.app.FragmentTabHost
         xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/tabHost01"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-    </android.support.v4.app.FragmentTabHost>
+        android:layout_height="wrap_content"/>
 
-    <android.support.v4.view.ViewPager
+    <androidx.fragment.app.FragmentTabHost
         android:id="@+id/pager"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
index db32fae..a0746ee 100644 (file)
@@ -1,16 +1,19 @@
 <?xml version="1.0" encoding="utf-8"?>
-<android.support.wearable.view.BoxInsetLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<androidx.wear.widget.BoxInsetLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/box_inset_layout"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/black"
     tools:context="jp.sfjp.gokigen.a01c.MainActivity"
     tools:deviceIds="wear_round">
+
     <FrameLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:padding="1dp"
+        app:layout_boxedEdges="all"
         app:layout_box="all">
 
         <jp.sfjp.gokigen.a01c.liveview.CameraLiveImageView
         </LinearLayout>
     </FrameLayout>
 
-</android.support.wearable.view.BoxInsetLayout>
+</androidx.wear.widget.BoxInsetLayout>
index c2ac6c7..287e293 100644 (file)
@@ -4,14 +4,13 @@
     android:layout_width="match_parent"
     android:orientation="vertical"
     >
-    <android.support.v4.app.FragmentTabHost
+    <androidx.fragment.app.FragmentTabHost
         xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/tabHost01"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-    </android.support.v4.app.FragmentTabHost>
+        android:layout_height="wrap_content"/>
 
-    <android.support.v4.view.ViewPager
+    <androidx.fragment.app.FragmentTabHost
         android:id="@+id/pager"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
diff --git a/wear/src/main/res/values-ja/arrays.xml b/wear/src/main/res/values-ja/arrays.xml
new file mode 100644 (file)
index 0000000..55344e5
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+</resources>
\ No newline at end of file
diff --git a/wear/src/main/res/values-round-xhdpi/dimens.xml b/wear/src/main/res/values-round-xhdpi/dimens.xml
new file mode 100644 (file)
index 0000000..045e125
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+</resources>
diff --git a/wear/src/main/res/values-round/dimens.xml b/wear/src/main/res/values-round/dimens.xml
new file mode 100644 (file)
index 0000000..045e125
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+</resources>
diff --git a/wear/src/main/res/values/arrays.xml b/wear/src/main/res/values/arrays.xml
new file mode 100644 (file)
index 0000000..55344e5
--- /dev/null
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+</resources>
\ No newline at end of file
diff --git a/wear/src/main/res/values/colors.xml b/wear/src/main/res/values/colors.xml
new file mode 100644 (file)
index 0000000..030098f
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="colorPrimary">#6200EE</color>
+    <color name="colorPrimaryDark">#3700B3</color>
+    <color name="colorAccent">#03DAC5</color>
+</resources>
diff --git a/wear/src/main/res/values/dimens.xml b/wear/src/main/res/values/dimens.xml
new file mode 100644 (file)
index 0000000..cbcb635
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!--
+    Because the window insets on round devices are larger than 15dp, this padding only applies
+    to square screens.
+    -->
+    <dimen name="box_inset_layout_padding">0dp</dimen>
+
+    <!--
+    This padding applies to both square and round screens. The total padding between the buttons
+    and the window insets is box_inset_layout_padding (above variable) on square screens and
+    inner_frame_layout_padding (below variable) on round screens.
+    -->
+    <dimen name="inner_frame_layout_padding">0dp</dimen>
+    <dimen name="icon_list_padding">0dp</dimen>
+    <dimen name="header_start_padding">0dp</dimen>
+    <dimen name="header_end_padding">0dp</dimen>
+    <dimen name="header_top_padding">0dp</dimen>
+    <dimen name="header_bottom_padding">0dp</dimen>
+
+    <dimen name="list_start_padding">0dp</dimen>
+    <dimen name="list_end_padding">0dp</dimen>
+    <dimen name="list_top_padding">0dp</dimen>
+    <dimen name="list_bottom_padding">0dp</dimen>
+</resources>
diff --git a/wear/src/main/res/values/styles.xml b/wear/src/main/res/values/styles.xml
new file mode 100644 (file)
index 0000000..8c00790
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- Base application theme. -->
+    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
+        <!-- Customize your theme here. -->
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+    <style name="wear2_dialog_theme" parent="android:Theme.Holo.Dialog" />
+</resources>