main commit
Post-processing infrastructure * remove interfaces with one implementation * fix download resources with unknow length * marquee style for ProgressDrawable * "view details" option in mission context menu * notification for finished downloads * postprocessing infrastructure: sub-missions, circular file, layers for layers of abstractions for Java IO streams * Mp4 muxing (only DASH brand) * WebM muxing * Captions downloading * alert dialog for overwrite existing downloads finished or not. Misc changes * delete SQLiteDownloadDataSource.java * delete DownloadMissionSQLiteHelper.java * implement Localization from #114 Misc fixes (this branch) * restore old mission listeners variables. Prevents registered listeners get de-referenced on low-end devices * DownloadManagerService.checkForRunningMission() now return false if the mission has a error. * use Intent.FLAG_ACTIVITY_NEW_TASK when launching an activity from gigaget threads (apparently it is required in old versions of android) More changes * proper error handling "infrastructure" * queue instead of multiple downloads * move serialized pending downloads (.giga files) to app data * stop downloads when swicthing to mobile network (never works, see 2nd point) * save the thread count for next downloads * a lot of incoherences fixed * delete DownloadManagerTest.java (too many changes to keep this file updated)
This commit is contained in:
parent
45fea983b9
commit
5825843f68
48 changed files with 4379 additions and 1119 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3.3 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/subtitle.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/subtitle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
|
|
@ -53,6 +53,12 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/audio"/>
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/subtitle_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/caption_setting_title"/>
|
||||
</RadioGroup>
|
||||
|
||||
<Spinner
|
||||
|
|
@ -77,6 +83,7 @@
|
|||
android:text="@string/msg_threads"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/threads_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/threads_text_view"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/item_bkg"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="1dp"
|
||||
android:src="@drawable/ic_menu_more"
|
||||
android:scaleType="centerInside"
|
||||
android:contentDescription="TODO" />
|
||||
android:scaleType="center"
|
||||
android:contentDescription="TODO"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
|
@ -51,8 +51,8 @@
|
|||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="fitXY"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:contentDescription="TODO" />
|
||||
android:contentDescription="TODO"
|
||||
android:padding="10dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_name"
|
||||
|
|
@ -60,12 +60,14 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/item_icon"
|
||||
android:padding="6dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:text="XXX.xx"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/white"/>
|
||||
android:textColor="@color/white"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_size"
|
||||
|
|
|
|||
|
|
@ -1,12 +1,17 @@
|
|||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<include
|
||||
layout="@layout/list_empty_view"
|
||||
android:id="@+id/list_empty_view"
|
||||
android:visibility="gone" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/mission_recycler"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
30
app/src/main/res/layout/missions_header.xml
Normal file
30
app/src/main/res/layout/missions_header.xml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/drawer_header_font_color"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:background="@color/black_settings_accent_color" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -1,11 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<item
|
||||
android:id="@+id/switch_mode"
|
||||
android:icon="@drawable/list"
|
||||
android:title="@string/grid"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_settings"
|
||||
android:title="@string/settings"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:visible="false"
|
||||
android:id="@+id/clear_list"
|
||||
android:icon="@drawable/ic_delete_sweep_white_24dp"
|
||||
android:title="@string/clear_finished_download"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
|
||||
<item android:id="@+id/action_settings"
|
||||
app:showAsAction="never"
|
||||
android:title="@string/settings"/>
|
||||
<item android:id="@+id/switch_mode"
|
||||
app:showAsAction="ifRoom"
|
||||
android:title="@string/switch_view"/>
|
||||
</menu>
|
||||
|
|
@ -1,37 +1,50 @@
|
|||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/start"
|
||||
android:title="@string/start"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/pause"
|
||||
android:title="@string/pause"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/view"
|
||||
android:title="@string/view"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/delete"
|
||||
android:title="@string/delete"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/checksum"
|
||||
android:title="@string/checksum">
|
||||
|
||||
<menu>
|
||||
|
||||
<item
|
||||
android:id="@+id/md5"
|
||||
android:title="@string/md5"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/sha1"
|
||||
android:title="@string/sha1"/>
|
||||
|
||||
</menu>
|
||||
|
||||
</item>
|
||||
<item
|
||||
android:id="@+id/start"
|
||||
android:title="@string/start" />
|
||||
|
||||
<item
|
||||
android:id="@+id/pause"
|
||||
android:title="@string/pause" />
|
||||
|
||||
<item
|
||||
android:id="@+id/queue"
|
||||
android:title="@string/enqueue"
|
||||
android:checkable="true"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/open"
|
||||
android:title="@string/view" />
|
||||
|
||||
<item
|
||||
android:id="@+id/delete"
|
||||
android:title="@string/delete" />
|
||||
|
||||
<item
|
||||
android:id="@+id/error_message_view"
|
||||
android:title="@string/show_error" />
|
||||
|
||||
<item
|
||||
android:id="@+id/source"
|
||||
android:title="@string/show_info" />
|
||||
|
||||
<item
|
||||
android:id="@+id/checksum"
|
||||
android:title="@string/checksum">
|
||||
|
||||
<menu>
|
||||
|
||||
<item
|
||||
android:id="@+id/md5"
|
||||
android:title="@string/md5" />
|
||||
|
||||
<item
|
||||
android:id="@+id/sha1"
|
||||
android:title="@string/sha1" />
|
||||
|
||||
</menu>
|
||||
|
||||
</item>
|
||||
|
||||
</menu>
|
||||
|
|
|
|||
|
|
@ -492,7 +492,7 @@ abrir en modo popup</string>
|
|||
<string name="minimize_on_exit_background_description">Minimizar al reproductor de fondo</string>
|
||||
<string name="minimize_on_exit_popup_description">Minimizar el reproductor emergente</string>
|
||||
|
||||
<string name="skip_silence_checkbox">Avance rápido durante el silencio</string>
|
||||
<string name="skip_silence_checkbox">Avance rápido durante el silencio</string>
|
||||
<string name="playback_step">Paso</string>
|
||||
<string name="playback_reset">Reiniciar</string>
|
||||
|
||||
|
|
@ -500,4 +500,54 @@ abrir en modo popup</string>
|
|||
<string name="users">Usuarios</string>
|
||||
<string name="playlists">Listas de reproducción</string>
|
||||
<string name="tracks">Pistas</string>
|
||||
|
||||
<string name="missions_header_finished">Finalizadas</string>
|
||||
<string name="missions_header_pending">En cola</string>
|
||||
|
||||
<string name="paused">pausado</string>
|
||||
<string name="queued">en cola</string>
|
||||
<string name="post_processing">post-procesado</string>
|
||||
|
||||
<string name="enqueue">Encolar</string>
|
||||
|
||||
<string name="permission_denied">Acción denegada por el sistema</string>
|
||||
|
||||
<string name="file_deleted">Archivo borrado</string>
|
||||
|
||||
<!-- download done notifications -->
|
||||
<string name="download_finished">Descarga finalizada: %s</string>
|
||||
<string name="download_finished_more">%s descargas finalizadas</string>
|
||||
|
||||
<!-- dialog about existing downloads -->
|
||||
<string name="generate_unique_name">Generar nombre único</string>
|
||||
<string name="overwrite">Sobrescribir</string>
|
||||
<string name="overwrite_warning">Ya existe un archivo descargado con este nombre</string>
|
||||
<string name="download_already_running">Hay una descarga en curso con este nombre</string>
|
||||
|
||||
<string name="grid">Mostrar como grilla</string>
|
||||
<string name="list">Mostrar como lista</string>
|
||||
<string name="clear_finished_download">Limpiar descargas finalizadas</string>
|
||||
<string name="msg_pending_downloads">Tienes %s descargas pendientes, ve a Descargas para continuarlas</string>
|
||||
<string name="stop">Detener</string>
|
||||
<string name="max_retry_msg">Intentos maximos</string>
|
||||
<string name="max_retry_desc">Cantidad máxima de intentos antes de cancelar la descarga</string>
|
||||
<string name="pause_downloads_on_mobile">Pausar al cambiar a datos moviles</string>
|
||||
<string name="pause_downloads_on_mobile_desc">No todas las descargas se pueden suspender, en esos casos, se reiniciaran</string>
|
||||
|
||||
|
||||
<!-- message dialog about download error -->
|
||||
<string name="show_error">Mostrar error</string>
|
||||
<string name="label_code">Codigo</string>
|
||||
<string name="error_path_creation">No se puede crear la carpeta de destino</string>
|
||||
<string name="error_file_creation">No se puede crear el archivo</string>
|
||||
<string name="error_permission_denied">Permiso denegado por el sistema</string>
|
||||
<string name="error_ssl_exception">Fallo la conexión segura</string>
|
||||
<string name="error_unknown_host">No se puede encontrar el servidor</string>
|
||||
<string name="error_connect_host">No se puede conectar con el servidor</string>
|
||||
<string name="error_http_no_content">El servidor no devolvio datos</string>
|
||||
<string name="error_http_unsupported_range">El servidor no acepta descargas multi-hilos, intente de nuevo con @string/msg_threads = 1</string>
|
||||
<string name="error_http_requested_range_not_satisfiable">Rango solicitado no satisfactorio</string>
|
||||
<string name="error_http_not_found">No encontrado</string>
|
||||
<string name="error_postprocessing_failed">Fallo el post-procesado</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@
|
|||
<color name="audio_already_load_color">#000000</color>
|
||||
<color name="video_left_to_load_color">#CD5656</color>
|
||||
<color name="video_already_load_color">#BC211D</color>
|
||||
<color name="subtitle_left_to_load_color">#008ea4</color>
|
||||
<color name="subtitle_already_load_color">#005a71</color>
|
||||
|
||||
<!-- GigaGet Component colors -->
|
||||
<color name="white">#FFFFFF</color>
|
||||
|
|
|
|||
|
|
@ -174,6 +174,12 @@
|
|||
</string-array>
|
||||
|
||||
<string name="default_file_charset_value" translatable="false">@string/charset_most_special_characters_value</string>
|
||||
|
||||
<string name="downloads_max_retry" translatable="false">downloads_max_retry</string>
|
||||
<string name="default_max_retry" translatable="false">3</string>
|
||||
<string name="cross_network_downloads" translatable="false">cross_network_downloads</string>
|
||||
|
||||
<string name="default_download_threads" translatable="false">default_download_threads</string>
|
||||
|
||||
<!-- Preferred action on open (open from external app) -->
|
||||
<string name="preferred_open_action_key" translatable="false">preferred_open_action_key</string>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<string name="controls_download_desc">Download stream file</string>
|
||||
<string name="search">Search</string>
|
||||
<string name="settings">Settings</string>
|
||||
<string name="did_you_mean">Did you mean: %1$s\?</string>
|
||||
<string name="did_you_mean">Did you mean: %1$s?</string>
|
||||
<string name="share_dialog_title">Share with</string>
|
||||
<string name="choose_browser">Choose browser</string>
|
||||
<string name="screen_rotation">rotation</string>
|
||||
|
|
@ -143,6 +143,7 @@
|
|||
<string name="popup_resizing_indicator_title">Resizing</string>
|
||||
<string name="best_resolution">Best resolution</string>
|
||||
<string name="undo">Undo</string>
|
||||
<string name="file_deleted">File deleted</string>
|
||||
<string name="play_all">Play All</string>
|
||||
<string name="always">Always</string>
|
||||
<string name="just_once">Just Once</string>
|
||||
|
|
@ -520,9 +521,55 @@
|
|||
<string name="minimize_on_exit_none_description">None</string>
|
||||
<string name="minimize_on_exit_background_description">Minimize to background player</string>
|
||||
<string name="minimize_on_exit_popup_description">Minimize to popup player</string>
|
||||
<string name="list_view_mode">List view mode</string>
|
||||
<string name="list_view_mode">List view mode</string>
|
||||
<string name="list">List</string>
|
||||
<string name="grid">Grid</string>
|
||||
<string name="auto">Auto</string>
|
||||
<string name="auto">Auto</string>
|
||||
<string name="switch_view">Switch View</string>
|
||||
|
||||
|
||||
<string name="missions_header_finished">Finished</string>
|
||||
<string name="missions_header_pending">In queue</string>
|
||||
|
||||
<string name="paused">paused</string>
|
||||
<string name="queued">queued</string>
|
||||
<string name="post_processing">post-processing</string>
|
||||
|
||||
<string name="enqueue">Queue</string>
|
||||
|
||||
<string name="permission_denied">Action denied by the system</string>
|
||||
|
||||
<!-- download done notifications -->
|
||||
<string name="download_finished">Download finished: %s</string>
|
||||
<string name="download_finished_more">%s downloads finished</string>
|
||||
|
||||
<!-- dialog about existing downloads -->
|
||||
<string name="generate_unique_name">Generate unique name</string>
|
||||
<string name="overwrite">Overwrite</string>
|
||||
<string name="overwrite_warning">A downloaded file with this name already exists</string>
|
||||
<string name="download_already_running">There is a download in progress with this name</string>
|
||||
|
||||
<!-- message dialog about download error -->
|
||||
<string name="show_error">Show error</string>
|
||||
<string name="label_code">Code</string>
|
||||
<string name="error_path_creation">The file can not be created</string>
|
||||
<string name="error_file_creation">The destination folder can not be created</string>
|
||||
<string name="error_permission_denied">Permission denied by the system</string>
|
||||
<string name="error_ssl_exception">Secure connection failed</string>
|
||||
<string name="error_unknown_host">Can not found the server</string>
|
||||
<string name="error_connect_host">Can not connect to the server</string>
|
||||
<string name="error_http_no_content">The server does not send data</string>
|
||||
<string name="error_http_unsupported_range">The server does not accept multi-threaded downloads, retry with @string/msg_threads = 1</string>
|
||||
<string name="error_http_requested_range_not_satisfiable">Requested Range Not Satisfiable</string>
|
||||
<string name="error_http_not_found">Not found</string>
|
||||
<string name="error_postprocessing_failed">Post-processing failed</string>
|
||||
|
||||
<string name="clear_finished_download">Clear finished downloads</string>
|
||||
<string name="msg_pending_downloads">You have %s pending downloads, goto Downloads to continue</string>
|
||||
<string name="stop">Stop</string>
|
||||
<string name="max_retry_msg">Maximum retry</string>
|
||||
<string name="max_retry_desc">Maximum number of attempts before canceling the download</string>
|
||||
<string name="pause_downloads_on_mobile">Pause on switching to mobile data</string>
|
||||
<string name="pause_downloads_on_mobile_desc">Not all downloads can be suspended, in those cases, will be restarted</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -29,4 +29,17 @@
|
|||
android:summary="@string/settings_file_replacement_character_summary"
|
||||
android:title="@string/settings_file_replacement_character_title"/>
|
||||
|
||||
<SeekBarPreference
|
||||
android:defaultValue="@string/default_max_retry"
|
||||
android:key="@string/downloads_max_retry"
|
||||
android:max="15"
|
||||
android:summary="@string/max_retry_desc"
|
||||
android:title="@string/max_retry_msg" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="false"
|
||||
android:key="@string/cross_network_downloads"
|
||||
android:summary="@string/pause_downloads_on_mobile_desc"
|
||||
android:title="@string/pause_downloads_on_mobile" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue