package net.osdn.gokigen.pkremote.camera.vendor.pixpro.wrapper.playback;
-import android.util.Log;
import android.util.Xml;
import androidx.annotation.NonNull;
class PixproContentListParser
{
- private final String TAG = toString();
+ //private final String TAG = toString();
private static final String CAMERACONTENT_TAG = "File";
private static final String PATHROOT_TAG = "PATHROOT";
private static final String NAME_TAG = "NAME";
private static final String DCFINDEX_TAG = "DCFINDEX";
private static final String ATTR_TAG = "ATTR";
- private List<PixproCameraContent> contentList;
- private String pathRoot;
+ private String pathRoot = null;
+// private List<PixproCameraContent> contentList;
PixproContentListParser()
{
- contentList = new ArrayList<>();
+ //contentList = new ArrayList<>();
}
public List<ICameraContent> parseContentList(@NonNull String receivedMessage)
// 受信したボディを解析して、画像一覧を cameraContentList に入れる
List<ICameraContent> cameraContentList = new ArrayList<>();
PixproCameraContent cameraContent = null;
- contentList.clear();
+ //contentList.clear();
try
{
String tagName = null;
{
if (tag.matches(CAMERACONTENT_TAG))
{
+ //contentList.add(cameraContent);
cameraContentList.add(cameraContent);
- contentList.add(cameraContent);
cameraContent = null;
}
- Log.v(TAG, " ----- END TAG : " + tag + " ------ ");
+ //Log.v(TAG, " ----- END TAG : " + tag + " ------ ");
}
tagName = null; // parser.getName();
}
private void parseData(@NonNull String tagName, @Nullable String content, @Nullable PixproCameraContent cameraContent)
{
- Log.v(TAG, " ----- " + tagName + " : " + content + " ------ ");
+ //Log.v(TAG, " ----- " + tagName + " : " + content + " ------ ");
try
{
if (tagName.matches(PATHROOT_TAG))
Log.v(TAG, " RECEIVED CONTENT REPLY : " + receivedMessage.length());
List<ICameraContent> cameraContentList = contentListParser.parseContentList(receivedMessage);
callback.onCompleted(cameraContentList);
+ System.gc();
}
catch (Exception e)
{
private String getConnectionString()
{
- String connectionString = keyProvider.getUserString() + "&" + keyProvider.getPasswordString();
- Log.v(TAG, " connectionString : " + connectionString);
- return (connectionString);
+ return (keyProvider.getUserString() + "&" + keyProvider.getPasswordString());
+ // Log.v(TAG, " connectionString : " + connectionString);
+ //return (connectionString);
}
}
import androidx.fragment.app.FragmentTransaction;
import androidx.preference.PreferenceManager;
+import static net.osdn.gokigen.pkremote.preference.IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE;
+import static net.osdn.gokigen.pkremote.preference.IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE;
+
/**
*
*
private String filterLabel = null;
private int currentSelectedIndex = 0;
private boolean fragmentIsActive = false;
+ private int imageCacheSize = 120;
public static ImageGridViewFragment newInstance(@NonNull IInterfaceProvider interfaceProvider)
private void setControllers(@NonNull IInterfaceProvider interfaceProvider)
{
- this.interfaceProvider = interfaceProvider;
- this.playbackControl = interfaceProvider.getPlaybackControl();
- this.runMode = interfaceProvider.getCameraRunMode();
- Activity activity = getActivity();
- if (activity != null)
+ try
{
- this.contentDownloader = new MyContentDownloader(getActivity(), playbackControl, null);
+ this.interfaceProvider = interfaceProvider;
+ this.playbackControl = interfaceProvider.getPlaybackControl();
+ this.runMode = interfaceProvider.getCameraRunMode();
+ Activity activity = getActivity();
+ if (activity != null)
+ {
+ this.contentDownloader = new MyContentDownloader(activity, playbackControl, null);
+ }
+ else
+ {
+ this.contentDownloader = null;
+ }
}
- else
+ catch (Exception e)
{
- this.contentDownloader = null;
+ e.printStackTrace();
}
}
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
- Log.v(TAG, "ImageGridViewFragment::onCreate()");
- imageCache = new LruCache<>(120);
+ Activity activity = getActivity();
+ if (activity != null)
+ {
+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(activity);
+ String cacheSizeStr = preferences.getString(THUMBNAIL_IMAGE_CACHE_SIZE, THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ try
+ {
+ imageCacheSize = Integer.parseInt(cacheSizeStr);
+ }
+ catch (Exception ee)
+ {
+ ee.printStackTrace();
+ imageCacheSize = 120;
+ }
+ }
+ Log.v(TAG, "ImageGridViewFragment::onCreate() cache : " + imageCacheSize);
+
+ imageCache = new LruCache<>(imageCacheSize);
executor = Executors.newFixedThreadPool(1);
setHasOptionsMenu(true);
}
String PIXPRO_GET_PICS_LIST_TIMEOUT = "pixpro_get_pics_list_timeout";
String PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE = "30";
+ String THUMBNAIL_IMAGE_CACHE_SIZE = "thumbnail_image_cache_size";
+ String THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE = "120";
+
/*
//String GR2_DISPLAY_MODE = "gr2_display_mode";
//String GR2_DISPLAY_MODE_DEFAULT_VALUE = "0";
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.CANON_RAW_SUFFIX)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.CANON_RAW_SUFFIX))
+ {
editor.putString(IPreferencePropertyAccessor.CANON_RAW_SUFFIX, IPreferencePropertyAccessor.CANON_RAW_SUFFIX_DEFAULT_VALUE);
}
- if (!items.containsKey(IPreferencePropertyAccessor.CANON_RECEIVE_WAIT)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.CANON_RECEIVE_WAIT))
+ {
editor.putString(IPreferencePropertyAccessor.CANON_RECEIVE_WAIT, IPreferencePropertyAccessor.CANON_RECEIVE_WAIT_DEFAULT_VALUE);
}
- if (!items.containsKey(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL))
+ {
editor.putBoolean(IPreferencePropertyAccessor.CANON_USE_SCREENNAIL_AS_SMALL, false);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
if (!items.containsKey(IPreferencePropertyAccessor.FUJIX_CONNECTION_FOR_READ)) {
editor.putBoolean(IPreferencePropertyAccessor.FUJIX_CONNECTION_FOR_READ, false);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
if (!items.containsKey(IPreferencePropertyAccessor.BLE_WIFI_ON)) {
editor.putBoolean(IPreferencePropertyAccessor.BLE_WIFI_ON, false);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
if (!items.containsKey(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE)) {
editor.putString(IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE, IPreferencePropertyAccessor.PEN_SMALL_PICTURE_SIZE_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
if (!items.containsKey(IPreferencePropertyAccessor.OLYMPUS_USE_SCREENNAIL_AS_SMALL)) {
editor.putBoolean(IPreferencePropertyAccessor.OLYMPUS_USE_SCREENNAIL_AS_SMALL, false);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
{
editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
+ }
if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
{
editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
{
editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
//super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences_pixpro);
- ListPreference connectionMethod = (ListPreference) findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
+ ListPreference connectionMethod = findPreference(IPreferencePropertyAccessor.CONNECTION_METHOD);
if (connectionMethod != null)
{
connectionMethod.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
{
try
{
- ListPreference 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);
}
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.USE_PLAYBACK_MENU)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_PLAYBACK_MENU))
+ {
editor.putBoolean(IPreferencePropertyAccessor.USE_PLAYBACK_MENU, 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_DISPLAY_CAMERA_VIEW)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.GR2_DISPLAY_CAMERA_VIEW))
+ {
editor.putBoolean(IPreferencePropertyAccessor.GR2_DISPLAY_CAMERA_VIEW, true);
}
- 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.SHARE_AFTER_SAVE)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.SHARE_AFTER_SAVE))
+ {
editor.putBoolean(IPreferencePropertyAccessor.SHARE_AFTER_SAVE, false);
}
- if (!items.containsKey(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND))
+ {
editor.putBoolean(IPreferencePropertyAccessor.USE_GR2_SPECIAL_COMMAND, true);
}
- if (!items.containsKey(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF))
+ {
editor.putBoolean(IPreferencePropertyAccessor.PENTAX_CAPTURE_AFTER_AF, false);
}
- if (!items.containsKey(IPreferencePropertyAccessor.SMALL_PICTURE_SIZE)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.SMALL_PICTURE_SIZE))
+ {
editor.putString(IPreferencePropertyAccessor.SMALL_PICTURE_SIZE, IPreferencePropertyAccessor.SMALL_PICTURE_SIZE_DEFAULT_VALUE);
}
- if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT))
+ {
editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
}
- if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT))
+ {
editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_MAX_COUNT_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
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);
}
- if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
}
- if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE)) {
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
if (!items.containsKey(IPreferencePropertyAccessor.CONNECTION_METHOD)) {
editor.putString(IPreferencePropertyAccessor.CONNECTION_METHOD, IPreferencePropertyAccessor.CONNECTION_METHOD_DEFAULT_VALUE);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.GET_SMALL_PICTURE_AS_VGA, false);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE))
+ {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_SMARTPHONE_TRANSFER_MODE, false);
+ }
if (!items.containsKey(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT)) {
editor.putString(IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.RICOH_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
}
if (!items.containsKey(IPreferencePropertyAccessor.USE_OSC_THETA_V21)) {
editor.putBoolean(IPreferencePropertyAccessor.USE_OSC_THETA_V21, false);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_HOST_IP))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_HOST_IP, IPreferencePropertyAccessor.PIXPRO_HOST_IP_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT, IPreferencePropertyAccessor.PIXPRO_COMMAND_PORT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT))
+ {
+ editor.putString(IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT, IPreferencePropertyAccessor.PIXPRO_GET_PICS_LIST_TIMEOUT_DEFAULT_VALUE);
+ }
+ if (!items.containsKey(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE))
+ {
+ editor.putString(IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE, IPreferencePropertyAccessor.THUMBNAIL_IMAGE_CACHE_SIZE_DEFAULT_VALUE);
+ }
editor.apply();
}
catch (Exception e)
<string name="pref_pixpro_get_pics_list_timeout">撮影画像一覧取得時のタイムアウト(単位:秒)</string>
<string name="pref_summary_pixpro_get_pics_list_timeout">通常、変更は不要です (初期値:30)</string>
+ <string name="pref_thumbnail_image_cache_size">サムネイル画像キャッシュ数</string>
+ <string name="pref_summary_thumbnail_image_cache_size">小メモリ機の場合には、この値を減らしてください。(初期値:120)</string>
+
</resources>
<string name="pref_pixpro_get_pics_list_timeout">Get Pics List Timeout(unit: sec.)</string>
<string name="pref_summary_pixpro_get_pics_list_timeout">If the camera has many number of Pics, increase number.</string>
+ <string name="pref_thumbnail_image_cache_size">Thumbnail image cache size</string>
+ <string name="pref_summary_thumbnail_image_cache_size">If you use low memory machine, please decrease this value.(default:120)</string>
+
</resources>
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<PreferenceCategory
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<PreferenceCategory
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<PreferenceCategory
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<PreferenceCategory
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</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" />
+ android:key="auto_connect_to_camera"
+ android:title="@string/pref_auto_connect_camera"
+ android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<PreferenceCategory
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<!--
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<PreferenceCategory
android:key="auto_connect_to_camera"
android:title="@string/pref_auto_connect_camera"
android:summary="@string/pref_summary_auto_connect_camera" />
+
+ <EditTextPreference
+ android:key="thumbnail_image_cache_size"
+ android:title="@string/pref_thumbnail_image_cache_size"
+ android:defaultValue="120"
+ android:inputType="number"
+ android:summary="@string/pref_summary_thumbnail_image_cache_size" />
+
</PreferenceCategory>
<PreferenceCategory