public void run() {
try
{
+ String response;
String postData = key + "=" + value;
- String response = SimpleHttpClient.httpPut(statusSetUrl, postData, timeoutMs);
- Log.v(TAG, "SET PROPERTY : " + postData + " resp. (" + response.length() + "bytes.)");
-
+ if (key.equals("exposureMode"))
+ {
+ // 撮影モードを変更するときは、GR専用コマンドを送ることにする。
+ postData = "cmd=" + decideButtonCode(value);
+ response = SimpleHttpClient.httpPost(grCommandUrl, postData, timeoutMs);
+ Log.v(TAG, "CHANGE MODE : " + postData + " resp. (" + response.length() + "bytes.)");
+ } else {
+ // 通常の変更コマンド
+ response = SimpleHttpClient.httpPut(statusSetUrl, postData, timeoutMs);
+ Log.v(TAG, "SET PROPERTY : " + postData + " resp. (" + response.length() + "bytes.)");
+ }
// GR専用コマンドで、画面表示をリフレッシュ
response = SimpleHttpClient.httpPost(grCommandUrl, "cmd=mode refresh", timeoutMs);
Log.v(TAG, "refresh resp. (" + response.length() + "bytes.)");
e.printStackTrace();
}
}
+
+ /**
+ * 撮影モードをGRのダイアルコマンドに変更する
+ *
+ */
+ private String decideButtonCode(String exposureMode)
+ {
+ String buttonCode = "bdial AUTO";
+ if (exposureMode == null)
+ {
+ return (buttonCode);
+ }
+ switch (exposureMode)
+ {
+ case "movie":
+ buttonCode = "bdial MOVIE";
+ break;
+ case "M":
+ buttonCode = "bdial M";
+ break;
+ case "TAV":
+ buttonCode = "bdial TAV";
+ break;
+ case "AV":
+ buttonCode = "bdial AV";
+ break;
+ case "TV":
+ buttonCode = "bdial TV";
+ break;
+ case "P":
+ buttonCode = "bdial P";
+ break;
+ case "auto":
+ buttonCode = "bdial AUTO";
+ break;
+ }
+ return (buttonCode);
+ }
}
{
try
{
- int id = (imageView.isShowGrid()) ? R.drawable.ic_grid_off_black_24dp : R.drawable.ic_grid_on_black_24dp;
- if (showGrid == null)
+ Activity activity = getActivity();
+ if (activity != null)
{
- Activity activity = getActivity();
- if (activity != null)
- {
+ if (showGrid == null) {
showGrid = activity.findViewById(R.id.show_hide_grid_button);
}
+ activity.runOnUiThread(new Runnable() {
+ @Override
+ public void run()
+ {
+ int id = (imageView.isShowGrid()) ? R.drawable.ic_grid_off_black_24dp : R.drawable.ic_grid_on_black_24dp;
+ if (showGrid != null)
+ {
+ showGrid.setImageDrawable(ResourcesCompat.getDrawable(getResources(), id, null));
+ showGrid.invalidate();
+ }
+ imageView.invalidate();
+ }
+ });
}
- showGrid.setImageDrawable(ResourcesCompat.getDrawable(getResources(), id, null));
- showGrid.invalidate();
- imageView.invalidate();
}
catch (Exception e)
{
}
@Override
- public void updateFocusedStatus(boolean focused)
+ public void updateFocusedStatus(final boolean focused)
{
Activity activity = getActivity();
try
{
if (activity != null)
{
- ImageView view = getActivity().findViewById(R.id.focusUnlockImageView);
- if (focused)
- {
- Drawable icon = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_center_focus_strong_black_24dp, null);
- if (icon != null)
- {
- DrawableCompat.setTint(icon, Color.GREEN);
- view.setImageDrawable(icon);
- }
- }
- else
- {
- Drawable icon = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_crop_free_black_24dp, null);
- if (icon != null)
- {
- DrawableCompat.setTint(icon, Color.BLACK);
- view.setImageDrawable(icon);
+ activity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ ImageView view = getActivity().findViewById(R.id.focusUnlockImageView);
+ if (focused)
+ {
+ Drawable icon = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_center_focus_strong_black_24dp, null);
+ if (icon != null)
+ {
+ DrawableCompat.setTint(icon, Color.GREEN);
+ view.setImageDrawable(icon);
+ }
+ }
+ else
+ {
+ Drawable icon = ResourcesCompat.getDrawable(getResources(), R.drawable.ic_crop_free_black_24dp, null);
+ if (icon != null)
+ {
+ DrawableCompat.setTint(icon, Color.BLACK);
+ view.setImageDrawable(icon);
+ }
+ }
+ view.invalidate();
}
- }
- view.invalidate();
+ });
}
}
catch (Exception e)
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <string-array name="connection_method">
+ <item>Ricoh GR II</item>
+ <item>OPC(Olympus Air)</item>
+ </string-array>
+
+ <string-array name="connection_method_value">
+ <item >RICOH_GR2</item>
+ <item>OPC</item>
+ </string-array>
+
+ <string-array name="gr2_display_mode">
+ <item >0</item>
+ <item >1</item>
+ <item >2</item>
+ <item >3</item>
+ </string-array>
+
+ <string-array name="gr2_display_mode_value">
+ <item >0</item>
+ <item >1</item>
+ <item >2</item>
+ <item >3</item>
+ </string-array>
+
+ <string-array name="exif_exposure_program_value">
+ <item>Unknown</item>
+ <item>Manual</item>
+ <item>Program</item>
+ <item>Aperture priority</item>
+ <item>Shutter priority</item>
+ <item>Creative Program</item>
+ <item>Action Program</item>
+ <item>Portrait mode</item>
+ <item>Landscape mode</item>
+ <item>Other</item>
+ </string-array>
+
+ <string-array name="exif_metering_mode_value">
+ <item>Unknown</item>
+ <item>Average</item>
+ <item>CenterWeightedAverage</item>
+ <item>Spot</item>
+ <item>MutiSpot</item>
+ <item>Pattern</item>
+ <item>Partial</item>
+ <item>Other</item>
+ </string-array>
+
+ <string-array name="sound_volume_level">
+ <item >OFF</item>
+ <item >1</item>
+ <item >2</item>
+ <item >3</item>
+ <item >4</item>
+ <item >5</item>
+ </string-array>
+
+ <string-array name="sound_volume_level_value">
+ <item >OFF</item>
+ <item >1</item>
+ <item >2</item>
+ <item >3</item>
+ <item >4</item>
+ <item >5</item>
+ </string-array>
+
+ <string-array name="live_view_quality">
+ <item >QVGA (320x240)</item>
+ <item >VGA (640x480)</item>
+ <item >SVGA (800x600)</item>
+ <item >XGA (1024x768)</item>
+ <item >QUAD VGA (1280x960)</item>
+ </string-array>
+
+ <string-array name="live_view_quality_value">
+ <item >QVGA</item>
+ <item >VGA</item>
+ <item >SVGA</item>
+ <item >XGA</item>
+ <item >QUAD_VGA</item>
+ </string-array>
+
+</resources>