OSDN Git Service

FUJI X対応準備。
authorMRSa <mrsa@myad.jp>
Mon, 27 May 2019 15:40:37 +0000 (00:40 +0900)
committerMRSa <mrsa@myad.jp>
Mon, 27 May 2019 15:40:37 +0000 (00:40 +0900)
RICOH GR3のLV表示対応。

16 files changed:
app/src/main/java/net/osdn/gokigen/a01d/A01dMain.java
app/src/main/java/net/osdn/gokigen/a01d/camera/CameraInterfaceProvider.java
app/src/main/java/net/osdn/gokigen/a01d/camera/ICameraConnection.java
app/src/main/java/net/osdn/gokigen/a01d/camera/fujix/operation/CameraPowerOffFujiX.java [new file with mode: 0644]
app/src/main/java/net/osdn/gokigen/a01d/camera/utils/SimpleLiveviewSlicer.java
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewClickTouchListener.java
app/src/main/java/net/osdn/gokigen/a01d/liveview/LiveViewFragment.java
app/src/main/java/net/osdn/gokigen/a01d/preference/IPreferencePropertyAccessor.java
app/src/main/java/net/osdn/gokigen/a01d/preference/fujix/FujiXPreferenceFragment.java [new file with mode: 0644]
app/src/main/res/values-ja/arrays.xml
app/src/main/res/values-ja/strings.xml
app/src/main/res/values/arrays.xml
app/src/main/res/values/strings.xml
app/src/main/res/xml/preferences_fuji_x.xml [new file with mode: 0644]
build.gradle
gradle/wrapper/gradle-wrapper.properties

index a412d25..a7a4fc4 100644 (file)
@@ -19,6 +19,7 @@ import net.osdn.gokigen.a01d.liveview.IStatusViewDrawer;
 import net.osdn.gokigen.a01d.liveview.LiveViewFragment;
 import net.osdn.gokigen.a01d.logcat.LogCatFragment;
 import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
+import net.osdn.gokigen.a01d.preference.fujix.FujiXPreferenceFragment;
 import net.osdn.gokigen.a01d.preference.olympus.PreferenceFragment;
 import net.osdn.gokigen.a01d.preference.ricohgr2.RicohGr2PreferenceFragment;
 import net.osdn.gokigen.a01d.preference.sony.SonyPreferenceFragment;
@@ -221,6 +222,11 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
                 // OPCカメラでない場合には、「OPCカメラのみ有効です」表示をして画面遷移させない
                 Toast.makeText(getApplicationContext(), getText(R.string.only_opc_feature), Toast.LENGTH_SHORT).show();
             }
+            else if (method == ICameraConnection.CameraConnectionMethod.FUJI_X)
+            {
+                // OPCカメラでない場合には、「OPCカメラのみ有効です」表示をして画面遷移させない
+                Toast.makeText(getApplicationContext(), getText(R.string.only_opc_feature), Toast.LENGTH_SHORT).show();
+            }
             else
             {
                 // OPC カメラの場合...
@@ -266,6 +272,8 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
                         preferenceFragment = RicohGr2PreferenceFragment.newInstance(this, this);
                     } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.SONY) {
                         preferenceFragment = SonyPreferenceFragment.newInstance(this, this);
+                    } else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X) {
+                        preferenceFragment = FujiXPreferenceFragment.newInstance(this, this);
                     } else //  if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
                     {
                         preferenceFragment = PreferenceFragment.newInstance(this, interfaceProvider, this);
@@ -543,6 +551,11 @@ public class A01dMain extends AppCompatActivity implements ICameraStatusReceiver
         {
             connection = interfaceProvider.getSonyInterface().getSonyCameraConnection();
         }
+        else if  (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
+        {
+            // TODO: FUJI_X に切り替える
+            connection = interfaceProvider.getSonyInterface().getSonyCameraConnection();
+        }
         else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             connection = interfaceProvider.getOlympusInterface().getOlyCameraConnection();
index b6158fc..aff0b93 100644 (file)
@@ -90,6 +90,10 @@ public class CameraInterfaceProvider implements IInterfaceProvider
             {
                 ret = ICameraConnection.CameraConnectionMethod.RICOH_GR2;
             }
+            else if (connectionMethod.contains("FUJI_X"))
+            {
+                ret = ICameraConnection.CameraConnectionMethod.FUJI_X;
+            }
         }
         catch (Exception e)
         {
index bcddf32..52e9954 100644 (file)
@@ -12,7 +12,8 @@ public interface ICameraConnection
     {
         OPC,
         SONY,
-        RICOH_GR2
+        RICOH_GR2,
+        FUJI_X,
     }
 
     enum CameraConnectionStatus
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/camera/fujix/operation/CameraPowerOffFujiX.java b/app/src/main/java/net/osdn/gokigen/a01d/camera/fujix/operation/CameraPowerOffFujiX.java
new file mode 100644 (file)
index 0000000..66d215a
--- /dev/null
@@ -0,0 +1,76 @@
+package net.osdn.gokigen.a01d.camera.fujix.operation;
+
+import android.content.Context;
+
+import net.osdn.gokigen.a01d.ConfirmationDialog;
+import net.osdn.gokigen.a01d.IChangeScene;
+import net.osdn.gokigen.a01d.R;
+import net.osdn.gokigen.a01d.preference.IPreferencePropertyAccessor;
+
+import androidx.preference.Preference;
+
+public class CameraPowerOffFujiX implements Preference.OnPreferenceClickListener, ConfirmationDialog.Callback
+{
+
+    private final Context context;
+    private final IChangeScene changeScene;
+    private String preferenceKey = null;
+
+    /**
+     *   コンストラクタ
+     *
+     */
+    public CameraPowerOffFujiX(Context context, IChangeScene changeScene)
+    {
+        this.context = context;
+        this.changeScene = changeScene;
+    }
+
+    /**
+     *   クラスの準備
+     *
+     */
+    public void prepare()
+    {
+        // 何もしない
+    }
+
+    /**
+     *
+     *
+     * @param preference クリックしたpreference
+     * @return false : ハンドルしない / true : ハンドルした
+     */
+    @Override
+    public boolean onPreferenceClick(Preference preference)
+    {
+        if (!preference.hasKey())
+        {
+            return (false);
+        }
+
+        preferenceKey = preference.getKey();
+        if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
+        {
+
+            // 確認ダイアログの生成と表示
+            ConfirmationDialog dialog = ConfirmationDialog.newInstance(context);
+            dialog.show(R.string.dialog_title_confirmation, R.string.dialog_message_power_off, this);
+            return (true);
+        }
+        return (false);
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void confirm()
+    {
+        if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
+        {
+            // カメラの電源をOFFにしたうえで、アプリケーションを終了する。
+            changeScene.exitApplication();
+        }
+    }}
index 52cf054..7ac7c32 100644 (file)
@@ -267,7 +267,7 @@ public class SimpleLiveviewSlicer
     public Payload nextPayloadForMotionJpeg()
     {
         int searchIndex = 0;
-        int[] endmarker = { 0xff, 0xd9, 0x0d, 0x0a, 0x0d, 0x0a };
+        int[] endmarker = { 0xff, 0xd9 };
         Payload payload = null;
         try
         {
index 1a29fa8..217a46b 100644 (file)
@@ -68,6 +68,16 @@ class LiveViewClickTouchListener implements View.OnClickListener, View.OnTouchLi
             this.cameraConnection = interfaceProvider.getSonyInterface().getSonyCameraConnection();
             this.zoomLensControl = interfaceProvider.getSonyInterface().getZoomLensControl();
         }
+        else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
+        {
+            // TODO: FUJI_X に変更
+            this.focusingControl = interfaceProvider.getSonyInterface().getFocusingControl();
+            this.captureControl = interfaceProvider.getSonyInterface().getCaptureControl();
+            this.propertyProvider = interfaceProvider.getOlympusInterface().getCameraPropertyProvider();  // 要変更
+            this.cameraInformation = interfaceProvider.getSonyInterface().getCameraInformation();
+            this.cameraConnection = interfaceProvider.getSonyInterface().getSonyCameraConnection();
+            this.zoomLensControl = interfaceProvider.getSonyInterface().getZoomLensControl();
+        }
         else  // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             this.focusingControl = interfaceProvider.getOlympusInterface().getFocusingControl();
index e37756b..be6ee13 100644 (file)
@@ -222,6 +222,17 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
                         focusIndicator.setVisibility(View.INVISIBLE);
                     }
                 }
+                else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
+                {
+                    if (changeLiveViewScale != null)
+                    {
+                        changeLiveViewScale.setVisibility(View.INVISIBLE);
+                    }
+                    if (focusIndicator != null)
+                    {
+                        focusIndicator.setVisibility(View.VISIBLE);
+                    }
+                }
             }
 
             if (manualFocus != null)
@@ -272,6 +283,11 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
         {
             interfaceInjector = interfaceProvider.getSonyInterface().getDisplayInjector();
         }
+        else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
+        {
+            // TODO: FUJI_X に変更
+            interfaceInjector = interfaceProvider.getSonyInterface().getDisplayInjector();
+        }
         else // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             interfaceInjector = interfaceProvider.getOlympusInterface().getDisplayInjector();
@@ -292,6 +308,13 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             this.zoomLensControl = interfaceProvider.getSonyInterface().getZoomLensControl();
             this.cameraInformation = interfaceProvider.getSonyInterface().getCameraInformation();
         }
+        else  if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
+        {
+            // TODO: FUJI_X に変更
+            this.liveViewControl = interfaceProvider.getSonyInterface().getSonyLiveViewControl();
+            this.zoomLensControl = interfaceProvider.getSonyInterface().getZoomLensControl();
+            this.cameraInformation = interfaceProvider.getSonyInterface().getCameraInformation();
+        }
         else //  if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
         {
             this.liveViewControl = interfaceProvider.getOlympusInterface().getLiveViewControl();
@@ -579,6 +602,11 @@ public class LiveViewFragment extends Fragment implements IStatusViewDrawer, IFo
             {
                 lvListener = interfaceProvider.getSonyInterface().getLiveViewListener();
             }
+            else if (connectionMethod == ICameraConnection.CameraConnectionMethod.FUJI_X)
+            {
+                // TODO: FUJI_X に変更
+                lvListener = interfaceProvider.getSonyInterface().getLiveViewListener();
+            }
             else  // if (connectionMethod == ICameraConnection.CameraConnectionMethod.OPC)
             {
                 interfaceProvider.getOlympusLiveViewListener().setOlympusLiveViewListener(liveViewListener);
index 89c443e..ef4f8d0 100644 (file)
@@ -50,6 +50,17 @@ public interface IPreferencePropertyAccessor
     String GR2_LIVE_VIEW = "gr2_display_camera_view";
     String USE_PENTAX_AUTOFOCUS = "use_pentax_autofocus_mode";
 
+    String FUJIX_DISPLAY_CAMERA_VIEW = "fujix_display_camera_view";
+
+    String FUJIX_FOCUS_XY = "fujix_focus_xy";
+    String FUJIX_FOCUS_XY_DEFAULT_VALUE = "7,7";
+
+    String FUJIX_LIVEVIEW_WAIT = "fujix_liveview_wait";
+    String FUJIX_LIVEVIEW_WAIT_DEFAULT_VALUE = "80";
+
+    String FUJIX_COMMAND_POLLING_WAIT = "fujix_liveview_wait";
+    String FUJIX_COMMAND_POLLING_WAIT_DEFAULT_VALUE = "50";
+
     /*
     int CHOICE_SPLASH_SCREEN = 10;
 
diff --git a/app/src/main/java/net/osdn/gokigen/a01d/preference/fujix/FujiXPreferenceFragment.java b/app/src/main/java/net/osdn/gokigen/a01d/preference/fujix/FujiXPreferenceFragment.java
new file mode 100644 (file)
index 0000000..45b44b7
--- /dev/null
@@ -0,0 +1,331 @@
+package net.osdn.gokigen.a01d.preference.fujix;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+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;
+
+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;
+
+/**
+ *
+ *
+ */
+public class FujiXPreferenceFragment  extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener
+{
+    private final String TAG = toString();
+    private SharedPreferences preferences = null;
+    private CameraPowerOffFujiX powerOffController = null;
+    private LogCatViewer logCatViewer = null;
+
+    /**
+     *
+     *
+     */
+    public static FujiXPreferenceFragment newInstance(@NonNull AppCompatActivity context, @NonNull IChangeScene changeScene)
+    {
+        FujiXPreferenceFragment instance = new FujiXPreferenceFragment();
+        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
+        {
+            powerOffController = new CameraPowerOffFujiX(context, changeScene);
+            powerOffController.prepare();
+
+            logCatViewer = new LogCatViewer(changeScene);
+            logCatViewer.prepare();
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     *
+     *
+     */
+    @Override
+    public void onAttach(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.FUJIX_DISPLAY_CAMERA_VIEW)) {
+                editor.putBoolean(IPreferencePropertyAccessor.FUJIX_DISPLAY_CAMERA_VIEW, false);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.FUJIX_FOCUS_XY)) {
+                editor.putString(IPreferencePropertyAccessor.FUJIX_FOCUS_XY, IPreferencePropertyAccessor.FUJIX_FOCUS_XY_DEFAULT_VALUE);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.FUJIX_LIVEVIEW_WAIT)) {
+                editor.putString(IPreferencePropertyAccessor.FUJIX_LIVEVIEW_WAIT, IPreferencePropertyAccessor.FUJIX_LIVEVIEW_WAIT_DEFAULT_VALUE);
+            }
+            if (!items.containsKey(IPreferencePropertyAccessor.FUJIX_COMMAND_POLLING_WAIT)) {
+                editor.putString(IPreferencePropertyAccessor.FUJIX_COMMAND_POLLING_WAIT, IPreferencePropertyAccessor.FUJIX_COMMAND_POLLING_WAIT_DEFAULT_VALUE);
+            }
+            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;
+
+                case IPreferencePropertyAccessor.FUJIX_DISPLAY_CAMERA_VIEW:
+                    value = preferences.getBoolean(key, false);
+                    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_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() + " ");
+
+            findPreference("exit_application").setOnPreferenceClickListener(powerOffController);
+            findPreference("debug_info").setOnPreferenceClickListener(logCatViewer);
+    }
+        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 = (ListPreference) 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 = (CheckBoxPreference) 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();
+        if (activity != null)
+        {
+            activity.runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    try
+                    {
+                        // Preferenceの画面に反映させる
+                        setBooleanPreference(IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, IPreferencePropertyAccessor.AUTO_CONNECT_TO_CAMERA, true);
+                        setBooleanPreference(IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, IPreferencePropertyAccessor.CAPTURE_BOTH_CAMERA_AND_LIVE_VIEW, true);
+                        setBooleanPreference(IPreferencePropertyAccessor.FUJIX_DISPLAY_CAMERA_VIEW, IPreferencePropertyAccessor.FUJIX_DISPLAY_CAMERA_VIEW, false);
+                    }
+                    catch (Exception e)
+                    {
+                        e.printStackTrace();
+                    }
+                }
+            });
+        }
+    }
+
+}
index bd8bdba..2ad2576 100644 (file)
         <item >OPC (Olympus Air)</item>
         <item >Sony</item>
         <item>Ricoh GR II / PENTAX DSLR</item>
+        <item >Fuji X Series</item>
     </string-array>
 
     <string-array name="connection_method_value">
         <item >OPC</item>
         <item >SONY</item>
         <item >RICOH_GR2</item>
+        <item >FUJI_X</item>
     </string-array>
 
 
index b2990b9..7ccd53b 100644 (file)
     <string name="pref_exit_power_off">アプリ終了(とカメラOFF)</string>
     <string name="pref_exit_power_off_sony">アプリ終了</string>
 
+    <string name="pref_exit_power_off_fujix">アプリ終了</string>
+    <string name="pref_fujix_display_camera_view">LVをカメラでも表示</string>
+    <string name="pref_fujix_display_camera_view_summary">お試し:ライブビューをカメラ画面で同時表示します</string>
+    <string name="pref_fujix_focus_xy">フォーカス点数 (default: 7,7)</string>
+    <string name="pref_summary_fujix_focus_xy">フォーカス点数を指定します</string>
+    <string name="pref_fujix_liveview_wait">LV画像受信待ち間隔(default: 80)</string>
+    <string name="pref_summary_fujix_liveview_wait">ライブビュー画像受信間隔を指定します</string>
+    <string name="pref_fujix_command_polling_wait">コマンド間隔(default: 50)</string>
+    <string name="pref_summary_fujix_command_polling_wait">カメラ制御コマンドの間隔を調整します</string>
+
+
     <string name="pref_cat_initialize">起動時設定</string>
     <string name="pref_auto_connect_camera">カメラに自動接続</string>
     <string name="pref_summary_auto_connect_camera">通常、チェックを入れたままご使用ください</string>
@@ -48,6 +59,9 @@
     <string name="pref_camera_version">Camera Version</string>
     <string name="pref_camerakit_version">Camera kit Version</string>
 
+    <string name="pref_cat_others">Other</string>
+    <string name="pref_special_thanks">Special Thanks to</string>
+
     <string name="pref_cat_gokigen">GOKIGEN Project</string>
     <string name="pref_instruction_manual">操作説明</string>
     <string name="pref_privacy_policy">プライバシーポリシー</string>
index ee500ac..59a3e15 100644 (file)
         <item >OPC (Olympus Air)</item>
         <item >Sony</item>
         <item>Ricoh GR II / PENTAX DSLR</item>
+        <item >Fuji X Series</item>
     </string-array>
 
     <string-array name="connection_method_value">
         <item >OPC</item>
         <item >SONY</item>
         <item >RICOH_GR2</item>
+        <item >FUJI_X</item>
     </string-array>
 
     <string-array name="gr2_display_mode">
index 9e21b7a..2d32810 100644 (file)
     <string name="pref_exit_power_off">Exit Application(and Camera OFF)</string>
     <string name="pref_exit_power_off_sony">Exit Application</string>
 
+    <string name="pref_exit_power_off_fujix">Exit Application</string>
+    <string name="pref_fujix_display_camera_view">Use Camera Display</string>
+    <string name="pref_fujix_display_camera_view_summary">EXPERIMENTAL: Shows liveview screen both camera and smartphone.</string>
+    <string name="pref_fujix_focus_xy">Number of Focus Point X,Y (default: 7,7)</string>
+    <string name="pref_summary_fujix_focus_xy"> </string>
+    <string name="pref_fujix_liveview_wait">Liveview receive wait (default: 80)</string>
+    <string name="pref_summary_fujix_liveview_wait"> </string>
+    <string name="pref_fujix_command_polling_wait">Command polling wait (default: 50)</string>
+    <string name="pref_summary_fujix_command_polling_wait"> </string>
 
     <string name="pref_cat_initialize">App. Startup</string>
     <string name="pref_auto_connect_camera">Auto Connect To Camera</string>
@@ -50,6 +59,9 @@
     <string name="pref_camera_version">Camera Version</string>
     <string name="pref_camerakit_version">Camera kit Version</string>
 
+    <string name="pref_cat_others">Other</string>
+    <string name="pref_special_thanks">Special Thanks to</string>
+
     <string name="pref_cat_gokigen">GOKIGEN</string>
     <string name="pref_instruction_manual">A01d Instructions</string>
     <string name="pref_privacy_policy">Privacy Policy</string>
diff --git a/app/src/main/res/xml/preferences_fuji_x.xml b/app/src/main/res/xml/preferences_fuji_x.xml
new file mode 100644 (file)
index 0000000..f531ffd
--- /dev/null
@@ -0,0 +1,93 @@
+<?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_fujix" />
+
+        <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"/>
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_camera">
+
+        <CheckBoxPreference
+            android:key="fujix_display_camera_view"
+            android:title="@string/pref_fujix_display_camera_view"
+            android:summary="@string/pref_fujix_display_camera_view_summary"/>
+
+        <EditTextPreference
+            android:key="fujix_focus_xy"
+            android:title="@string/pref_fujix_focus_xy"
+            android:defaultValue="7,7"
+            android:summary="@string/pref_summary_fujix_focus_xy" />
+
+        <EditTextPreference
+            android:key="fujix_liveview_wait"
+            android:title="@string/pref_fujix_liveview_wait"
+            android:defaultValue="80"
+            android:summary="@string/pref_summary_fujix_liveview_wait" />
+
+        <EditTextPreference
+            android:key="fujix_command_polling_wait"
+            android:title="@string/pref_fujix_command_polling_wait"
+            android:defaultValue="50"
+            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" />
+
+    </PreferenceCategory>
+
+
+    <PreferenceCategory
+        android:title="@string/pref_cat_others">
+        <Preference
+            android:key="special_thanks"
+            android:title="@string/pref_special_thanks"
+            android:summary="https://github.com/hkr/fuji-cam-wifi-tool"
+            android:selectable="true">
+            <intent android:action="android.intent.action.VIEW"
+                android:data="https://github.com/hkr/fuji-cam-wifi-tool" />
+        </Preference>
+
+    </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 5a023be..a6877bc 100644 (file)
@@ -6,7 +6,7 @@ buildscript {
         google()
     }
     dependencies {
-        classpath 'com.android.tools.build:gradle:3.3.2'
+        classpath 'com.android.tools.build:gradle:3.4.1'
 
         // NOTE: Do not place your application dependencies here; they belong
         // in the individual module build.gradle files
index 5672024..6f4d837 100644 (file)
@@ -1,6 +1,6 @@
-#Fri Jan 25 23:31:54 JST 2019
+#Mon May 27 23:33:27 JST 2019
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip