1 package net.osdn.gokigen.pkremote.camera.vendor.panasonic.operation;
3 import android.content.Context;
5 import androidx.preference.Preference;
7 import net.osdn.gokigen.pkremote.R;
8 import net.osdn.gokigen.pkremote.preference.IPreferencePropertyAccessor;
9 import net.osdn.gokigen.pkremote.scene.ConfirmationDialog;
10 import net.osdn.gokigen.pkremote.scene.IChangeScene;
13 * Preferenceがクリックされた時に処理するクラス
16 public class CameraPowerOffPanasonic implements Preference.OnPreferenceClickListener, ConfirmationDialog.Callback
19 private final Context context;
20 private final IChangeScene changeScene;
21 private String preferenceKey = null;
27 public CameraPowerOffPanasonic(Context context, IChangeScene changeScene)
29 this.context = context;
30 this.changeScene = changeScene;
45 * @param preference クリックしたpreference
46 * @return false : ハンドルしない / true : ハンドルした
49 public boolean onPreferenceClick(Preference preference)
51 if (!preference.hasKey())
56 preferenceKey = preference.getKey();
57 if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
61 ConfirmationDialog dialog = ConfirmationDialog.newInstance(context);
62 dialog.show(R.string.dialog_title_confirmation, R.string.dialog_message_exit_application, this);
75 if (preferenceKey.contains(IPreferencePropertyAccessor.EXIT_APPLICATION))
77 // カメラの電源をOFFにしたうえで、アプリケーションを終了する。
78 changeScene.exitApplication();