--- /dev/null
+<?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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="Encoding" addBOMForNewFiles="with NO BOM" />
+</project>
\ No newline at end of file
--- /dev/null
+<?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
--- /dev/null
+<?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
--- /dev/null
+<?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
--- /dev/null
+<?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
--- /dev/null
+<?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
--- /dev/null
+<?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
applicationId "net.osdn.gokigen.a01d"
minSdkVersion 14
targetSdkVersion 29
- versionCode 10701
- versionName "1.7.1"
+ versionCode 10702
+ versionName "1.7.2"
}
buildTypes {
release {
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'
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;
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;
{
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)
}
}
+ @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();
+ }
+ }
+
/**
* デバッグ情報画面を開く
*
package net.osdn.gokigen.a01d;
+import net.osdn.gokigen.a01d.camera.ICameraConnection;
+
/**
*
*/
{
void changeSceneToCameraPropertyList();
void changeSceneToConfiguration();
+ void changeSceneToConfiguration(ICameraConnection.CameraConnectionMethod connectionMethod);
void changeCameraConnection();
void changeSceneToDebugInformation();
void changeSceneToApiList();
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;
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;
/**
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private PtpIpCameraPowerOff powerOffController = null;
- private LogCatViewer logCatViewer = null;
/**
*
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)
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:
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)
{
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;
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;
/**
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private CameraPowerOffFujiX powerOffController = null;
- private LogCatViewer logCatViewer = null;
/**
*
powerOffController = new CameraPowerOffFujiX(context, changeScene);
powerOffController.prepare();
- logCatViewer = new LogCatViewer(changeScene);
- logCatViewer.prepare();
-
this.context = context;
}
catch (Exception e)
*
*/
@Override
- public void onAttach(Context activity)
+ public void onAttach(@NonNull Context activity)
{
super.onAttach(activity);
Log.v(TAG, "onAttach()");
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:
//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)
{
{
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);
{
try
{
- CheckBoxPreference pref = (CheckBoxPreference) findPreference(pref_key);
+ CheckBoxPreference pref = findPreference(pref_key);
if (pref != null) {
boolean value = preferences.getBoolean(key, defaultValue);
pref.setChecked(value);
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;
/**
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private PtpIpCameraPowerOff powerOffController = null;
- private LogCatViewer logCatViewer = null;
/**
*
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)
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:
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)
{
{
super.onResume();
Log.v(TAG, "onResume() Start");
-
try
{
synchronizedProperty();
{
e.printStackTrace();
}
-
Log.v(TAG, "onResume() End");
-
}
/**
{
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);
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)
{
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:
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;
/**
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private OlympusPenCameraPowerOff powerOffController = null;
- private LogCatViewer logCatViewer = null;
- //private PanasonicCameraApiListViewer cameraApiListViewer = null;
/**
*
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)
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();
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:
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)
{
public void onResume()
{
super.onResume();
- Log.v(TAG, "onResume() Start");
+ Log.v(TAG, "onResume() Start");
try
{
synchronizedProperty();
{
e.printStackTrace();
}
-
Log.v(TAG, "onResume() End");
-
}
/**
{
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);
try
{
CheckBoxPreference pref = findPreference(pref_key);
- if (pref != null) {
+ if (pref != null)
+ {
boolean value = preferences.getBoolean(key, defaultValue);
pref.setChecked(value);
}
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;
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private CameraPowerOffPanasonic powerOffController = null;
- private LogCatViewer logCatViewer = null;
- //private PanasonicCameraApiListViewer cameraApiListViewer = null;
/**
*
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)
*
*/
@Override
- public void onAttach(Context activity)
+ public void onAttach(@NonNull Context activity)
{
super.onAttach(activity);
Log.v(TAG, "onAttach()");
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:
//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)
{
public void onResume()
{
super.onResume();
- Log.v(TAG, "onResume() Start");
+ Log.v(TAG, "onResume() Start");
try
{
synchronizedProperty();
{
e.printStackTrace();
}
-
Log.v(TAG, "onResume() End");
-
}
/**
{
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);
{
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);
}
}
}
-
@Override
public boolean onPreferenceClick(Preference preference)
{
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;
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
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private CameraPowerOffRicohGr2 powerOffController = null;
- private LogCatViewer logCatViewer = null;
/**
*
powerOffController = new CameraPowerOffRicohGr2(context, changeScene);
powerOffController.prepare();
- logCatViewer = new LogCatViewer(changeScene);
- logCatViewer.prepare();
-
this.context = context;
}
catch (Exception e)
*
*/
@Override
- public void onAttach(Context activity)
+ public void onAttach(@NonNull Context activity)
{
super.onAttach(activity);
Log.v(TAG, "onAttach()");
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();
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:
//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)
{
try
{
ListPreference pref;
- pref = (ListPreference) findPreference(pref_key);
+ pref = findPreference(pref_key);
String value = preferences.getString(key, defaultValue);
if (pref != null)
{
{
try
{
- CheckBoxPreference pref = (CheckBoxPreference) findPreference(pref_key);
+ CheckBoxPreference pref = findPreference(pref_key);
if (pref != null) {
boolean value = preferences.getBoolean(key, defaultValue);
pref.setChecked(value);
}
}
-
@Override
public boolean onPreferenceClick(Preference preference)
{
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;
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;
/**
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private CameraPowerOffSony powerOffController = null;
- private LogCatViewer logCatViewer = null;
private SonyCameraApiListViewer cameraApiListViewer = null;
/**
powerOffController = new CameraPowerOffSony(context, changeScene);
powerOffController.prepare();
- logCatViewer = new LogCatViewer(changeScene);
- logCatViewer.prepare();
-
cameraApiListViewer = new SonyCameraApiListViewer(changeScene);
cameraApiListViewer.prepare();
*
*/
@Override
- public void onAttach(Context activity)
+ public void onAttach(@NonNull Context activity)
{
super.onAttach(activity);
Log.v(TAG, "onAttach()");
{
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:
//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)
{
public void onResume()
{
super.onResume();
- Log.v(TAG, "onResume() Start");
+ Log.v(TAG, "onResume() Start");
try
{
synchronizedProperty();
{
e.printStackTrace();
}
-
Log.v(TAG, "onResume() End");
-
}
/**
{
try
{
- ListPreference pref;
- pref = (ListPreference) findPreference(pref_key);
+ ListPreference pref = findPreference(pref_key);
String value = preferences.getString(key, defaultValue);
if (pref != null)
{
{
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);
}
--- /dev/null
+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);
+ }
+}
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;
/**
private AppCompatActivity context = null;
private SharedPreferences preferences = null;
private PtpIpCameraPowerOff powerOffController = null;
- private LogCatViewer logCatViewer = null;
/**
*
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)
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:
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)
{
try
{
ListPreference pref;
- pref = (ListPreference) findPreference(pref_key);
+ pref = findPreference(pref_key);
String value = preferences.getString(key, defaultValue);
if (pref != null)
{
<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>
<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>
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
<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>
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"
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">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
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"
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>
</Preference>
</PreferenceCategory>
-
+<!--
<PreferenceCategory
android:title="@string/pref_cat_gokigen">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
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"
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">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
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"
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">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
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">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
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">
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">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
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"
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">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
--- /dev/null
+<?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>
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"
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">
android:summary="@string/pref_summary_debug_info" />
</PreferenceCategory>
+-->
</PreferenceScreen>
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
-#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