import net.osdn.gokigen.gr2control.liveview.ICameraStatusUpdateNotify;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import jp.co.olympus.camerakit.OLYCamera;
import jp.co.olympus.camerakit.OLYCameraPropertyListener;
currentWBMode = wbMode;
updateReceiver.updatedWBMode(currentWBMode);
}
- String remainBattery = getPropertyTitle(olyCamera, "BATTERY_LEVEL");
- if (!remainBattery.equals(currentRemainBattery))
- {
- currentRemainBattery = remainBattery;
- int percentage = 0;
-
- Log.v(TAG, "currentRemainBattery : " + currentRemainBattery);
- updateReceiver.updateRemainBattery(percentage);
+ try
+ {
+ String remainBattery = olyCamera.getCameraPropertyValue("BATTERY_LEVEL");
+ if (!remainBattery.equals(currentRemainBattery))
+ {
+ Map<String, Integer> batteryIconList = new HashMap<String, Integer>() {
+ {
+ put("<BATTERY_LEVEL/UNKNOWN>" , 0);
+ put("<BATTERY_LEVEL/CHARGE>" , 100);
+ put("<BATTERY_LEVEL/EMPTY>" , 0);
+ put("<BATTERY_LEVEL/WARNING>" , 30);
+ put("<BATTERY_LEVEL/LOW>" , 50);
+ put("<BATTERY_LEVEL/FULL>" , 100);
+ put("<BATTERY_LEVEL/EMPTY_AC>" , 0);
+ put("<BATTERY_LEVEL/SUPPLY_WARNING>", 30);
+ put("<BATTERY_LEVEL/SUPPLY_LOW>" , 50);
+ put("<BATTERY_LEVEL/SUPPLY_FULL>" , 100);
+ }
+ };
+ currentRemainBattery = remainBattery;
+ int percentage = batteryIconList.get(remainBattery);
+ Log.v(TAG, "currentRemainBattery : " + currentRemainBattery + "(" + percentage + ")");
+ updateReceiver.updateRemainBattery(percentage);
+ }
+ }
+ catch (Exception ee)
+ {
+ ee.printStackTrace();
}
String shutterSpeed = getPropertyTitle(olyCamera, "SHUTTER");
if (!shutterSpeed.equals(currentShutterSpeed))
statusNotify.toggleShowGridFrame();
statusViewDrawer.updateGridIcon();
break;
+ case R.id.zoom_in_button:
+ // ズームインのボタンが押された
+ actionZoomin();
+ break;
+ case R.id.zoom_out_button:
+ // ズームアウトのボタンが押された
+ actionZoomout();
+ break;
/*
case R.id.camera_property_settings_button:
// カメラのプロパティ設定
// お気に入り設定のダイアログを表示する
showFavoriteDialog();
break;
-
- case R.id.btn_zoomin:
- // ズームインのボタンが押された
- actionZoomin();
- break;
- case R.id.btn_zoomout:
- // ズームアウトのボタンが押された
- actionZoomout();
- break;
*/
default:
Log.v(TAG, "onClick() : " + id);
import net.osdn.gokigen.gr2control.camera.IFocusingModeNotify;
import net.osdn.gokigen.gr2control.camera.IInterfaceProvider;
import net.osdn.gokigen.gr2control.camera.ILiveViewControl;
+import net.osdn.gokigen.gr2control.camera.IZoomLensControl;
import net.osdn.gokigen.gr2control.liveview.liveviewlistener.ILiveViewListener;
import net.osdn.gokigen.gr2control.preference.IPreferencePropertyAccessor;
import net.osdn.gokigen.gr2control.scene.IChangeScene;
private final String TAG = this.toString();
private ILiveViewControl liveViewControl = null;
- //private IZoomLensControl zoomLensControl = null;
+ private IZoomLensControl zoomLensControl = null;
private IInterfaceProvider interfaceProvider = null;
private IDisplayInjector interfaceInjector = null;
//private OlympusCameraLiveViewListenerImpl liveViewListener = null;
setOnClickListener(view, R.id.camera_power_off_button);
setOnClickListener(view, R.id.show_preference_button);
setOnClickListener(view, R.id.show_hide_grid_button);
+ setOnClickListener(view, R.id.zoom_in_button);
+ setOnClickListener(view, R.id.zoom_out_button);
if (onPanelClickListener == null)
{
this.interfaceProvider = interfaceProvider;
this.interfaceInjector = interfaceProvider.getDisplayInjector();
this.liveViewControl = interfaceProvider.getLiveViewControl();
- //this.zoomLensControl = interfaceProvider.getZoomLensControl();
+ this.zoomLensControl = interfaceProvider.getZoomLensControl();
this.cameraInformation = interfaceProvider.getCameraInformation();
this.statusWatcher = interfaceProvider.getCameraStatusWatcher();
}
// ここでグリッドアイコンを更新する
updateGridIcon();
+ // ここでズームレンズ制御ができるか確認する
+ if ((zoomLensControl != null)&&(zoomLensControl.canZoom()))
+ {
+ //Log.v(TAG, "CAN ZOOM LENS");
+ updateZoomlensControl(true);
+ }
+ else
+ {
+ //Log.v(TAG, "NO ZOOM LENS");
+ updateZoomlensControl(false);
+ }
+
+
// ステータス監視も実施する
startWatchStatus();
}
/**
*
*
+ *
+ */
+ private void updateZoomlensControl(final boolean isVisible)
+ {
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ // isVisibleがtrueなら、ズームレンズボタンを有効にする
+ Activity activity = getActivity();
+ if (activity != null)
+ {
+ try
+ {
+ View view1 = activity.findViewById(R.id.zoom_out_button);
+ if (view1 != null)
+ {
+ view1.setVisibility((isVisible) ? View.VISIBLE : View.INVISIBLE);
+ view1.invalidate();
+ }
+
+ View view2 = activity.findViewById(R.id.zoom_in_button);
+ if (view2 != null)
+ {
+ view2.setVisibility((isVisible) ? View.VISIBLE : View.INVISIBLE);
+ view2.invalidate();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ *
+ *
*/
private void startWatchStatus()
{
iconId = R.drawable.ic_battery_full_black_24dp;
}
final int id = iconId;
+ final boolean isAlert = (percentage < 20);
activity.runOnUiThread(new Runnable()
{
@Override
ImageView view = activity.findViewById(R.id.currentBatteryImageView);
if (view != null)
{
- view.setImageDrawable(ResourcesCompat.getDrawable(getResources(), id, null));
- view.invalidate();
+ Drawable target = ResourcesCompat.getDrawable(getResources(), id, null);
+ if (target != null)
+ {
+ if (isAlert)
+ {
+ DrawableCompat.setTint(target, Color.RED);
+ }
+ view.setImageDrawable(target);
+ view.invalidate();
+ }
}
}
});
if (!items.containsKey(IPreferencePropertyAccessor.SHARE_AFTER_SAVE)) {
editor.putBoolean(IPreferencePropertyAccessor.SHARE_AFTER_SAVE, false);
}
+ if (!items.containsKey(IPreferencePropertyAccessor.USE_PLAYBACK_MENU)) {
+ editor.putBoolean(IPreferencePropertyAccessor.USE_PLAYBACK_MENU, false);
+ }
editor.apply();
}
Log.v(TAG, " " + key + " , " + value);
break;
+ case IPreferencePropertyAccessor.USE_PLAYBACK_MENU:
+ value = preferences.getBoolean(key, false);
+ Log.v(TAG, " " + key + " , " + value);
+ break;
+
default:
String strValue = preferences.getString(key, "");
setListPreference(key, key, strValue);
android:src="@drawable/ic_grid_off_black_24dp"
android:visibility="visible" />
+ <ImageView
+ android:id="@+id/zoom_in_button"
+ android:layout_width="match_parent"
+ android:layout_height="24dp"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_below="@id/show_images_button"
+ android:layout_marginTop="16dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:gravity="center"
+ android:scaleType="fitCenter"
+ android:src="@drawable/ic_add_circle_outline_black_24dp"
+ android:visibility="invisible" />
+
+ <ImageView
+ android:id="@+id/zoom_out_button"
+ android:layout_width="match_parent"
+ android:layout_height="24dp"
+ android:layout_alignParentStart="true"
+ android:layout_alignParentLeft="true"
+ android:layout_above="@id/show_hide_grid_button"
+ android:layout_marginBottom="16dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:gravity="center"
+ android:scaleType="fitCenter"
+ android:src="@drawable/ic_remove_circle_outline_black_24dp"
+ android:visibility="invisible" />
+
</RelativeLayout>
<view
android:layout_height="0dip"
android:layout_weight="1"
android:background="@color/colorBlack">
+
+ <ImageView
+ android:id="@+id/area_spacer001"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:focusable="true"
+ android:gravity="center"
+ android:scaleType="fitCenter"
+ android:visibility="invisible" />
+
+ <ImageView
+ android:id="@+id/zoom_out_button"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:scaleType="fitCenter"
+ android:visibility="invisible"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_remove_circle_outline_black_24dp"
+ android:gravity="center" />
+
+ <ImageView
+ android:id="@+id/area_spacer002"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:focusable="true"
+ android:gravity="center"
+ android:scaleType="fitCenter"
+ android:visibility="invisible" />
+
+ <ImageView
+ android:id="@+id/zoom_in_button"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:scaleType="fitCenter"
+ android:visibility="invisible"
+ android:clickable="true"
+ android:focusable="true"
+ android:src="@drawable/ic_add_circle_outline_black_24dp"
+ android:gravity="center" />
+
+ <ImageView
+ android:id="@+id/area_spacer003"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:clickable="true"
+ android:focusable="true"
+ android:gravity="center"
+ android:scaleType="fitCenter"
+ android:visibility="invisible" />
+
</LinearLayout>
<LinearLayout
<string name="camera_disconnected">切断</string>
<string name="action_synchroize_datetime">時刻の同期</string>
<string name="action_info">情報</string>
- <string name="action_download">画像の取得</string>
- <string name="action_download_movie">動画の取得</string>
- <string name="action_download_original_movie">動画の取得(オリジナルサイズ)</string>
+ <string name="action_download">画像取得</string>
+ <string name="action_download_movie">動画取得</string>
+ <string name="action_download_original_movie">オリジナルサイズ</string>
<string name="action_delete_movie">削除</string>
<string name="action_get_information">画像情報</string>
<string name="action_download_2048x1536">2048 x 1536</string>
<string name="action_download_1920x1440">1920 x 1440</string>
<string name="action_download_1600x1200">1600 x 1200</string>
<string name="action_download_1024x768">1024 x 768</string>
- <string name="action_download_original_size">画像の取得(オリジナルサイズ)</string>
- <string name="action_download_640x480">画像の取得(小さいサイズ)</string>
- <string name="action_download_raw">画像の取得(RAWファイル)</string>
+ <string name="action_download_original_size">オリジナルサイズ</string>
+ <string name="action_download_640x480">小さいサイズ</string>
+ <string name="action_download_raw">RAW</string>
<string name="action_delete_picture">削除</string>
<string name="dialog_get_information_title">画像の情報</string>
<string name="label_aelock">AEL/AFL</string>