• R/O
  • SSH
  • HTTPS

gokigen: Commit


Commit MetaInfo

Revision481 (tree)
Zeit2021-04-29 11:06:31
Autormrsa

Log Message

若干の安定性を強化。

Ändern Zusammenfassung

Diff

--- android/AirA01a/trunk/app/src/main/java/jp/osdn/gokigen/aira01a/liveview/CameraLiveImageView.java (revision 480)
+++ android/AirA01a/trunk/app/src/main/java/jp/osdn/gokigen/aira01a/liveview/CameraLiveImageView.java (revision 481)
@@ -457,8 +457,15 @@
457457 if (selfTimerRemainSecond > 0)
458458 {
459459 Paint paint = new Paint();
460- paint.setColor(Color.WHITE);
461- paint.setTextSize(80);
460+ if (selfTimerRemainSecond >= 3)
461+ {
462+ paint.setColor(Color.WHITE);
463+ }
464+ else
465+ {
466+ paint.setColor(Color.YELLOW);
467+ }
468+ paint.setTextSize(96);
462469 paint.setAntiAlias(true);
463470 paint.setShadowLayer(5.0f, 3.0f, 3.0f, Color.BLACK); // これで文字に影をつける
464471 String remainText = " " + selfTimerRemainSecond + " ";
--- android/AirA01a/trunk/app/src/main/java/jp/osdn/gokigen/aira01a/liveview/LiveViewFragment.java (revision 480)
+++ android/AirA01a/trunk/app/src/main/java/jp/osdn/gokigen/aira01a/liveview/LiveViewFragment.java (revision 481)
@@ -317,57 +317,63 @@
317317 busyDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
318318 busyDialog.show();
319319 */
320- updateSelfTimerIcon(selfTimerFeature);
321- controlTouchShutter();
322- if (camera != null)
320+ try
323321 {
324- camera.setLiveViewListener(liveViewListener);
325- camera.setCameraPropertyListener(propertyListener);
326- camera.setCameraStatusListener(statusListener);
327- camera.setRecordingListener(recordingListener);
328- camera.setRecordingSupportsListener(recordingSupportsListener);
322+ updateSelfTimerIcon(selfTimerFeature);
323+ controlTouchShutter();
324+ if (camera != null)
325+ {
326+ camera.setLiveViewListener(liveViewListener);
327+ camera.setCameraPropertyListener(propertyListener);
328+ camera.setCameraStatusListener(statusListener);
329+ camera.setRecordingListener(recordingListener);
330+ camera.setRecordingSupportsListener(recordingSupportsListener);
329331
330- final ISelfTimerControl selfTimerControl = this;
331- Thread thread = new Thread(new Runnable()
332- {
333- @Override
334- public void run()
332+ final ISelfTimerControl selfTimerControl = this;
333+ Thread thread = new Thread(new Runnable()
335334 {
336- if (cameraController != null)
335+ @Override
336+ public void run()
337337 {
338- try
338+ if (cameraController != null)
339339 {
340- if (takePictureControl == null)
340+ try
341341 {
342- takePictureControl = new TakePictureControl(getContext(), camera, cameraController, selfTimerControl);
342+ if (takePictureControl == null)
343+ {
344+ takePictureControl = new TakePictureControl(getContext(), camera, cameraController, selfTimerControl);
345+ }
346+ cameraController.changeToRecordingMode();
347+ SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
348+ camera.changeLiveViewSize(toLiveViewSize(preferences.getString("live_view_quality", "QVGA")));
349+ if (!camera.isAutoStartLiveView())
350+ {
351+ camera.startLiveView();
352+ }
343353 }
344- cameraController.changeToRecordingMode();
345- SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
346- camera.changeLiveViewSize(toLiveViewSize(preferences.getString("live_view_quality", "QVGA")));
347- if (!camera.isAutoStartLiveView())
354+ catch (Exception e)
348355 {
349- camera.startLiveView();
356+ e.printStackTrace();
350357 }
358+ System.gc();
351359 }
352- catch (Exception e)
353- {
354- e.printStackTrace();
355- }
356- System.gc();
360+ //busyDialog.dismiss();
361+ //busyDialog = null;
357362 }
358- //busyDialog.dismiss();
359- //busyDialog = null;
360- }
361- });
363+ });
362364
363- thread.start();
364- // ズームレンズのボタンを表示するかどうかを決める
365- updateZoomButtonVisibility();
365+ thread.start();
366+ // ズームレンズのボタンを表示するかどうかを決める
367+ updateZoomButtonVisibility();
368+ }
369+ updateLevelGauge();
370+ updateView(false);
371+ resetAutoFocus();
366372 }
367- updateLevelGauge();
368- updateView(false);
369- resetAutoFocus();
370-
373+ catch (Exception e)
374+ {
375+ e.printStackTrace();
376+ }
371377 Log.v(TAG, "onResume() End");
372378 }
373379
@@ -521,19 +527,26 @@
521527
522528 public void updateTakemodeTextView()
523529 {
524- takeModeTextView.setEnabled(takeModeHolder.canSetCameraProperty());
525- takeModeTextView.setText(takeModeHolder.getCameraPropertyValueTitle());
530+ try
531+ {
532+ takeModeTextView.setEnabled(takeModeHolder.canSetCameraProperty());
533+ takeModeTextView.setText(takeModeHolder.getCameraPropertyValueTitle());
526534
527- // Changing take mode may have an influence for drive mode and white balance.
528- updateDrivemodeImageView();
529- updateShutterSpeedTextView();
530- updateApertureValueTextView();
531- updateExposureCompensationTextView();
532- updateIsoSensitivityTextView();
533- updateWhiteBalanceImageView();
534- updateFocalLengthView();
535- updateAELockStateImageView();
536- updateManualFocusStateImageView();
535+ // Changing take mode may have an influence for drive mode and white balance.
536+ updateDrivemodeImageView();
537+ updateShutterSpeedTextView();
538+ updateApertureValueTextView();
539+ updateExposureCompensationTextView();
540+ updateIsoSensitivityTextView();
541+ updateWhiteBalanceImageView();
542+ updateFocalLengthView();
543+ updateAELockStateImageView();
544+ updateManualFocusStateImageView();
545+ }
546+ catch (Exception e)
547+ {
548+ e.printStackTrace();
549+ }
537550 }
538551
539552 public void updateShutterSpeedTextView()
@@ -569,14 +582,21 @@
569582 void hideControlPanel()
570583 {
571584 FragmentActivity activity = getActivity();
572- if (activity != null)
585+ try
573586 {
574- activity.findViewById(R.id.controlPanelLayout).setVisibility(View.INVISIBLE);
575- activity.findViewById(R.id.showControlPanelTextView).setVisibility(View.VISIBLE);
587+ if (activity != null)
588+ {
589+ activity.findViewById(R.id.controlPanelLayout).setVisibility(View.INVISIBLE);
590+ activity.findViewById(R.id.showControlPanelTextView).setVisibility(View.VISIBLE);
591+ }
592+ else
593+ {
594+ Log.v(TAG, "getActivity() returns NULL.");
595+ }
576596 }
577- else
597+ catch (Exception e)
578598 {
579- Log.v(TAG, "getActivity() returns NULL.");
599+ e.printStackTrace();
580600 }
581601 }
582602
@@ -583,14 +603,21 @@
583603 void showControlPanel()
584604 {
585605 FragmentActivity activity = getActivity();
586- if (activity != null)
606+ try
587607 {
588- activity.findViewById(R.id.controlPanelLayout).setVisibility(View.VISIBLE);
589- activity.findViewById(R.id.showControlPanelTextView).setVisibility(View.INVISIBLE);
608+ if (activity != null)
609+ {
610+ activity.findViewById(R.id.controlPanelLayout).setVisibility(View.VISIBLE);
611+ activity.findViewById(R.id.showControlPanelTextView).setVisibility(View.INVISIBLE);
612+ }
613+ else
614+ {
615+ Log.v(TAG, "getActivity() returns NULL.");
616+ }
590617 }
591- else
618+ catch (Exception e)
592619 {
593- Log.v(TAG, "getActivity() returns NULL.");
620+ e.printStackTrace();
594621 }
595622 }
596623
@@ -893,15 +920,22 @@
893920 void transToSettingFragment()
894921 {
895922 FragmentActivity activity = getActivity();
896- if (activity != null)
923+ try
897924 {
898- SettingFragment fragment = SettingFragment.newInstance(activity, camera);
899- FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
900- //transaction.setCustomAnimations(android.R.anim.fade_out, android.R.anim.fade_in);
901- transaction.replace(getId(), fragment);
902- transaction.addToBackStack(null);
903- transaction.commit();
925+ if (activity != null)
926+ {
927+ SettingFragment fragment = SettingFragment.newInstance(activity, camera);
928+ FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
929+ //transaction.setCustomAnimations(android.R.anim.fade_out, android.R.anim.fade_in);
930+ transaction.replace(getId(), fragment);
931+ transaction.addToBackStack(null);
932+ transaction.commit();
933+ }
904934 }
935+ catch (Exception e)
936+ {
937+ e.printStackTrace();
938+ }
905939 }
906940
907941 /**
@@ -912,25 +946,32 @@
912946 */
913947 public void transToPreviewFragment(byte[] bytes, Map<String, Object> map)
914948 {
915- if (cameraController.getAutoBracketingSetting(false) != BracketingShotControl.BRACKET_NONE)
949+ try
916950 {
917- // ブラケッティング撮影中は、プレビュー表示を行わない
918- return;
919- }
951+ if (cameraController.getAutoBracketingSetting(false) != BracketingShotControl.BRACKET_NONE)
952+ {
953+ // ブラケッティング撮影中は、プレビュー表示を行わない
954+ return;
955+ }
920956
921- if (camera.getActionType() == OLYCamera.ActionType.Single)
922- {
923- CapturedDataViewFragment fragment = new CapturedDataViewFragment();
924- fragment.prepareImageToShow(camera, bytes, map);
925- FragmentActivity activity = getActivity();
926- if (activity != null)
957+ if (camera.getActionType() == OLYCamera.ActionType.Single)
927958 {
928- FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
929- transaction.replace(getId(), fragment);
930- transaction.addToBackStack(null);
931- transaction.commit();
959+ CapturedDataViewFragment fragment = new CapturedDataViewFragment();
960+ fragment.prepareImageToShow(camera, bytes, map);
961+ FragmentActivity activity = getActivity();
962+ if (activity != null)
963+ {
964+ FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
965+ transaction.replace(getId(), fragment);
966+ transaction.addToBackStack(null);
967+ transaction.commit();
968+ }
932969 }
933970 }
971+ catch (Exception e)
972+ {
973+ e.printStackTrace();
974+ }
934975 }
935976
936977 /**
--- android/AirA01a/trunk/app/src/main/res/layout/fragment_image_grid_view.xml (revision 480)
+++ android/AirA01a/trunk/app/src/main/res/layout/fragment_image_grid_view.xml (revision 481)
@@ -35,7 +35,7 @@
3535 </RadioGroup>
3636
3737 <ImageButton
38- android:id="@+id/button_list_refresh"
38+ android:id="@+id/delete_batch"
3939 android:layout_width="wrap_content"
4040 android:layout_height="wrap_content"
4141 android:scaleType="fitCenter"
@@ -44,37 +44,37 @@
4444 android:layout_alignParentEnd="true"
4545 android:clickable="true"
4646 android:focusable="true"
47- android:src="@drawable/ic_refresh_black_24dp"
47+ android:src="@drawable/ic_baseline_delete_24"
4848 android:text="@string/blank"
4949 android:visibility="visible">
5050 </ImageButton>
5151
5252 <ImageButton
53- android:id="@+id/download_batch"
53+ android:id="@+id/button_list_refresh"
5454 android:layout_width="wrap_content"
5555 android:layout_height="wrap_content"
5656 android:scaleType="fitCenter"
5757 android:contentDescription="@string/button"
58- android:layout_toLeftOf="@id/button_list_refresh"
59- android:layout_toStartOf="@id/button_list_refresh"
58+ android:layout_toLeftOf="@id/delete_batch"
59+ android:layout_toStartOf="@id/delete_batch"
6060 android:clickable="true"
6161 android:focusable="true"
62- android:src="@drawable/ic_file_download_black_24dp"
62+ android:src="@drawable/ic_refresh_black_24dp"
6363 android:text="@string/blank"
6464 android:visibility="visible">
6565 </ImageButton>
6666
6767 <ImageButton
68- android:id="@+id/delete_batch"
68+ android:id="@+id/download_batch"
6969 android:layout_width="wrap_content"
7070 android:layout_height="wrap_content"
7171 android:scaleType="fitCenter"
7272 android:contentDescription="@string/button"
73- android:layout_toLeftOf="@id/download_batch"
74- android:layout_toStartOf="@id/download_batch"
73+ android:layout_toLeftOf="@id/button_list_refresh"
74+ android:layout_toStartOf="@id/button_list_refresh"
7575 android:clickable="true"
7676 android:focusable="true"
77- android:src="@drawable/ic_baseline_delete_24"
77+ android:src="@drawable/ic_file_download_black_24dp"
7878 android:text="@string/blank"
7979 android:visibility="visible">
8080 </ImageButton>
@@ -85,8 +85,8 @@
8585 android:layout_height="wrap_content"
8686 android:layout_toRightOf="@id/radio_group_select_category"
8787 android:layout_toEndOf="@id/radio_group_select_category"
88- android:layout_toLeftOf="@id/delete_batch"
89- android:layout_toStartOf="@id/delete_batch"
88+ android:layout_toLeftOf="@id/download_batch"
89+ android:layout_toStartOf="@id/download_batch"
9090 android:textSize="8pt"
9191 />
9292 </RelativeLayout>
--- android/AirA01a/trunk/app/src/main/res/values/arrays.xml (revision 480)
+++ android/AirA01a/trunk/app/src/main/res/values/arrays.xml (revision 481)
@@ -757,6 +757,8 @@
757757 <item >3 Sec.</item>
758758 <item >7 Sec.</item>
759759 <item >10 Sec.</item>
760+ <item >15 Sec.</item>
761+ <item >30 Sec.</item>
760762 </string-array>
761763
762764 <string-array name="self_timer_seconds_value">
@@ -763,6 +765,8 @@
763765 <item >3</item>
764766 <item >7</item>
765767 <item >10</item>
768+ <item >15</item>
769+ <item >30</item>
766770 </string-array>
767771
768772 </resources>
\ No newline at end of file
--- android/AirA01a/trunk/app/src/main/res/values-ja/arrays.xml (revision 480)
+++ android/AirA01a/trunk/app/src/main/res/values-ja/arrays.xml (revision 481)
@@ -756,6 +756,8 @@
756756 <item >3秒</item>
757757 <item >7秒</item>
758758 <item >10秒</item>
759+ <item >15秒</item>
760+ <item >30秒</item>
759761 </string-array>
760762
761763 <string-array name="self_timer_seconds_value">
@@ -762,6 +764,8 @@
762764 <item >3</item>
763765 <item >7</item>
764766 <item >10</item>
767+ <item >15</item>
768+ <item >30</item>
765769 </string-array>
766770
767771 </resources>
Show on old repository browser