OSDN Git Service

Preferenceをいつでも開けるように変更。
authorMRSa <mrsa@myad.jp>
Sun, 31 May 2020 12:32:03 +0000 (21:32 +0900)
committerMRSa <mrsa@myad.jp>
Sun, 31 May 2020 12:32:03 +0000 (21:32 +0900)
36 files changed:
.idea/assetWizardSettings.xml [new file with mode: 0644]
.idea/encodings.xml [new file with mode: 0644]
.idea/gradle.xml [new file with mode: 0644]
.idea/jarRepositories.xml [new file with mode: 0644]
.idea/misc.xml [new file with mode: 0644]
.idea/modules.xml [new file with mode: 0644]
.idea/runConfigurations.xml [new file with mode: 0644]
.idea/vcs.xml [new file with mode: 0644]
app/build.gradle
app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
app/src/main/java/net/osdn/gokigen/a01d/IChangeScene.java
app/src/main/java/net/osdn/gokigen/a01d/preference/IPreferencePropertyAccessor.java
app/src/main/java/net/osdn/gokigen/a01d/preference/canon/CanonPreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/fujix/FujiXPreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/nikon/NikonPreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/olympus/PreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/olympuspen/OlympusPreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/panasonic/PanasonicPreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/ricohgr2/RicohGr2PreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/sony/SonyPreferenceFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/summary/PreferenceFragmentSummary.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/preference/theta/ThetaPreferenceFragment.java
app/src/main/res/values-ja/strings.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preferences.xml
app/src/main/res/xml/preferences_canon.xml
app/src/main/res/xml/preferences_fuji_x.xml
app/src/main/res/xml/preferences_nikon.xml
app/src/main/res/xml/preferences_olympuspen.xml
app/src/main/res/xml/preferences_panasonic.xml
app/src/main/res/xml/preferences_ricoh_gr2.xml
app/src/main/res/xml/preferences_sony.xml
app/src/main/res/xml/preferences_summary.xml [new file with mode: 0644]
app/src/main/res/xml/preferences_theta.xml
build.gradle
gradle/wrapper/gradle-wrapper.properties

diff --git a/.idea/assetWizardSettings.xml b/.idea/assetWizardSettings.xml
new file mode 100644 (file)
index 0000000..f141359
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="WizardSettings">
+    <option name="children">
+      <map>
+        <entry key="imageWizard">
+          <value>
+            <PersistentState />
+          </value>
+        </entry>
+        <entry key="vectorWizard">
+          <value>
+            <PersistentState>
+              <option name="children">
+                <map>
+                  <entry key="vectorAssetStep">
+                    <value>
+                      <PersistentState>
+                        <option name="children">
+                          <map>
+                            <entry key="clipartAsset">
+                              <value>
+                                <PersistentState>
+                                  <option name="values">
+                                    <map>
+                                      <entry key="url" value="jar:file:/C:/APL/Android/Android%20Studio/plugins/android/lib/android.jar!/images/material_design_icons/image/ic_broken_image_black_24dp.xml" />
+                                    </map>
+                                  </option>
+                                </PersistentState>
+                              </value>
+                            </entry>
+                          </map>
+                        </option>
+                        <option name="values">
+                          <map>
+                            <entry key="outputName" value="ic_broken_image_black_24dp" />
+                            <entry key="sourceFile" value="C:\Users\MRSa" />
+                          </map>
+                        </option>
+                      </PersistentState>
+                    </value>
+                  </entry>
+                </map>
+              </option>
+            </PersistentState>
+          </value>
+        </entry>
+      </map>
+    </option>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644 (file)
index 0000000..15a15b2
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" addBOMForNewFiles="with NO BOM" />
+</project>
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644 (file)
index 0000000..674414f
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="delegatedBuild" value="false" />
+        <option name="testRunner" value="PLATFORM" />
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/app" />
+          </set>
+        </option>
+        <option name="resolveModulePerSourceSet" value="false" />
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
new file mode 100644 (file)
index 0000000..f406759
--- /dev/null
@@ -0,0 +1,25 @@
+<?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="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="https://maven.google.com" />
+    </remote-repository>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644 (file)
index 0000000..c852d32
--- /dev/null
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="MarkdownProjectSettings">
+    <PreviewSettings splitEditorLayout="SPLIT" splitEditorPreview="PREVIEW" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="NONE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true" verticallyAlignSourceAndPreviewSyncPosition="true" showSearchHighlightsInPreview="true" showSelectionInPreview="true">
+      <PanelProvider>
+        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.panel" providerName="Default - Swing" />
+      </PanelProvider>
+    </PreviewSettings>
+    <ParserSettings gitHubSyntaxChange="false">
+      <PegdownExtensions>
+        <option name="ABBREVIATIONS" value="false" />
+        <option name="ANCHORLINKS" value="true" />
+        <option name="ASIDE" value="false" />
+        <option name="ATXHEADERSPACE" value="true" />
+        <option name="AUTOLINKS" value="true" />
+        <option name="DEFINITIONS" value="false" />
+        <option name="DEFINITION_BREAK_DOUBLE_BLANK_LINE" value="false" />
+        <option name="FENCED_CODE_BLOCKS" value="true" />
+        <option name="FOOTNOTES" value="false" />
+        <option name="HARDWRAPS" value="false" />
+        <option name="HTML_DEEP_PARSER" value="false" />
+        <option name="INSERTED" value="false" />
+        <option name="QUOTES" value="false" />
+        <option name="RELAXEDHRULES" value="true" />
+        <option name="SMARTS" value="false" />
+        <option name="STRIKETHROUGH" value="true" />
+        <option name="SUBSCRIPT" value="false" />
+        <option name="SUPERSCRIPT" value="false" />
+        <option name="SUPPRESS_HTML_BLOCKS" value="false" />
+        <option name="SUPPRESS_INLINE_HTML" value="false" />
+        <option name="TABLES" value="true" />
+        <option name="TASKLISTITEMS" value="true" />
+        <option name="TOC" value="false" />
+        <option name="WIKILINKS" value="true" />
+      </PegdownExtensions>
+      <ParserOptions>
+        <option name="COMMONMARK_LISTS" value="false" />
+        <option name="DUMMY" value="false" />
+        <option name="EMOJI_SHORTCUTS" value="true" />
+        <option name="FLEXMARK_FRONT_MATTER" value="false" />
+        <option name="GFM_LOOSE_BLANK_LINE_AFTER_ITEM_PARA" value="false" />
+        <option name="GFM_TABLE_RENDERING" value="true" />
+        <option name="GITBOOK_URL_ENCODING" value="false" />
+        <option name="GITHUB_EMOJI_URL" value="false" />
+        <option name="GITHUB_LISTS" value="true" />
+        <option name="GITHUB_WIKI_LINKS" value="true" />
+        <option name="JEKYLL_FRONT_MATTER" value="false" />
+        <option name="SIM_TOC_BLANK_LINE_SPACER" value="true" />
+      </ParserOptions>
+    </ParserSettings>
+    <HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
+      <GeneratorProvider>
+        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.generator" providerName="Default Swing HTML Generator" />
+      </GeneratorProvider>
+      <headerTop />
+      <headerBottom />
+      <bodyTop />
+      <bodyBottom />
+    </HtmlSettings>
+    <CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
+      <StylesheetProvider>
+        <provider providerId="com.vladsch.idea.multimarkdown.editor.swing.html.css" providerName="Default Swing Stylesheet" />
+      </StylesheetProvider>
+      <ScriptProviders />
+      <cssText />
+    </CssSettings>
+    <HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
+    <LinkMapSettings>
+      <textMaps />
+    </LinkMapSettings>
+  </component>
+  <component name="NullableNotNullManager">
+    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
+    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
+    <option name="myNullables">
+      <value>
+        <list size="12">
+          <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="javax.annotation.CheckForNull" />
+          <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+          <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+          <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" />
+          <item index="10" class="java.lang.String" itemvalue="android.annotation.Nullable" />
+          <item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
+        </list>
+      </value>
+    </option>
+    <option name="myNotNulls">
+      <value>
+        <list size="11">
+          <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" />
+          <item index="9" class="java.lang.String" itemvalue="android.annotation.NonNull" />
+          <item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
+        </list>
+      </value>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644 (file)
index 0000000..b8d872c
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/A01d.iml" filepath="$PROJECT_DIR$/A01d.iml" group="A01d" />
+      <module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" group="A01d/app" />
+    </modules>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644 (file)
index 0000000..7f68460
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644 (file)
index 0000000..94a25f7
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
\ No newline at end of file
index cd6de65..6e2b1ad 100644 (file)
@@ -6,8 +6,8 @@ android {
         applicationId "net.osdn.gokigen.a01d"
         minSdkVersion 14
         targetSdkVersion 29
-        versionCode 10701
-        versionName "1.7.1"
+        versionCode 10702
+        versionName "1.7.2"
     }
     buildTypes {
         release {
@@ -20,8 +20,8 @@ android {
 dependencies {
     api fileTree(dir: 'libs', include: ['*.jar'])
     implementation 'androidx.appcompat:appcompat:1.1.0'
-    implementation 'androidx.exifinterface:exifinterface:1.1.0'
-    implementation 'androidx.preference:preference:1.1.0'
+    implementation 'androidx.exifinterface:exifinterface:1.2.0'
+    implementation 'androidx.preference:preference:1.1.1'
     implementation 'com.google.android.material:material:1.1.0'
     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
     implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
index b972f58..27cb336 100644 (file)
@@ -35,6 +35,7 @@ import net.osdn.gokigen.a01d.preference.panasonic.PanasonicPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.olympuspen.OlympusPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.ricohgr2.RicohGr2PreferenceFragment;
 import net.osdn.gokigen.a01d.preference.sony.SonyPreferenceFragment;
+import net.osdn.gokigen.a01d.preference.summary.PreferenceFragmentSummary;
 import net.osdn.gokigen.a01d.preference.theta.ThetaPreferenceFragment;
 
 import androidx.annotation.NonNull;
@@ -60,6 +61,16 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
     private IStatusViewDrawer statusViewDrawer = null;
 
     private PreferenceFragmentCompat preferenceFragment = null;
+    private PreferenceFragmentCompat preferenceFragmentOPC = null;
+    private PreferenceFragmentCompat preferenceFragmentOlympus = null;
+    private PreferenceFragmentCompat preferenceFragmentSony = null;
+    private PreferenceFragmentCompat preferenceFragmentRicoh = null;
+    private PreferenceFragmentCompat preferenceFragmentTheta = null;
+    private PreferenceFragmentCompat preferenceFragmentFuji = null;
+    private PreferenceFragmentCompat preferenceFragmentPanasonic = null;
+    private PreferenceFragmentCompat preferenceFragmentCanon = null;
+    private PreferenceFragmentCompat preferenceFragmentNikon = null;
+
     private OlyCameraPropertyListFragment propertyListFragment = null;
     private SonyCameraApiListFragment sonyApiListFragmentSony = null;
     private LogCatFragment logCatFragment = null;
@@ -369,39 +380,16 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
             {
                 try
                 {
-                    ICameraConnection.CameraConnectionMethod connectionMethod = interfaceProvider.getCammeraConnectionMethod();
-                    if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2) {
-                        preferenceFragment = RicohGr2PreferenceFragment.newInstance(this, this);
-                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY) {
-                        preferenceFragment = SonyPreferenceFragment.newInstance(this, this);
-                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.PANASONIC) {
-                        preferenceFragment = PanasonicPreferenceFragment.newInstance(this, this);
-                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.OLYMPUS) {
-                        preferenceFragment = OlympusPreferenceFragment.newInstance(this, this);
-                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X) {
-                        preferenceFragment = FujiXPreferenceFragment.newInstance(this, this);
-                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.THETA) {
-                        preferenceFragment = ThetaPreferenceFragment.newInstance(this, this);
-                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.CANON) {
-                        preferenceFragment = CanonPreferenceFragment.newInstance(this, this);
-                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON) {
-                        preferenceFragment = NikonPreferenceFragment.newInstance(this, this);
-                    } else //  if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
-                    {
-                        preferenceFragment = PreferenceFragment.newInstance(this, interfaceProvider, this);
-                    }
+                    preferenceFragment = PreferenceFragmentSummary.newInstance(this, this);
                 }
                 catch (Exception e)
                 {
                     e.printStackTrace();
-                    preferenceFragment = SonyPreferenceFragment.newInstance(this, this);
                 }
             }
-
             FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
             transaction.replace(R.id.fragment1, preferenceFragment);
-            // backstackに追加
-            transaction.addToBackStack(null);
+            transaction.addToBackStack(null);    // backstackに追加
             transaction.commit();
         }
         catch (Exception e)
@@ -410,6 +398,81 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
         }
     }
 
+    @Override
+    public void changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod connectionMethod)
+    {
+        try
+        {
+            PreferenceFragmentCompat targetFragment = null;
+            if (connectionMethod == ICameraConnection.CameraConnectionMethod.RICOH_GR2) {
+                if (preferenceFragmentRicoh == null)
+                {
+                    preferenceFragmentRicoh = RicohGr2PreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentRicoh;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY) {
+                if (preferenceFragmentSony == null)
+                {
+                    preferenceFragmentSony = SonyPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentSony;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.PANASONIC) {
+                if (preferenceFragmentPanasonic == null)
+                {
+                    preferenceFragmentPanasonic = PanasonicPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentPanasonic;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.OLYMPUS) {
+                if (preferenceFragmentOlympus == null)
+                {
+                    preferenceFragmentOlympus = OlympusPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentOlympus;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X) {
+                if (preferenceFragmentFuji == null)
+                {
+                    preferenceFragmentFuji = FujiXPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentFuji;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.THETA) {
+                if (preferenceFragmentTheta == null)
+                {
+                    preferenceFragmentTheta = ThetaPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentTheta;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.CANON) {
+                if (preferenceFragmentCanon == null)
+                {
+                    preferenceFragmentCanon = CanonPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentCanon;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.NIKON) {
+                if (preferenceFragmentNikon == null)
+                {
+                    preferenceFragmentNikon = NikonPreferenceFragment.newInstance(this, this);
+                }
+                targetFragment = preferenceFragmentNikon;
+            } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC) {
+                if (preferenceFragmentOPC == null)
+                {
+                    preferenceFragmentOPC = PreferenceFragment.newInstance(this, interfaceProvider, this);
+                }
+                targetFragment = preferenceFragmentOPC;
+            }
+            if (targetFragment != null)
+            {
+                FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
+                transaction.replace(R.id.fragment1, targetFragment);
+                transaction.addToBackStack(null);   // backstackに追加
+                transaction.commit();
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
     /**
      *   デバッグ情報画面を開く
      *
index c856d67..b5fac5e 100644 (file)
@@ -1,5 +1,7 @@
 package net.osdn.gokigen.a01d;
 
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+
 /**
  *
  */
@@ -7,6 +9,7 @@ public interface IChangeScene
 {
     void changeSceneToCameraPropertyList();
     void changeSceneToConfiguration();
+    void changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod connectionMethod);
     void changeCameraConnection();
     void changeSceneToDebugInformation();
     void changeSceneToApiList();
index eb60e36..0084d99 100644 (file)
@@ -81,6 +81,18 @@ public interface IPreferencePropertyAccessor
 
     String NIKON_NOT_SUPPORT_FOCUS_LOCK = "nikon_not_support_focus_lock";
 
+    String DEBUG_INFO = "debug_info";
+
+    String PREFERENCE_OPC_SETTINGS = "opc_settings";
+    String PREFERENCE_OLYMPUS_SETTINGS = "olympus_settings";
+    String PREFERENCE_SONY_SETTINGS = "sony_settings";
+    String PREFERENCE_RICOH_SETTINGS = "ricoh_settings";
+    String PREFERENCE_THETA_SETTINGS = "theta_settings";
+    String PREFERENCE_FUJI_X_SETTINGS = "fuji_x_settings";
+    String PREFERENCE_PANASONIC_SETTINGS = "panasonic_settings";
+    String PREFERENCE_CANON_SETTINGS = "canon_settings";
+    String PREFERENCE_NIKON_SETTINGS = "nikon_settings";
+
  /*
     int CHOICE_SPLASH_SCREEN = 10;
 
index 6e9b5d2..c75c5b8 100644 (file)
@@ -19,11 +19,11 @@ import androidx.preference.PreferenceManager;
 import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.ptpip.operation.PtpIpCameraPowerOff;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
 
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 /**
@@ -36,7 +36,6 @@ public class CanonPreferenceFragment extends PreferenceFragmentCompat implements
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private PtpIpCameraPowerOff powerOffController = null;
-    private LogCatViewer logCatViewer = null;
 
     /**
      *
@@ -67,12 +66,6 @@ public class CanonPreferenceFragment extends PreferenceFragmentCompat implements
             powerOffController = new PtpIpCameraPowerOff(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
-            //cameraApiListViewer = new PanasonicCameraApiListViewer(changeScene);
-            //cameraApiListViewer.prepare();
-
             this.context = context;
         }
         catch (Exception e)
@@ -164,7 +157,7 @@ public class CanonPreferenceFragment extends PreferenceFragmentCompat implements
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 default:
@@ -189,19 +182,23 @@ public class CanonPreferenceFragment extends PreferenceFragmentCompat implements
             addPreferencesFromResource(R.xml.preferences_canon);
 
             ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
 
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            //findPreference("panasonic_api_list").setOnPreferenceClickListener(cameraApiListViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            Preference exitApplication = findPreference(EXIT_APPLICATION);
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
         }
         catch (Exception e)
         {
index 4043c13..09fc852 100644 (file)
@@ -10,7 +10,6 @@ import android.util.Log;
 import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.fujix.operation.CameraPowerOffFujiX;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
@@ -24,6 +23,7 @@ import androidx.preference.Preference;
 import androidx.preference.PreferenceFragmentCompat;
 import androidx.preference.PreferenceManager;
 
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 /**
@@ -36,7 +36,6 @@ public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implement
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private CameraPowerOffFujiX powerOffController = null;
-    private LogCatViewer logCatViewer = null;
 
     /**
      *
@@ -67,9 +66,6 @@ public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implement
             powerOffController = new CameraPowerOffFujiX(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
             this.context = context;
         }
         catch (Exception e)
@@ -83,7 +79,7 @@ public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implement
      *
      */
     @Override
-    public void onAttach(Context activity)
+    public void onAttach(@NonNull Context activity)
     {
         super.onAttach(activity);
         Log.v(TAG, "onAttach()");
@@ -167,17 +163,17 @@ public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implement
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, " " + key + " ,  " + value);
                     break;
 
                 case IPreferencePropertyAccessor.FUJIX_DISPLAY_CAMERA_VIEW:
                     value = preferences.getBoolean(key, false);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "   " + key + " , " + value);
                     break;
 
                 case IPreferencePropertyAccessor.FUJIX_CONNECTION_FOR_READ:
                     value = preferences.getBoolean(key, false);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 default:
@@ -201,19 +197,24 @@ public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implement
             //super.onCreate(savedInstanceState);
             addPreferencesFromResource(R.xml.preferences_fuji_x);
 
-            ListPreference connectionMethod = (ListPreference) findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
 
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            Preference exitApplication = findPreference(EXIT_APPLICATION);
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
         }
         catch (Exception e)
         {
@@ -278,9 +279,8 @@ public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implement
     {
         try
         {
-            ListPreference pref;
-            pref = (ListPreference) findPreference(pref_key);
             String value = preferences.getString(key, defaultValue);
+            ListPreference pref = findPreference(pref_key);
             if (pref != null)
             {
                 pref.setValue(value);
@@ -304,7 +304,7 @@ public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implement
     {
         try
         {
-            CheckBoxPreference pref = (CheckBoxPreference) findPreference(pref_key);
+            CheckBoxPreference pref = findPreference(pref_key);
             if (pref != null) {
                 boolean value = preferences.getBoolean(key, defaultValue);
                 pref.setChecked(value);
index 9f1eb17..e284e15 100644 (file)
@@ -19,11 +19,11 @@ import androidx.preference.PreferenceManager;
 import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.ptpip.operation.PtpIpCameraPowerOff;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
 
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 /**
@@ -36,7 +36,6 @@ public class NikonPreferenceFragment extends PreferenceFragmentCompat implements
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private PtpIpCameraPowerOff powerOffController = null;
-    private LogCatViewer logCatViewer = null;
 
     /**
      *
@@ -67,12 +66,6 @@ public class NikonPreferenceFragment extends PreferenceFragmentCompat implements
             powerOffController = new PtpIpCameraPowerOff(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
-            //cameraApiListViewer = new PanasonicCameraApiListViewer(changeScene);
-            //cameraApiListViewer.prepare();
-
             this.context = context;
         }
         catch (Exception e)
@@ -161,7 +154,7 @@ public class NikonPreferenceFragment extends PreferenceFragmentCompat implements
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 case IPreferencePropertyAccessor.NIKON_NOT_SUPPORT_FOCUS_LOCK:
@@ -191,19 +184,23 @@ public class NikonPreferenceFragment extends PreferenceFragmentCompat implements
             addPreferencesFromResource(R.xml.preferences_nikon);
 
             ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
 
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            //findPreference("panasonic_api_list").setOnPreferenceClickListener(cameraApiListViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            Preference exitApplication = findPreference(EXIT_APPLICATION);
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
         }
         catch (Exception e)
         {
@@ -220,7 +217,6 @@ public class NikonPreferenceFragment extends PreferenceFragmentCompat implements
     {
         super.onResume();
         Log.v(TAG, "onResume() Start");
-
         try
         {
             synchronizedProperty();
@@ -229,9 +225,7 @@ public class NikonPreferenceFragment extends PreferenceFragmentCompat implements
         {
             e.printStackTrace();
         }
-
         Log.v(TAG, "onResume() End");
-
     }
 
     /**
@@ -268,9 +262,8 @@ public class NikonPreferenceFragment extends PreferenceFragmentCompat implements
     {
         try
         {
-            ListPreference pref;
-            pref = (ListPreference) findPreference(pref_key);
             String value = preferences.getString(key, defaultValue);
+            ListPreference pref = findPreference(pref_key);
             if (pref != null)
             {
                 pref.setValue(value);
index d6d37ac..b8b0ffe 100644 (file)
@@ -196,60 +196,74 @@ public class PreferenceFragment extends PreferenceFragmentCompat implements Shar
             sizeTable.put("QUAD_VGA", "(1280x960)");
 
             ListPreference liveViewQuality = (ListPreference) findPreference(IPreferencePropertyAccessor.LIVE_VIEW_QUALITY);
-            liveViewQuality.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    String key = (String) newValue;
-                    preference.setSummary(newValue + " " + sizeTable.get(key));
-                    return (true);
-                }
-            });
-            liveViewQuality.setSummary(liveViewQuality.getValue() + " " + sizeTable.get(liveViewQuality.getValue()));
+            if (liveViewQuality != null)
+            {
+                liveViewQuality.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        String key = (String) newValue;
+                        preference.setSummary(newValue + " " + sizeTable.get(key));
+                        return (true);
+                    }
+                });
+                liveViewQuality.setSummary(liveViewQuality.getValue() + " " + sizeTable.get(liveViewQuality.getValue()));
+            }
 
             ListPreference liveViewScale = (ListPreference) findPreference(IPreferencePropertyAccessor.MAGNIFYING_LIVE_VIEW_SCALE);
-            liveViewScale.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            liveViewScale.setSummary(liveViewScale.getValue() + " ");
+            if (liveViewScale != null)
+            {
+                liveViewScale.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                liveViewScale.setSummary(liveViewScale.getValue() + " ");
+            }
 
             ListPreference digitalZoom = (ListPreference) findPreference(IPreferencePropertyAccessor.DIGITAL_ZOOM_LEVEL);
-            digitalZoom.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            digitalZoom.setSummary(digitalZoom.getValue() + " ");
+            if (digitalZoom != null)
+            {
+                digitalZoom.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                digitalZoom.setSummary(digitalZoom.getValue() + " ");
+            }
 
             ListPreference powerZoom = (ListPreference) findPreference(IPreferencePropertyAccessor.POWER_ZOOM_LEVEL);
-            powerZoom.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            powerZoom.setSummary(powerZoom.getValue() + " ");
+            if (powerZoom != null)
+            {
+                powerZoom.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                powerZoom.setSummary(powerZoom.getValue() + " ");
+            }
 
             ListPreference connectionMethod = (ListPreference) findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
-
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
             findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
             findPreference("olympus_air_bt").setOnPreferenceClickListener(powerOnSelector);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            //findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
+            //findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
         }
         catch (Exception e)
         {
@@ -415,7 +429,7 @@ public class PreferenceFragment extends PreferenceFragmentCompat implements Shar
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 default:
index aaf4bf7..eac3837 100644 (file)
@@ -19,11 +19,11 @@ import androidx.preference.PreferenceManager;
 import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.olympuspen.operation.OlympusPenCameraPowerOff;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
 
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 /**
@@ -36,8 +36,6 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private OlympusPenCameraPowerOff powerOffController = null;
-    private LogCatViewer logCatViewer = null;
-    //private PanasonicCameraApiListViewer cameraApiListViewer = null;
 
     /**
      *
@@ -68,12 +66,6 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
             powerOffController = new OlympusPenCameraPowerOff(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
-            //cameraApiListViewer = new PanasonicCameraApiListViewer(changeScene);
-            //cameraApiListViewer.prepare();
-
             this.context = context;
         }
         catch (Exception e)
@@ -119,13 +111,16 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
             Map<String, ?> items = preferences.getAll();
             SharedPreferences.Editor editor = preferences.edit();
 
-            if (!items.containsKey(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA))
+            {
                 editor.putBoolean(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW))
+            {
                 editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD))
+            {
                 editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
             }
             editor.apply();
@@ -156,7 +151,7 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 default:
@@ -181,19 +176,23 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
             addPreferencesFromResource(R.xml.preferences_olympuspen);
 
             ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
 
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            //findPreference("panasonic_api_list").setOnPreferenceClickListener(cameraApiListViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            Preference exitApplication = findPreference(EXIT_APPLICATION);
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
         }
         catch (Exception e)
         {
@@ -209,8 +208,8 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
     public void onResume()
     {
         super.onResume();
-        Log.v(TAG, "onResume() Start");
 
+        Log.v(TAG, "onResume() Start");
         try
         {
             synchronizedProperty();
@@ -219,9 +218,7 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
         {
             e.printStackTrace();
         }
-
         Log.v(TAG, "onResume() End");
-
     }
 
     /**
@@ -258,9 +255,8 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
     {
         try
         {
-            ListPreference pref;
-            pref = (ListPreference) findPreference(pref_key);
             String value = preferences.getString(key, defaultValue);
+            ListPreference pref = findPreference(pref_key);
             if (pref != null)
             {
                 pref.setValue(value);
@@ -285,7 +281,8 @@ public class OlympusPreferenceFragment extends PreferenceFragmentCompat implemen
         try
         {
             CheckBoxPreference pref = findPreference(pref_key);
-            if (pref != null) {
+            if (pref != null)
+            {
                 boolean value = preferences.getBoolean(key, defaultValue);
                 pref.setChecked(value);
             }
index 45038be..8654f9f 100644 (file)
@@ -10,7 +10,6 @@ import android.util.Log;
 import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.panasonic.operation.CameraPowerOffPanasonic;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
@@ -36,8 +35,6 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private CameraPowerOffPanasonic powerOffController = null;
-    private LogCatViewer logCatViewer = null;
-    //private PanasonicCameraApiListViewer cameraApiListViewer = null;
 
     /**
      *
@@ -68,12 +65,6 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
             powerOffController = new CameraPowerOffPanasonic(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
-            //cameraApiListViewer = new PanasonicCameraApiListViewer(changeScene);
-            //cameraApiListViewer.prepare();
-
             this.context = context;
         }
         catch (Exception e)
@@ -87,7 +78,7 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
      *
      */
     @Override
-    public void onAttach(Context activity)
+    public void onAttach(@NonNull Context activity)
     {
         super.onAttach(activity);
         Log.v(TAG, "onAttach()");
@@ -156,7 +147,7 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 default:
@@ -180,20 +171,24 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
             //super.onCreate(savedInstanceState);
             addPreferencesFromResource(R.xml.preferences_panasonic);
 
-            ListPreference connectionMethod = (ListPreference) findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
 
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            //findPreference("panasonic_api_list").setOnPreferenceClickListener(cameraApiListViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            Preference exitApplication = findPreference("exit_application");
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
         }
         catch (Exception e)
         {
@@ -209,8 +204,8 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
     public void onResume()
     {
         super.onResume();
-        Log.v(TAG, "onResume() Start");
 
+        Log.v(TAG, "onResume() Start");
         try
         {
             synchronizedProperty();
@@ -219,9 +214,7 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
         {
             e.printStackTrace();
         }
-
         Log.v(TAG, "onResume() End");
-
     }
 
     /**
@@ -258,9 +251,8 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
     {
         try
         {
-            ListPreference pref;
-            pref = (ListPreference) findPreference(pref_key);
             String value = preferences.getString(key, defaultValue);
+            ListPreference pref = findPreference(pref_key);
             if (pref != null)
             {
                 pref.setValue(value);
@@ -284,8 +276,9 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
     {
         try
         {
-            CheckBoxPreference pref = (CheckBoxPreference) findPreference(pref_key);
-            if (pref != null) {
+            CheckBoxPreference pref = findPreference(pref_key);
+            if (pref != null)
+            {
                 boolean value = preferences.getBoolean(key, defaultValue);
                 pref.setChecked(value);
             }
@@ -324,7 +317,6 @@ public class PanasonicPreferenceFragment  extends PreferenceFragmentCompat imple
         }
     }
 
-
     @Override
     public boolean onPreferenceClick(Preference preference)
     {
index bfedf38..f23a6d1 100644 (file)
@@ -11,7 +11,6 @@ import android.util.Log;
 import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.ricohgr2.operation.CameraPowerOffRicohGr2;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
@@ -25,6 +24,7 @@ import androidx.preference.Preference;
 import androidx.preference.PreferenceFragmentCompat;
 import androidx.preference.PreferenceManager;
 
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener, Preference.OnPreferenceClickListener
@@ -33,7 +33,6 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private CameraPowerOffRicohGr2 powerOffController = null;
-    private LogCatViewer logCatViewer = null;
 
     /**
      *
@@ -64,9 +63,6 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
             powerOffController = new CameraPowerOffRicohGr2(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
             this.context = context;
         }
         catch (Exception e)
@@ -80,7 +76,7 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
      *
      */
     @Override
-    public void onAttach(Context activity)
+    public void onAttach(@NonNull Context activity)
     {
         super.onAttach(activity);
         Log.v(TAG, "onAttach()");
@@ -112,25 +108,32 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
             Map<String, ?> items = preferences.getAll();
             SharedPreferences.Editor editor = preferences.edit();
 
-            if (!items.containsKey(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA))
+            {
                 editor.putBoolean(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW))
+            {
                 editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD))
+            {
                 editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.GR2_LCD_SLEEP)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.GR2_LCD_SLEEP))
+            {
                 editor.putBoolean(IPreferencePropertyAccessor.GR2_LCD_SLEEP, false);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.GR2_LIVE_VIEW)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.GR2_LIVE_VIEW))
+            {
                 editor.putBoolean(IPreferencePropertyAccessor.GR2_LIVE_VIEW, true);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.USE_PENTAX_AUTOFOCUS)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.USE_PENTAX_AUTOFOCUS))
+            {
                 editor.putBoolean(IPreferencePropertyAccessor.USE_PENTAX_AUTOFOCUS, false);
             }
-            if (!items.containsKey(IPreferencePropertyAccessor.GR2_DISPLAY_MODE)) {
+            if (!items.containsKey(IPreferencePropertyAccessor.GR2_DISPLAY_MODE))
+            {
                 editor.putString(IPreferencePropertyAccessor.GR2_DISPLAY_MODE, IPreferencePropertyAccessor.GR2_DISPLAY_MODE_DEFAULT_VALUE);
             }
             editor.apply();
@@ -161,17 +164,17 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 case IPreferencePropertyAccessor.GR2_LCD_SLEEP:
                     value = preferences.getBoolean(key, false);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 case IPreferencePropertyAccessor.GR2_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "    " + key + " , " + value);
                     break;
 
                 case IPreferencePropertyAccessor.USE_PENTAX_AUTOFOCUS:
@@ -200,29 +203,37 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
             //super.onCreate(savedInstanceState);
             addPreferencesFromResource(R.xml.preferences_ricoh_gr2);
 
-            ListPreference connectionMethod = (ListPreference) findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
 
-            ListPreference displayMode = (ListPreference) findPreference(IPreferencePropertyAccessor.GR2_DISPLAY_MODE);
-            displayMode.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            displayMode.setSummary(displayMode.getValue() + " ");
+            ListPreference displayMode = findPreference(IPreferencePropertyAccessor.GR2_DISPLAY_MODE);
+            if (displayMode != null)
+            {
+                displayMode.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                displayMode.setSummary(displayMode.getValue() + " ");
+            }
 
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            Preference exitApplication = findPreference(EXIT_APPLICATION);
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
         }
         catch (Exception e)
         {
@@ -288,7 +299,7 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
         try
         {
             ListPreference pref;
-            pref = (ListPreference) findPreference(pref_key);
+            pref = findPreference(pref_key);
             String value = preferences.getString(key, defaultValue);
             if (pref != null)
             {
@@ -313,7 +324,7 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
     {
         try
         {
-            CheckBoxPreference pref = (CheckBoxPreference) findPreference(pref_key);
+            CheckBoxPreference pref = findPreference(pref_key);
             if (pref != null) {
                 boolean value = preferences.getBoolean(key, defaultValue);
                 pref.setChecked(value);
@@ -356,7 +367,6 @@ public class RicohGr2PreferenceFragment  extends PreferenceFragmentCompat implem
         }
     }
 
-
     @Override
     public boolean onPreferenceClick(Preference preference)
     {
index 425f026..a049843 100644 (file)
@@ -11,7 +11,6 @@ import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.sony.cameraproperty.SonyCameraApiListViewer;
 import net.osdn.gokigen.a01d.camera.sony.operation.CameraPowerOffSony;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
@@ -25,6 +24,7 @@ import androidx.preference.Preference;
 import androidx.preference.PreferenceFragmentCompat;
 import androidx.preference.PreferenceManager;
 
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 /**
@@ -37,7 +37,6 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private CameraPowerOffSony powerOffController = null;
-    private LogCatViewer logCatViewer = null;
     private SonyCameraApiListViewer cameraApiListViewer = null;
 
     /**
@@ -70,9 +69,6 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
             powerOffController = new CameraPowerOffSony(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
             cameraApiListViewer = new SonyCameraApiListViewer(changeScene);
             cameraApiListViewer.prepare();
 
@@ -89,7 +85,7 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
      *
      */
     @Override
-    public void onAttach(Context activity)
+    public void onAttach(@NonNull Context activity)
     {
         super.onAttach(activity);
         Log.v(TAG, "onAttach()");
@@ -153,7 +149,7 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
             {
                 case IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
@@ -182,20 +178,30 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
             //super.onCreate(savedInstanceState);
             addPreferencesFromResource(R.xml.preferences_sony);
 
-            ListPreference connectionMethod = (ListPreference) findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
 
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            findPreference("sony_api_list").setOnPreferenceClickListener(cameraApiListViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            Preference extApplication = findPreference(EXIT_APPLICATION);
+            if (extApplication != null)
+            {
+                extApplication.setOnPreferenceClickListener(powerOffController);
+            }
+
+            Preference sonyApi = findPreference("sony_api_list");
+            if (sonyApi != null)
+            {
+                sonyApi.setOnPreferenceClickListener(cameraApiListViewer);
+            }
         }
         catch (Exception e)
         {
@@ -211,8 +217,8 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
     public void onResume()
     {
         super.onResume();
-        Log.v(TAG, "onResume() Start");
 
+        Log.v(TAG, "onResume() Start");
         try
         {
             synchronizedProperty();
@@ -221,9 +227,7 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
         {
             e.printStackTrace();
         }
-
         Log.v(TAG, "onResume() End");
-
     }
 
     /**
@@ -260,8 +264,7 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
     {
         try
         {
-            ListPreference pref;
-            pref = (ListPreference) findPreference(pref_key);
+            ListPreference pref = findPreference(pref_key);
             String value = preferences.getString(key, defaultValue);
             if (pref != null)
             {
@@ -286,8 +289,9 @@ public class SonyPreferenceFragment  extends PreferenceFragmentCompat implements
     {
         try
         {
-            CheckBoxPreference pref = (CheckBoxPreference) findPreference(pref_key);
-            if (pref != null) {
+            CheckBoxPreference pref = findPreference(pref_key);
+            if (pref != null)
+            {
                 boolean value = preferences.getBoolean(key, defaultValue);
                 pref.setChecked(value);
             }
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/preference/summary/PreferenceFragmentSummary.java b/app/src/main/java/net/osdn/gokigen/a01d/preference/summary/PreferenceFragmentSummary.java
new file mode 100644 (file)
index 0000000..21cbd2e
--- /dev/null
@@ -0,0 +1,477 @@
+package net.osdn.gokigen.a01d.preference.summary;
+
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.provider.Settings;
+import android.util.Log;
+
+import net.osdn.gokigen.a01d.ConfirmationDialog;
+import net.osdn.gokigen.a01d.IChangeScene;
+import net.osdn.gokigen.a01d.R;
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+import net.osdn.gokigen.a01d.logcat.LogCatViewer;
+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
+
+import java.util.Map;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.FragmentActivity;
+import androidx.preference.CheckBoxPreference;
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
+import androidx.preference.PreferenceManager;
+
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.DEBUG_INFO;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_CANON_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_FUJI_X_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_NIKON_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_OLYMPUS_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_OPC_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_PANASONIC_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_RICOH_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_SONY_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.PREFERENCE_THETA_SETTINGS;
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
+
+
+/**
+ *
+ *
+ */
+public class PreferenceFragmentSummary extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener, Preference.OnPreferenceClickListener
+{
+    private final String TAG = toString();
+    private AppCompatActivity context = null;
+    private SharedPreferences preferences = null;
+    private IChangeScene changeScene = null;
+    private LogCatViewer logCatViewer = null;
+
+    /**
+     *
+     *
+     */
+    public static PreferenceFragmentSummary newInstance(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
+    {
+        PreferenceFragmentSummary instance = new PreferenceFragmentSummary();
+        instance.prepare(context, changeScene);
+
+        // パラメータはBundleにまとめておく
+        Bundle arguments = new Bundle();
+        //arguments.putString("title", title);
+        //arguments.putString("message", message);
+        instance.setArguments(arguments);
+
+        return (instance);
+    }
+
+    /**
+     *
+     *
+     */
+    private void prepare(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
+    {
+        try
+        {
+            logCatViewer = new LogCatViewer(changeScene);
+            logCatViewer.prepare();
+            this.changeScene = changeScene;
+            this.context = context;
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onAttach(@NonNull Context activity)
+    {
+        super.onAttach(activity);
+        Log.v(TAG, "onAttach()");
+
+        try
+        {
+            // Preference をつかまえる
+            preferences = PreferenceManager.getDefaultSharedPreferences(activity);
+
+            // Preference を初期設定する
+            initializePreferences();
+
+            preferences.registerOnSharedPreferenceChangeListener(this);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Preferenceの初期化...
+     *
+     */
+    private void initializePreferences()
+    {
+        try
+        {
+            Map<String, ?> items = preferences.getAll();
+            SharedPreferences.Editor editor = preferences.edit();
+
+            if (!items.containsKey(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA))
+            {
+                editor.putBoolean(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW))
+            {
+                editor.putBoolean(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD))
+            {
+                editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
+            }
+            editor.apply();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)
+    {
+        Log.v(TAG, "onSharedPreferenceChanged() : " + key);
+        boolean value;
+        if (key != null)
+        {
+            switch (key)
+            {
+                case IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA:
+                    value = preferences.getBoolean(key, true);
+                    Log.v(TAG, "  " + key + " , " + value);
+                    break;
+
+                case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
+                    value = preferences.getBoolean(key, true);
+                    Log.v(TAG, " " + key + " , " + value);
+                    break;
+
+                default:
+                    String strValue = preferences.getString(key, "");
+                    setListPreference(key, key, strValue);
+                    break;
+            }
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onCreatePreferences(Bundle savedInstanceState, String rootKey)
+    {
+        Log.v(TAG, "onCreatePreferences()");
+        try
+        {
+            //super.onCreate(savedInstanceState);
+            addPreferencesFromResource(R.xml.preferences_summary);
+
+            ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue) {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
+
+            Preference debug_info = findPreference(DEBUG_INFO);
+            if (debug_info != null)
+            {
+                debug_info.setOnPreferenceClickListener(logCatViewer);
+            }
+
+            Preference wifi_settings = findPreference(WIFI_SETTINGS);
+            if (wifi_settings != null)
+            {
+                wifi_settings.setOnPreferenceClickListener(this);
+            }
+
+            Preference opc_settings = findPreference(PREFERENCE_OPC_SETTINGS);
+            if (opc_settings != null)
+            {
+                opc_settings.setOnPreferenceClickListener(this);
+            }
+            Preference olympus_settings = findPreference(PREFERENCE_OLYMPUS_SETTINGS);
+            if (olympus_settings != null)
+            {
+                olympus_settings.setOnPreferenceClickListener(this);
+            }
+            Preference sony_settings = findPreference(PREFERENCE_SONY_SETTINGS);
+            if (sony_settings != null)
+            {
+                sony_settings.setOnPreferenceClickListener(this);
+            }
+            Preference ricoh_settings = findPreference(PREFERENCE_RICOH_SETTINGS);
+            if (ricoh_settings != null)
+            {
+                ricoh_settings.setOnPreferenceClickListener(this);
+            }
+            Preference theta_settings = findPreference(PREFERENCE_THETA_SETTINGS);
+            if (theta_settings != null)
+            {
+                theta_settings.setOnPreferenceClickListener(this);
+            }
+            Preference fuji_settings = findPreference(PREFERENCE_FUJI_X_SETTINGS);
+            if (fuji_settings != null)
+            {
+                fuji_settings.setOnPreferenceClickListener(this);
+            }
+            Preference panasonic_settings = findPreference(PREFERENCE_PANASONIC_SETTINGS);
+            if (panasonic_settings != null)
+            {
+                panasonic_settings.setOnPreferenceClickListener(this);
+            }
+            Preference canon_settings = findPreference(PREFERENCE_CANON_SETTINGS);
+            if (canon_settings != null)
+            {
+                canon_settings.setOnPreferenceClickListener(this);
+            }
+            Preference nikon_settings = findPreference(PREFERENCE_NIKON_SETTINGS);
+            if (nikon_settings != null)
+            {
+                nikon_settings.setOnPreferenceClickListener(this);
+            }
+
+            Preference exitApplication = findPreference(EXIT_APPLICATION);
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(this);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onResume()
+    {
+        super.onResume();
+        Log.v(TAG, "onResume() Start");
+
+        try
+        {
+            synchronizedProperty();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+
+        Log.v(TAG, "onResume() End");
+
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onPause()
+    {
+        super.onPause();
+        Log.v(TAG, "onPause() Start");
+
+        try
+        {
+            // Preference変更のリスナを解除
+            preferences.unregisterOnSharedPreferenceChangeListener(this);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+
+        Log.v(TAG, "onPause() End");
+    }
+
+    /**
+     * ListPreference の表示データを設定
+     *
+     * @param pref_key     Preference(表示)のキー
+     * @param key          Preference(データ)のキー
+     * @param defaultValue Preferenceのデフォルト値
+     */
+    private void setListPreference(String pref_key, String key, String defaultValue)
+    {
+        try
+        {
+            ListPreference pref;
+            pref = findPreference(pref_key);
+            String value = preferences.getString(key, defaultValue);
+            if (pref != null)
+            {
+                pref.setValue(value);
+                pref.setSummary(value);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * BooleanPreference の表示データを設定
+     *
+     * @param pref_key     Preference(表示)のキー
+     * @param key          Preference(データ)のキー
+     * @param defaultValue Preferenceのデフォルト値
+     */
+    private void setBooleanPreference(String pref_key, String key, boolean defaultValue)
+    {
+        try
+        {
+            CheckBoxPreference pref = findPreference(pref_key);
+            if (pref != null)
+            {
+                boolean value = preferences.getBoolean(key, defaultValue);
+                pref.setChecked(value);
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    private void synchronizedProperty()
+    {
+        final FragmentActivity activity = getActivity();
+        final boolean defaultValue = true;
+        if (activity != null)
+        {
+            activity.runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    try
+                    {
+                        // Preferenceの画面に反映させる
+                        setBooleanPreference(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, defaultValue);
+                        setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, defaultValue);
+                    }
+                    catch (Exception e)
+                    {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+
+    @Override
+    public boolean onPreferenceClick(Preference preference)
+    {
+        try
+        {
+            String preferenceKey = preference.getKey();
+            if (preferenceKey.contains(WIFI_SETTINGS))
+            {
+                // Wifi 設定画面を表示する
+                Log.v(TAG, " onPreferenceClick : " + preferenceKey);
+                if (context != null)
+                {
+                    context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
+                }
+            }
+            else if (preferenceKey.contains(PREFERENCE_OPC_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.OPC);
+            }
+            else if (preferenceKey.contains(PREFERENCE_OLYMPUS_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.OLYMPUS);
+            }
+            else if (preferenceKey.contains(PREFERENCE_SONY_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.SONY);
+            }
+            else if (preferenceKey.contains(PREFERENCE_RICOH_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.RICOH_GR2);
+            }
+            else if (preferenceKey.contains(PREFERENCE_THETA_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.THETA);
+            }
+            else if (preferenceKey.contains(PREFERENCE_FUJI_X_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.FUJI_X);
+            }
+            else if (preferenceKey.contains(PREFERENCE_PANASONIC_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.PANASONIC);
+            }
+            else if (preferenceKey.contains(PREFERENCE_CANON_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.CANON);
+            }
+            else if (preferenceKey.contains(PREFERENCE_NIKON_SETTINGS))
+            {
+                changeScene.changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod.NIKON);
+            }
+            else if (preferenceKey.contains(EXIT_APPLICATION))
+            {
+                // 確認ダイアログの生成と表示
+                try
+                {
+                    ConfirmationDialog dialog = ConfirmationDialog.newInstance(context);
+                    dialog.show(R.string.dialog_title_confirmation, R.string.dialog_message_exit_application, new ConfirmationDialog.Callback() {
+                        @Override
+                        public void confirm()
+                        {
+                            changeScene.exitApplication();
+                        }
+                    });
+                }
+                catch (Exception e)
+                {
+                    e.printStackTrace();
+                }
+            }
+            return (true);
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+        return (false);
+    }
+}
index 4f72bb0..2606b96 100644 (file)
@@ -19,11 +19,11 @@ import androidx.preference.PreferenceManager;
 import net.osdn.gokigen.a01d.IChangeScene;
 import net.osdn.gokigen.a01d.R;
 import net.osdn.gokigen.a01d.camera.ptpip.operation.PtpIpCameraPowerOff;
-import net.osdn.gokigen.a01d.logcat.LogCatViewer;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
 
 import java.util.Map;
 
+import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.EXIT_APPLICATION;
 import static net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor.WIFI_SETTINGS;
 
 /**
@@ -36,7 +36,6 @@ public class ThetaPreferenceFragment extends PreferenceFragmentCompat implements
     private AppCompatActivity context = null;
     private SharedPreferences preferences = null;
     private PtpIpCameraPowerOff powerOffController = null;
-    private LogCatViewer logCatViewer = null;
 
     /**
      *
@@ -67,12 +66,6 @@ public class ThetaPreferenceFragment extends PreferenceFragmentCompat implements
             powerOffController = new PtpIpCameraPowerOff(context, changeScene);
             powerOffController.prepare();
 
-            logCatViewer = new LogCatViewer(changeScene);
-            logCatViewer.prepare();
-
-            //cameraApiListViewer = new PanasonicCameraApiListViewer(changeScene);
-            //cameraApiListViewer.prepare();
-
             this.context = context;
         }
         catch (Exception e)
@@ -158,7 +151,7 @@ public class ThetaPreferenceFragment extends PreferenceFragmentCompat implements
 
                 case IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW:
                     value = preferences.getBoolean(key, true);
-                    Log.v(TAG, " " + key + " , " + value);
+                    Log.v(TAG, "  " + key + " , " + value);
                     break;
 
                 case IPreferencePropertyAccessor.USE_OSC_THETA_V21:
@@ -188,19 +181,23 @@ public class ThetaPreferenceFragment extends PreferenceFragmentCompat implements
             addPreferencesFromResource(R.xml.preferences_theta);
 
             ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
-            connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-                @Override
-                public boolean onPreferenceChange(Preference preference, Object newValue) {
-                    preference.setSummary(newValue + " ");
-                    return (true);
-                }
-            });
-            connectionMethod.setSummary(connectionMethod.getValue() + " ");
-
-            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
-            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
-            //findPreference("panasonic_api_list").setOnPreferenceClickListener(cameraApiListViewer);
-            findPreference(WIFI_SETTINGS).setOnPreferenceClickListener(this);
+            if (connectionMethod != null)
+            {
+                connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
+                    @Override
+                    public boolean onPreferenceChange(Preference preference, Object newValue)
+                    {
+                        preference.setSummary(newValue + " ");
+                        return (true);
+                    }
+                });
+                connectionMethod.setSummary(connectionMethod.getValue() + " ");
+            }
+            Preference exitApplication = findPreference(EXIT_APPLICATION);
+            if (exitApplication != null)
+            {
+                exitApplication.setOnPreferenceClickListener(powerOffController);
+            }
         }
         catch (Exception e)
         {
@@ -266,7 +263,7 @@ public class ThetaPreferenceFragment extends PreferenceFragmentCompat implements
         try
         {
             ListPreference pref;
-            pref = (ListPreference) findPreference(pref_key);
+            pref = findPreference(pref_key);
             String value = preferences.getString(key, defaultValue);
             if (pref != null)
             {
index 8de5348..2d90372 100644 (file)
     <string name="pref_nikon_not_support_focus_lock">フォーカスロック未対応機</string>
     <string name="pref_summary_nikon_not_support_focus_lock">フォーカスロックでライブビューが止まる場合にチェックを入れてください。</string>
 
+    <string name="pref_cat_detail_settings">詳細設定</string>
+
+    <string name="pref_opc_settings">OPC (Olympus Air)</string>
+    <string name="pref_summary_opc_settings"> </string>
+
+    <string name="pref_olympus_settings">Olympus PEN/OM-D</string>
+    <string name="pref_summary_olympus_settings"> </string>
+
+    <string name="pref_sony_settings">Sony</string>
+    <string name="pref_summary_sony_settings"> </string>
+
+    <string name="pref_ricoh_settings">PENTAX/Ricoh GR Series</string>
+    <string name="pref_summary_ricoh_settings"> </string>
+
+    <string name="pref_theta_settings">Ricoh Theta</string>
+    <string name="pref_summary_theta_settings"> </string>
+
+    <string name="pref_fuji_x_settings">Fujifilm X Series</string>
+    <string name="pref_summary_fuji_x_settings"> </string>
+
+    <string name="pref_panasonic_settings">Panasonic</string>
+    <string name="pref_summary_panasonic_settings"> </string>
+
+    <string name="pref_canon_settings">Canon</string>
+    <string name="pref_summary_canon_settings"> </string>
+
+    <string name="pref_nikon_settings">Nikon</string>
+    <string name="pref_summary_nikon_settings"> </string>
+
+    <string name="pref_exit_power_off_summary">アプリ終了</string>
+
 </resources>
index 4b2b3f1..21d2854 100644 (file)
     <string name="pref_nikon_not_support_focus_lock">Not support Focus-Lock</string>
     <string name="pref_summary_nikon_not_support_focus_lock"> </string>
 
+    <string name="pref_cat_detail_settings">Detail Settings</string>
+
+    <string name="pref_opc_settings">OPC (Olympus Air)</string>
+    <string name="pref_summary_opc_settings">Special Settings for OPC</string>
+
+    <string name="pref_olympus_settings">Olympus PEN/OM-D</string>
+    <string name="pref_summary_olympus_settings">Special Settings for PEN/OM-D</string>
+
+    <string name="pref_sony_settings">Sony</string>
+    <string name="pref_summary_sony_settings">Special Settings for Sony</string>
+
+    <string name="pref_ricoh_settings">Ricoh GR / PENTAX</string>
+    <string name="pref_summary_ricoh_settings">Special Settings for Ricoh GR/PENTAX</string>
+
+    <string name="pref_theta_settings">Theta</string>
+    <string name="pref_summary_theta_settings">Special Settings for Ricoh THETA</string>
+
+    <string name="pref_fuji_x_settings">Fuji X Series</string>
+    <string name="pref_summary_fuji_x_settings">Special Settings for Fujifilm X Series</string>
+
+    <string name="pref_panasonic_settings">Panasonic</string>
+    <string name="pref_summary_panasonic_settings">Special Settings for Panasonic</string>
+
+    <string name="pref_canon_settings">Canon</string>
+    <string name="pref_summary_canon_settings">Special Settings for Canon</string>
+
+    <string name="pref_nikon_settings">Nikon</string>
+    <string name="pref_summary_nikon_settings">Special Settings for Nikon</string>
+
+    <string name="pref_exit_power_off_summary">Exit Application</string>
+
 </resources>
index f68d92e..b5216fe 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
@@ -19,7 +19,7 @@
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
     <PreferenceCategory
         <CheckBoxPreference
             android:key="raw"
             android:title="@string/pref_take_raw" />
-
+<!--
         <CheckBoxPreference
             android:key="capture_both_camera_and_live_view"
             android:title="@string/pref_capture_both_camera_and_live_view" />
-
+-->
     </PreferenceCategory>
 
     <PreferenceCategory
 
     <PreferenceCategory
         android:title="@string/pref_cat_initialize">
-
+<!--
         <CheckBoxPreference
         android:key="auto_connect_to_camera"
         android:title="@string/pref_auto_connect_camera"
         android:summary="@string/pref_summary_auto_connect_camera" />
-
+-->
         <CheckBoxPreference
             android:key="ble_power_on"
             android:title="@string/pref_bluetooth_power_on"
             android:summary="@string/pref_summary_air_bt" />
 
     </PreferenceCategory>
-
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_gokigen">
 
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index 225d7ac..8400592 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off_canon" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
@@ -19,7 +19,7 @@
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
     <PreferenceCategory
             android:title="@string/pref_canon_focus_xy"
             android:defaultValue="6000,4000"
             android:summary="@string/pref_summary_canon_focus_xy" />
-
+<!--
         <CheckBoxPreference
             android:key="capture_both_camera_and_live_view"
             android:title="@string/pref_capture_both_camera_and_live_view" />
-
+-->
     </PreferenceCategory>
-
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_initialize">
 
@@ -85,4 +85,5 @@
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index 8c3fc4c..64a8fa9 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off_fujix" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
@@ -19,7 +19,7 @@
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
     <PreferenceCategory
             android:title="@string/pref_fujix_command_polling_wait"
             android:defaultValue="500"
             android:summary="@string/pref_summary_fujix_command_polling_wait" />
-
+<!--
         <CheckBoxPreference
             android:key="capture_both_camera_and_live_view"
             android:title="@string/pref_capture_both_camera_and_live_view" />
-
+-->
         <CheckBoxPreference
             android:key="fujix_connection_for_read"
             android:title="@string/pref_fujix_connection_for_read"
             android:summary="@string/pref_fujix_connection_for_read_summary"/>
 
-
     </PreferenceCategory>
 
 
@@ -73,7 +72,7 @@
         </Preference>
 
     </PreferenceCategory>
-
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_gokigen">
 
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index 735aebf..c690fa2 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off_nikon" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
@@ -19,7 +19,7 @@
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
     <PreferenceCategory
             android:key="nikon_not_support_focus_lock"
             android:title="@string/pref_nikon_not_support_focus_lock"
             android:summary="@string/pref_summary_nikon_not_support_focus_lock" />
-
+<!--
         <CheckBoxPreference
             android:key="capture_both_camera_and_live_view"
             android:title="@string/pref_capture_both_camera_and_live_view" />
-
+-->
     </PreferenceCategory>
-
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_initialize">
 
@@ -78,4 +78,5 @@
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index ffdcb6a..9b8bb26 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off_olympuspen" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
@@ -19,9 +19,9 @@
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
-
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_camera">
 
@@ -67,4 +67,5 @@
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index 08ae615..c115ad7 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off_panasonic" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_camera">
 
@@ -67,4 +68,5 @@
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index 5c9e186..369d559 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_camera">
 
@@ -30,6 +31,7 @@
             android:title="@string/pref_capture_both_camera_and_live_view" />
 
     </PreferenceCategory>
+-->
 
     <PreferenceCategory
         android:title="@string/pref_cat_initialize">
             android:key="gr2_display_mode"
             android:defaultValue="0"/>
 
+<!--
         <CheckBoxPreference
             android:key="auto_connect_to_camera"
             android:title="@string/pref_auto_connect_camera"
             android:summary="@string/pref_summary_auto_connect_camera" />
+-->
     </PreferenceCategory>
 
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_gokigen">
 
@@ -88,4 +93,5 @@
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index bcf6050..ec3c731 100644 (file)
@@ -7,7 +7,7 @@
             android:key="exit_application"
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off_sony" />
-
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
@@ -19,7 +19,7 @@
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
     <PreferenceCategory
             android:key="sony_api_list"
             android:title="@string/pref_sony_api_list"
             android:summary="@string/pref_summary_sony_api_list" />
-
+<!--
         <CheckBoxPreference
             android:key="capture_both_camera_and_live_view"
             android:title="@string/pref_capture_both_camera_and_live_view" />
-
+-->
     </PreferenceCategory>
 
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_initialize">
 
@@ -72,4 +73,5 @@
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
diff --git a/app/src/main/res/xml/preferences_summary.xml b/app/src/main/res/xml/preferences_summary.xml
new file mode 100644 (file)
index 0000000..f615ba4
--- /dev/null
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
+    <PreferenceCategory
+        android:title="@string/pref_cat_application_control">
+
+        <PreferenceScreen
+            android:key="exit_application"
+            android:icon="@drawable/ic_power_settings_new_black_24dp"
+            android:title="@string/pref_exit_power_off_summary" />
+
+        <ListPreference
+            android:title="@string/pref_connection_method"
+            android:entryValues="@array/connection_method_value"
+            android:entries="@array/connection_method"
+            android:key="connection_method"
+            android:defaultValue="OPC"/>
+
+        <PreferenceScreen
+            android:key="wifi_settings"
+            android:title="@string/pref_wifi_settings"
+            android:summary="@string/pref_summary_wifi_settings" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_camera">
+
+        <CheckBoxPreference
+            android:key="capture_both_camera_and_live_view"
+            android:title="@string/pref_capture_both_camera_and_live_view" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_initialize">
+
+        <CheckBoxPreference
+            android:key="auto_connect_to_camera"
+            android:title="@string/pref_auto_connect_camera"
+            android:summary="@string/pref_summary_auto_connect_camera" />
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_detail_settings">
+
+        <PreferenceScreen
+            android:key="opc_settings"
+            android:title="@string/pref_opc_settings"
+            android:summary="@string/pref_summary_opc_settings" />
+
+        <PreferenceScreen
+            android:key="olympus_settings"
+            android:title="@string/pref_olympus_settings"
+            android:summary="@string/pref_summary_olympus_settings" />
+
+        <PreferenceScreen
+            android:key="ricoh_settings"
+            android:title="@string/pref_ricoh_settings"
+            android:summary="@string/pref_summary_ricoh_settings" />
+
+        <PreferenceScreen
+            android:key="theta_settings"
+            android:title="@string/pref_theta_settings"
+            android:summary="@string/pref_summary_theta_settings" />
+
+        <PreferenceScreen
+            android:key="fuji_x_settings"
+            android:title="@string/pref_fuji_x_settings"
+            android:summary="@string/pref_summary_fuji_x_settings" />
+
+        <PreferenceScreen
+            android:key="panasonic_settings"
+            android:title="@string/pref_panasonic_settings"
+            android:summary="@string/pref_summary_panasonic_settings" />
+
+        <PreferenceScreen
+            android:key="sony_settings"
+            android:title="@string/pref_sony_settings"
+            android:summary="@string/pref_summary_sony_settings" />
+
+        <PreferenceScreen
+            android:key="canon_settings"
+            android:title="@string/pref_canon_settings"
+            android:summary="@string/pref_summary_canon_settings" />
+
+        <PreferenceScreen
+            android:key="nikon_settings"
+            android:title="@string/pref_nikon_settings"
+            android:summary="@string/pref_summary_nikon_settings" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_gokigen">
+
+        <Preference
+            android:key="instruction_link"
+            android:title="@string/pref_instruction_manual"
+            android:summary="https://osdn.net/projects/gokigen/wiki/A01d"
+            android:selectable="true">
+            <intent android:action="android.intent.action.VIEW"
+                android:data="https://osdn.net/projects/gokigen/wiki/A01d" />
+        </Preference>
+
+        <Preference
+            android:key="privacy_policy"
+            android:title="@string/pref_privacy_policy"
+            android:summary="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy"
+            android:selectable="true">
+            <intent android:action="android.intent.action.VIEW"
+                android:data="https://osdn.net/projects/gokigen/wiki/PrivacyPolicy" />
+        </Preference>
+
+        <PreferenceScreen
+            android:key="debug_info"
+            android:title="@string/pref_degug_info"
+            android:summary="@string/pref_summary_debug_info" />
+
+    </PreferenceCategory>
+</PreferenceScreen>
index 0f776e5..55595a5 100644 (file)
@@ -8,6 +8,7 @@
             android:icon="@drawable/ic_power_settings_new_black_24dp"
             android:title="@string/pref_exit_power_off_theta" />
 
+<!--
         <ListPreference
             android:title="@string/pref_connection_method"
             android:entryValues="@array/connection_method_value"
@@ -19,7 +20,7 @@
             android:key="wifi_settings"
             android:title="@string/pref_wifi_settings"
             android:summary="@string/pref_summary_wifi_settings" />
-
+-->
     </PreferenceCategory>
 
     <PreferenceCategory
             android:key="use_osc_theta_v21"
             android:title="@string/pref_use_osc_theta_v21"
             android:summary="@string/pref_summary_use_osc_theta_v21"/>
-
+<!--
         <CheckBoxPreference
             android:key="capture_both_camera_and_live_view"
             android:title="@string/pref_capture_both_camera_and_live_view" />
-
+-->
     </PreferenceCategory>
 
+<!--
     <PreferenceCategory
         android:title="@string/pref_cat_initialize">
 
@@ -72,4 +74,5 @@
             android:summary="@string/pref_summary_debug_info" />
 
     </PreferenceCategory>
+-->
 </PreferenceScreen>
index ff5816a..3824f76 100644 (file)
@@ -6,7 +6,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.6.1'
+        classpath 'com.android.tools.build:gradle:4.0.0'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
index 4df5b6f..1d4f4d7 100644 (file)
@@ -1,6 +1,6 @@
-#Wed Feb 26 00:13:03 JST 2020
+#Sat May 30 16:05:10 JST 2020
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip