import java.text.DateFormat;
import java.util.Date;
+import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import jp.co.olympus.camerakit.OLYCamera;
+import jp.co.olympus.camerakit.OLYCameraKitException;
import jp.sfjp.gokigen.a01c.olycamerawrapper.IOLYCameraObjectProvider;
/**
{
Log.v(TAG, "loadCameraSettings() : START [" + idHeader + "]");
//loadCameraSettingsBatch(idHeader);
+ //loadCameraSettingsMiniBatch(idHeader);
loadCameraSettingsSequential(idHeader);
}
Log.v(TAG, "loadCameraSettingsSequential() : END [" + idHeader + "]" + " " + setCount);
}
}
-/*
+/**/
//// プロパティの一括設定
private void loadCameraSettingsBatch(String idHeader)
{
Log.v(TAG, "loadCameraSettingsBatch() : END [" + idHeader + "]" + " " + values.size());
}
}
-*/
+
+ //// プロパティの一括設定
+ private void loadCameraSettingsMiniBatch(String idHeader)
+ {
+ // Restores my settings.
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(parent);
+ if (camera.isConnected())
+ {
+ String takeModeValue = preferences.getString(idHeader + TAKEMODE, null);
+ try
+ {
+ // TAKEMODE だけは先行して設定する(設定できないカメラプロパティもあるので...)
+ if (takeModeValue != null)
+ {
+ camera.setCameraPropertyValue(TAKEMODE, takeModeValue);
+ Log.v(TAG, "loadCameraSettings() TAKEMODE : " + takeModeValue);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ Log.v(TAG, "loadCameraSettings() : setCameraPropertyValue() fail...");
+ }
+
+ Map<String, String> values = new HashMap<>();
+ Set<String> names = camera.getCameraPropertyNames();
+ for (String name : names)
+ {
+ String value = preferences.getString(idHeader + name, null);
+ if (value != null)
+ {
+ if (propertyProvider.canSetCameraProperty(name))
+ {
+ // Read Onlyのプロパティを除外して登録
+ values.put(name, value);
+ Log.v(TAG, "loadCameraSettings(): " + value);
+ }
+ }
+ }
+ if (values.size() > 0)
+ {
+ try
+ {
+ camera.setCameraPropertyValues(values);
+ }
+ catch (OLYCameraKitException e)
+ {
+ Log.w(TAG, "To change the camera properties is failed: " + e.getMessage());
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ Log.v(TAG, "loadCameraSettingsBatch() : END [" + idHeader + "]" + " " + values.size());
+ }
+ }
}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="horizontal"
+ >
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="26dp"
+ android:layout_height="wrap_content"
+ android:textStyle="normal"
+ android:textSize="6pt"
+ android:clickable="false"
+ android:focusable="false"
+ android:tag="id"
+ />
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="80dp"
+ android:layout_height="wrap_content"
+ android:textSize="4pt"
+ android:clickable="false"
+ android:focusable="false"
+ android:tag="info"
+ />
+
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textStyle="normal"
+ android:textSize="9pt"
+ android:clickable="false"
+ android:focusable="false"
+ android:tag="title"
+ />
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="horizontal"
+ >
+ <TextView
+ android:layout_width="0px"
+ android:layout_height="0px"
+ />
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="5pt"
+ android:tag="id"
+ />
+ <Button xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:tag="button"
+ android:text="@string/save_props"
+ />
+ <EditText xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="88dp"
+ android:layout_height="wrap_content"
+ android:hint="@string/hint_save_props"
+ android:textSize="8pt"
+ android:tag="title"
+ />
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="4pt"
+ android:tag="info"
+ />
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ >
+ <android.support.v4.app.FragmentTabHost
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/tabHost01"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ </android.support.v4.app.FragmentTabHost>
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/pager"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"/>
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ >
+ <ListView
+ android:id="@id/android:list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scrollbars="vertical"
+ android:scrollbarFadeDuration="1000000"/>
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="horizontal"
+ >
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="26dp"
+ android:layout_height="wrap_content"
+ android:textStyle="normal"
+ android:textSize="6pt"
+ android:clickable="false"
+ android:focusable="false"
+ android:tag="id"
+ />
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="80dp"
+ android:layout_height="wrap_content"
+ android:textSize="4pt"
+ android:clickable="false"
+ android:focusable="false"
+ android:tag="info"
+ />
+
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textStyle="normal"
+ android:textSize="9pt"
+ android:clickable="false"
+ android:focusable="false"
+ android:tag="title"
+ />
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="horizontal"
+ >
+ <TextView
+ android:layout_width="0px"
+ android:layout_height="0px"
+ />
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="5pt"
+ android:tag="id"
+ />
+ <Button xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:tag="button"
+ android:text="@string/save_props"
+ />
+ <EditText xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="88dp"
+ android:layout_height="wrap_content"
+ android:hint="@string/hint_save_props"
+ android:textSize="8pt"
+ android:tag="title"
+ />
+ <TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="4pt"
+ android:tag="info"
+ />
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ >
+ <android.support.v4.app.FragmentTabHost
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/tabHost01"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ </android.support.v4.app.FragmentTabHost>
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/pager"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center"/>
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ >
+ <ListView
+ android:id="@id/android:list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scrollbars="vertical"
+ android:scrollbarFadeDuration="1000000"/>
+</LinearLayout>