若干の安定性を強化。
@@ -457,8 +457,15 @@ | ||
457 | 457 | if (selfTimerRemainSecond > 0) |
458 | 458 | { |
459 | 459 | 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); | |
462 | 469 | paint.setAntiAlias(true); |
463 | 470 | paint.setShadowLayer(5.0f, 3.0f, 3.0f, Color.BLACK); // これで文字に影をつける |
464 | 471 | String remainText = " " + selfTimerRemainSecond + " "; |
@@ -317,57 +317,63 @@ | ||
317 | 317 | busyDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); |
318 | 318 | busyDialog.show(); |
319 | 319 | */ |
320 | - updateSelfTimerIcon(selfTimerFeature); | |
321 | - controlTouchShutter(); | |
322 | - if (camera != null) | |
320 | + try | |
323 | 321 | { |
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); | |
329 | 331 | |
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() | |
335 | 334 | { |
336 | - if (cameraController != null) | |
335 | + @Override | |
336 | + public void run() | |
337 | 337 | { |
338 | - try | |
338 | + if (cameraController != null) | |
339 | 339 | { |
340 | - if (takePictureControl == null) | |
340 | + try | |
341 | 341 | { |
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 | + } | |
343 | 353 | } |
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) | |
348 | 355 | { |
349 | - camera.startLiveView(); | |
356 | + e.printStackTrace(); | |
350 | 357 | } |
358 | + System.gc(); | |
351 | 359 | } |
352 | - catch (Exception e) | |
353 | - { | |
354 | - e.printStackTrace(); | |
355 | - } | |
356 | - System.gc(); | |
360 | + //busyDialog.dismiss(); | |
361 | + //busyDialog = null; | |
357 | 362 | } |
358 | - //busyDialog.dismiss(); | |
359 | - //busyDialog = null; | |
360 | - } | |
361 | - }); | |
363 | + }); | |
362 | 364 | |
363 | - thread.start(); | |
364 | - // ズームレンズのボタンを表示するかどうかを決める | |
365 | - updateZoomButtonVisibility(); | |
365 | + thread.start(); | |
366 | + // ズームレンズのボタンを表示するかどうかを決める | |
367 | + updateZoomButtonVisibility(); | |
368 | + } | |
369 | + updateLevelGauge(); | |
370 | + updateView(false); | |
371 | + resetAutoFocus(); | |
366 | 372 | } |
367 | - updateLevelGauge(); | |
368 | - updateView(false); | |
369 | - resetAutoFocus(); | |
370 | - | |
373 | + catch (Exception e) | |
374 | + { | |
375 | + e.printStackTrace(); | |
376 | + } | |
371 | 377 | Log.v(TAG, "onResume() End"); |
372 | 378 | } |
373 | 379 |
@@ -521,19 +527,26 @@ | ||
521 | 527 | |
522 | 528 | public void updateTakemodeTextView() |
523 | 529 | { |
524 | - takeModeTextView.setEnabled(takeModeHolder.canSetCameraProperty()); | |
525 | - takeModeTextView.setText(takeModeHolder.getCameraPropertyValueTitle()); | |
530 | + try | |
531 | + { | |
532 | + takeModeTextView.setEnabled(takeModeHolder.canSetCameraProperty()); | |
533 | + takeModeTextView.setText(takeModeHolder.getCameraPropertyValueTitle()); | |
526 | 534 | |
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 | + } | |
537 | 550 | } |
538 | 551 | |
539 | 552 | public void updateShutterSpeedTextView() |
@@ -569,14 +582,21 @@ | ||
569 | 582 | void hideControlPanel() |
570 | 583 | { |
571 | 584 | FragmentActivity activity = getActivity(); |
572 | - if (activity != null) | |
585 | + try | |
573 | 586 | { |
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 | + } | |
576 | 596 | } |
577 | - else | |
597 | + catch (Exception e) | |
578 | 598 | { |
579 | - Log.v(TAG, "getActivity() returns NULL."); | |
599 | + e.printStackTrace(); | |
580 | 600 | } |
581 | 601 | } |
582 | 602 |
@@ -583,14 +603,21 @@ | ||
583 | 603 | void showControlPanel() |
584 | 604 | { |
585 | 605 | FragmentActivity activity = getActivity(); |
586 | - if (activity != null) | |
606 | + try | |
587 | 607 | { |
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 | + } | |
590 | 617 | } |
591 | - else | |
618 | + catch (Exception e) | |
592 | 619 | { |
593 | - Log.v(TAG, "getActivity() returns NULL."); | |
620 | + e.printStackTrace(); | |
594 | 621 | } |
595 | 622 | } |
596 | 623 |
@@ -893,15 +920,22 @@ | ||
893 | 920 | void transToSettingFragment() |
894 | 921 | { |
895 | 922 | FragmentActivity activity = getActivity(); |
896 | - if (activity != null) | |
923 | + try | |
897 | 924 | { |
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 | + } | |
904 | 934 | } |
935 | + catch (Exception e) | |
936 | + { | |
937 | + e.printStackTrace(); | |
938 | + } | |
905 | 939 | } |
906 | 940 | |
907 | 941 | /** |
@@ -912,25 +946,32 @@ | ||
912 | 946 | */ |
913 | 947 | public void transToPreviewFragment(byte[] bytes, Map<String, Object> map) |
914 | 948 | { |
915 | - if (cameraController.getAutoBracketingSetting(false) != BracketingShotControl.BRACKET_NONE) | |
949 | + try | |
916 | 950 | { |
917 | - // ブラケッティング撮影中は、プレビュー表示を行わない | |
918 | - return; | |
919 | - } | |
951 | + if (cameraController.getAutoBracketingSetting(false) != BracketingShotControl.BRACKET_NONE) | |
952 | + { | |
953 | + // ブラケッティング撮影中は、プレビュー表示を行わない | |
954 | + return; | |
955 | + } | |
920 | 956 | |
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) | |
927 | 958 | { |
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 | + } | |
932 | 969 | } |
933 | 970 | } |
971 | + catch (Exception e) | |
972 | + { | |
973 | + e.printStackTrace(); | |
974 | + } | |
934 | 975 | } |
935 | 976 | |
936 | 977 | /** |
@@ -35,7 +35,7 @@ | ||
35 | 35 | </RadioGroup> |
36 | 36 | |
37 | 37 | <ImageButton |
38 | - android:id="@+id/button_list_refresh" | |
38 | + android:id="@+id/delete_batch" | |
39 | 39 | android:layout_width="wrap_content" |
40 | 40 | android:layout_height="wrap_content" |
41 | 41 | android:scaleType="fitCenter" |
@@ -44,37 +44,37 @@ | ||
44 | 44 | android:layout_alignParentEnd="true" |
45 | 45 | android:clickable="true" |
46 | 46 | android:focusable="true" |
47 | - android:src="@drawable/ic_refresh_black_24dp" | |
47 | + android:src="@drawable/ic_baseline_delete_24" | |
48 | 48 | android:text="@string/blank" |
49 | 49 | android:visibility="visible"> |
50 | 50 | </ImageButton> |
51 | 51 | |
52 | 52 | <ImageButton |
53 | - android:id="@+id/download_batch" | |
53 | + android:id="@+id/button_list_refresh" | |
54 | 54 | android:layout_width="wrap_content" |
55 | 55 | android:layout_height="wrap_content" |
56 | 56 | android:scaleType="fitCenter" |
57 | 57 | 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" | |
60 | 60 | android:clickable="true" |
61 | 61 | android:focusable="true" |
62 | - android:src="@drawable/ic_file_download_black_24dp" | |
62 | + android:src="@drawable/ic_refresh_black_24dp" | |
63 | 63 | android:text="@string/blank" |
64 | 64 | android:visibility="visible"> |
65 | 65 | </ImageButton> |
66 | 66 | |
67 | 67 | <ImageButton |
68 | - android:id="@+id/delete_batch" | |
68 | + android:id="@+id/download_batch" | |
69 | 69 | android:layout_width="wrap_content" |
70 | 70 | android:layout_height="wrap_content" |
71 | 71 | android:scaleType="fitCenter" |
72 | 72 | 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" | |
75 | 75 | android:clickable="true" |
76 | 76 | android:focusable="true" |
77 | - android:src="@drawable/ic_baseline_delete_24" | |
77 | + android:src="@drawable/ic_file_download_black_24dp" | |
78 | 78 | android:text="@string/blank" |
79 | 79 | android:visibility="visible"> |
80 | 80 | </ImageButton> |
@@ -85,8 +85,8 @@ | ||
85 | 85 | android:layout_height="wrap_content" |
86 | 86 | android:layout_toRightOf="@id/radio_group_select_category" |
87 | 87 | 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" | |
90 | 90 | android:textSize="8pt" |
91 | 91 | /> |
92 | 92 | </RelativeLayout> |
@@ -757,6 +757,8 @@ | ||
757 | 757 | <item >3 Sec.</item> |
758 | 758 | <item >7 Sec.</item> |
759 | 759 | <item >10 Sec.</item> |
760 | + <item >15 Sec.</item> | |
761 | + <item >30 Sec.</item> | |
760 | 762 | </string-array> |
761 | 763 | |
762 | 764 | <string-array name="self_timer_seconds_value"> |
@@ -763,6 +765,8 @@ | ||
763 | 765 | <item >3</item> |
764 | 766 | <item >7</item> |
765 | 767 | <item >10</item> |
768 | + <item >15</item> | |
769 | + <item >30</item> | |
766 | 770 | </string-array> |
767 | 771 | |
768 | 772 | </resources> |
\ No newline at end of file |
@@ -756,6 +756,8 @@ | ||
756 | 756 | <item >3秒</item> |
757 | 757 | <item >7秒</item> |
758 | 758 | <item >10秒</item> |
759 | + <item >15秒</item> | |
760 | + <item >30秒</item> | |
759 | 761 | </string-array> |
760 | 762 | |
761 | 763 | <string-array name="self_timer_seconds_value"> |
@@ -762,6 +764,8 @@ | ||
762 | 764 | <item >3</item> |
763 | 765 | <item >7</item> |
764 | 766 | <item >10</item> |
767 | + <item >15</item> | |
768 | + <item >30</item> | |
765 | 769 | </string-array> |
766 | 770 | |
767 | 771 | </resources> |