diff options
26 files changed, 96 insertions, 10 deletions
diff --git a/res/drawable-hdpi/ic_menu_camera_video_view.png b/res/drawable-hdpi/ic_menu_camera_video_view.png Binary files differnew file mode 100644 index 0000000..47bdfb6 --- /dev/null +++ b/res/drawable-hdpi/ic_menu_camera_video_view.png diff --git a/res/drawable-mdpi/ic_menu_camera_video_view.png b/res/drawable-mdpi/ic_menu_camera_video_view.png Binary files differnew file mode 100644 index 0000000..f7e52c2 --- /dev/null +++ b/res/drawable-mdpi/ic_menu_camera_video_view.png diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index c33fa4f..ba09032 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Sdílet video pomocí"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Na vaší kartě SD je málo místa. Změňte nastavení kvality nebo smažte položky z Galerie."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Bylo dosaženo limitu velikosti."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Přepnout do režimu fotoaparát"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Přepnout do režimu video"</string> </resources> diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 80a4ff2..0f0612c 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Del video via"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Der er snart ikke mere plads på diit SD-kort. Rediger indstillingerne for kvaliteten, eller slet elementer fra Galleriet."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Størrelsesgrænse er nået."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Skift til kamera"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Skift til video"</string> </resources> diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index a6e2778..1839326 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Video weiterleiten via"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Auf Ihrer SD-Karte ist nicht mehr genügend Speicherplatz vorhanden. Ändern Sie die Qualitätseinstellung oder löschen Sie Elemente aus der Galerie."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Maximale Größe erreicht"</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Zu Kamera wechseln"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Zu Video wechseln"</string> </resources> diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index 3116adb..2eb46c2 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Κοινή χρήση βίντεο μέσω"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Ο διαθέσιμος χώρος στην κάρτα SD είναι ελάχιστος. Αλλάξτε τη ρύθμιση ποιότητας ή διαγράψτε στοιχεία από τη συλλογή."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Συμπληρώθηκε το όριο μεγέθους."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Αλλαγή σε λειτουργία φωτογραφικής μηχανής"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Αλλαγή σε λειτουργία βίντεο"</string> </resources> diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml index 1945f96..f6c5e87 100644 --- a/res/values-es-rUS/strings.xml +++ b/res/values-es-rUS/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Compartir video mediante"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Tu tarjeta SD se está quedando sin espacio. Cambia la configuración de calidad o elimina elementos de la galería."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Se alcanzó el límite del tamaño."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Cambiar a cámara"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Cambiar a video"</string> </resources> diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index d04769a..6a5a672 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Compartir vídeo a través de"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"No queda espacio en la tarjeta SD. Cambia la configuración de calidad o elimina elementos de la galería."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Se ha alcanzado el límite de tamaño."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Cambiar a cámara"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Cambiar a vídeo"</string> </resources> diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index fffb602..db472af 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Partager la vidéo via"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Votre carte SD est pleine. Modifiez le paramètre de qualité ou supprimez des éléments de la galerie."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Taille maximale atteinte."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Passer en mode appareil photo"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Passer en mode vidéo"</string> </resources> diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index f553f67..188a5cf 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Condividi video tramite"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Lo spazio della scheda SD si sta esaurendo. Cambia l\'impostazione di qualità o elimina elementi nella galleria."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Limite di dimensione raggiunto."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Passa a fotocamera"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Passa a video"</string> </resources> diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index efe5801..d344f1d 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"動画を共有"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"SDカードの容量が足りません。クオリティ設定を変更するか、ギャラリーからアイテムを削除してください。"</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"サイズ制限に達しました。"</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"写真に切替"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"ムービーに切替"</string> </resources> diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index eb6ffce..3e3e4ce 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"동영상 공유 응용프로그램"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"SD 카드의 공간이 부족합니다. 화질 설정을 변경하거나 갤러리에서 항목을 삭제하세요."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"크기 한도에 도달했습니다."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"카메라로 전환"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"동영상으로 전환"</string> </resources> diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml index a030b69..8a91cfe 100644 --- a/res/values-nb/strings.xml +++ b/res/values-nb/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Del video via"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Minnekortet begynner å gå tom for plass. Endre kvalitetsinnstillingen eller slett bilder fra galleriet."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Videoen ble for stor."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Bytt til kamera"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Bytt til video"</string> </resources> diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 557cafe..24b6c13 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Video delen via"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Er is weinig ruimte beschikbaar op uw SD-kaart. U kunt de kwaliteitsinstelling wijzigen of items uit de galerij verwijderen."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Maximale grootte bereikt"</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Overschakelen naar camera"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Overschakelen naar video"</string> </resources> diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 33b3674..86cd066 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Prześlij film następującą drogą:"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Na karcie SD brakuje miejsca. Zmień ustawienie jakości lub usuń elementy z Galerii."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Osiągnięto limit rozmiaru."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Przełącz na aparat"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Przełącz na wideo"</string> </resources> diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml index dc3f4bb..f9c3b06 100644 --- a/res/values-pt-rPT/strings.xml +++ b/res/values-pt-rPT/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Partilhar vídeo através de"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Está a ficar sem espaço no cartão SD. Altere as definições de qualidade ou elimine itens da Galeria."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Limite de tamanho atingido."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Mudar para câmara"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Mudar para vídeo"</string> </resources> diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml index 6d89cc8..61227fc 100644 --- a/res/values-pt/strings.xml +++ b/res/values-pt/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Compartilhar vídeo via"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"O seu cartão SD está sem espaço. Mude a configuração de qualidade ou exclua itens da Galeria."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Limite de tamanho atingido."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Alternar para câmera"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Alternar para vídeo"</string> </resources> diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index dc970de..9eb99c2 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Отправить видео при помощи"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Место на вашей SD-карте заканчивается. Измените настройки качества или удалите содержимое из фотоальбома."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Достигнут предельный размер видео."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Переключить на фото"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Переключить на видео"</string> </resources> diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index 88756b0..61ac8cf 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Dela video via"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"Ditt SD-kort börjar bli fullt. Ändra inställningen för kvalitet eller ta bort objekt från Galleri."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Storleksgränsen nådd."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Växla till kamera"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Växla till video"</string> </resources> diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index 8545743..1d98889 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"Videoyu şunun aracılığıyla paylaş:"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"SD kartınızda boş alan azalıyor. Kalite ayarlarını değiştirin veya Galeri\'den öğe silin."</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"Boyut sınırına ulaşıldı."</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"Kameraya geç"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"Videoya geç"</string> </resources> diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index 3486b7f..92fe99a 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"分享视频的方式"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"SD 卡空间已快用完。请更改画质设置或删除图库中的部分内容。"</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"已达到大小上限。"</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"切换到相机"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"切换到视频"</string> </resources> diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 143ecdb..ca68729 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -136,4 +136,6 @@ <string name="sendVideo" msgid="3598567735831863073">"透過…分享影片"</string> <string name="spaceIsLow_content" msgid="2848517537672543641">"您的 SD 卡空間已快用完。請變更品質設定或刪除圖庫中的項目。"</string> <string name="video_reach_size_limit" msgid="6179877322015552390">"已達大小上限。"</string> + <string name="switch_to_camera_lable" msgid="8248495141797448471">"切換為相機"</string> + <string name="switch_to_video_lable" msgid="4525451949497982385">"切換為影片"</string> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index 26ff93f..02f4042 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -347,4 +347,6 @@ <!-- The title show on the zoom controller --> <string name="zoom_control_title">Zoom</string> + <string name="switch_to_camera_lable">Switch to camera</string> + <string name="switch_to_video_lable">Switch to video</string> </resources> diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 311f56d..77ed9c7 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -2021,6 +2021,11 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, } private void addBaseMenuItems(Menu menu) { + MenuHelper.addSwitchModeMenuItem(menu, true, new Runnable() { + public void run() { + switchToVideoMode(); + } + }); MenuItem gallery = menu.add(Menu.NONE, Menu.NONE, MenuHelper.POSITION_GOTO_GALLERY, R.string.camera_gallery_photos_text) @@ -2034,14 +2039,20 @@ public class Camera extends NoSearchActivity implements View.OnClickListener, mGalleryItems.add(gallery); } + private boolean switchToVideoMode() { + if (!isCameraIdle()) return false; + MenuHelper.gotoVideoMode(this); + ((ViewGroup) mGLRootView.getParent()).removeView(mGLRootView); + finish(); + return true; + } + public boolean onSwitchChanged(Switcher source, boolean onOff) { if (onOff == SWITCH_VIDEO) { - if (!isCameraIdle()) return false; - MenuHelper.gotoVideoMode(this); - ((ViewGroup) mGLRootView.getParent()).removeView(mGLRootView); - finish(); + return switchToVideoMode(); + } else { + return true; } - return true; } private void onSharedPreferenceChanged() { diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java index 65b8272..1c8f0fa 100644 --- a/src/com/android/camera/MenuHelper.java +++ b/src/com/android/camera/MenuHelper.java @@ -29,6 +29,9 @@ import android.os.StatFs; import android.provider.MediaStore; import android.provider.MediaStore.Images; import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.view.MenuItem.OnMenuItemClickListener; import com.android.camera.R; @@ -113,6 +116,25 @@ public class MenuHelper { .show(); } + static void addSwitchModeMenuItem(Menu menu, boolean switchToVideo, + final Runnable r) { + int labelId = switchToVideo + ? R.string.switch_to_video_lable + : R.string.switch_to_camera_lable; + int iconId = switchToVideo + ? R.drawable.ic_menu_camera_video_view + : android.R.drawable.ic_menu_camera; + MenuItem item = menu.add(Menu.NONE, Menu.NONE, + POSITION_SWITCH_CAMERA_MODE, labelId) + .setOnMenuItemClickListener(new OnMenuItemClickListener() { + public boolean onMenuItemClick(MenuItem item) { + r.run(); + return true; + } + }); + item.setIcon(iconId); + } + private static void startCameraActivity(Activity activity, String action) { Intent intent = new Intent(action); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 82e2ae0..ee62825 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1009,6 +1009,11 @@ public class VideoCamera extends NoSearchActivity } private void addBaseMenuItems(Menu menu) { + MenuHelper.addSwitchModeMenuItem(menu, false, new Runnable() { + public void run() { + switchToCameraMode(); + } + }); MenuItem gallery = menu.add(Menu.NONE, Menu.NONE, MenuHelper.POSITION_GOTO_GALLERY, R.string.camera_gallery_photos_text) @@ -1378,14 +1383,20 @@ public class VideoCamera extends NoSearchActivity mCameraDevice.setParameters(mParameters); } + private boolean switchToCameraMode() { + if (mMediaRecorderRecording) return false; + MenuHelper.gotoCameraMode(this); + ((ViewGroup) mGLRootView.getParent()).removeView(mGLRootView); + finish(); + return true; + } + public boolean onSwitchChanged(Switcher source, boolean onOff) { if (onOff == SWITCH_CAMERA) { - if (mMediaRecorderRecording) return false; - MenuHelper.gotoCameraMode(this); - ((ViewGroup) mGLRootView.getParent()).removeView(mGLRootView); - finish(); + return switchToCameraMode(); + } else { + return true; } - return true; } private void resetCameraParameters() { |