+
+ @Override
+ public void updateFocusedStatus(final boolean focused, final boolean focusLocked)
+ {
+ final FragmentActivity activity = getActivity();
+ try
+ {
+ if (activity != null)
+ {
+ activity.runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ try
+ {
+ ImageView view = activity.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_focus_free_black_24dp, null);
+ if (icon != null) {
+ int color = Color.BLACK;
+ if (focusLocked) {
+ color = Color.RED;
+ }
+ DrawableCompat.setTint(icon, color);
+ view.setImageDrawable(icon);
+ }
+ }
+ view.invalidate();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+ });
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void updateIsoSensitivity(String sv)
+ {
+ Log.v(TAG, "updateIsoSensitivity : " + sv);
+ }
+
+ @Override
+ public void updateWarning(String warning)
+ {
+ Log.v(TAG, "updateWarning : " + warning);
+ }
+
+ @Override
+ public void updateStorageStatus(String status)
+ {
+ Log.v(TAG, "updateStorageStatus : " + status);
+ }
+
+ @Override
+ public void updateToggleButton(boolean isOn)
+ {
+ try
+ {
+ FragmentActivity activity = getActivity();
+ if (activity != null)
+ {
+ ImageView imageView = activity.findViewById(R.id.button_toggle_aeaf);
+ if (isOn)
+ {
+ imageView.setImageDrawable(ContextCompat.getDrawable(activity,R.drawable.ic_radio_button_checked_black_24dp));
+ }
+ else
+ {
+ imageView.setImageDrawable(ContextCompat.getDrawable(activity,R.drawable.ic_radio_button_unchecked_black_24dp));
+ }
+ imageView.invalidate();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public void updateLcdOnOff(boolean isOn)
+ {
+ Log.v(TAG, "updateLcdOnOff() " + isOn);
+ }
+
+ @Override
+ public void updateAFLlever(boolean isCaf)
+ {
+ try
+ {
+ FragmentActivity activity = getActivity();
+ if (activity != null)
+ {
+ TextView textView = activity.findViewById(R.id.lever_ael_caf);
+ if (isCaf)
+ {
+ textView.setText(getString(R.string.label_c_af));
+ }
+ else
+ {
+ textView.setText(getString(R.string.label_aelock));
+ }
+ textView.invalidate();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public boolean handleKeyDown(int keyCode, KeyEvent event)
+ {
+ return (onClickTouchListener.onKey(null, keyCode, event));
+ }