hotfixes
This commit is contained in:
parent
1ed09133bc
commit
d5824f59d3
8 changed files with 62 additions and 38 deletions
|
|
@ -20,6 +20,7 @@ import com.google.android.material.button.MaterialButton
|
|||
import com.google.android.material.card.MaterialCardView
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
import com.squareup.picasso.Picasso
|
||||
import org.w3c.dom.Text
|
||||
import java.util.zip.GZIPOutputStream
|
||||
|
||||
class ActiveDownloadAdapter(onItemClickListener: OnItemClickListener, activity: Activity) : ListAdapter<DownloadItem?, ActiveDownloadAdapter.ViewHolder>(AsyncDifferConfig.Builder(DIFF_CALLBACK).build()) {
|
||||
|
|
@ -84,6 +85,9 @@ class ActiveDownloadAdapter(onItemClickListener: OnItemClickListener, activity:
|
|||
}
|
||||
author.text = info
|
||||
|
||||
val type = card.findViewById<TextView>(R.id.type)
|
||||
type.text = item.type.toString().uppercase()
|
||||
|
||||
val formatNote = card.findViewById<TextView>(R.id.format_note)
|
||||
formatNote.text = item.format.format_note
|
||||
val codec = card.findViewById<TextView>(R.id.codec)
|
||||
|
|
|
|||
|
|
@ -68,13 +68,13 @@ class DownloadViewModel(application: Application) : AndroidViewModel(application
|
|||
|
||||
val audioContainer = sharedPreferences.getString("audio_format", "mp3")
|
||||
bestAudioFormat = Format(
|
||||
"",
|
||||
getApplication<App>().resources.getString(R.string.best_quality),
|
||||
audioContainer!!,
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0,
|
||||
""
|
||||
getApplication<App>().resources.getString(R.string.best_quality)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -209,8 +209,9 @@ class DownloadViewModel(application: Application) : AndroidViewModel(application
|
|||
|
||||
fun turnResultItemsToDownloadItems(items: List<ResultItem?>) : List<DownloadItem> {
|
||||
val list : MutableList<DownloadItem> = mutableListOf()
|
||||
val preferredType = sharedPreferences.getString("preferred_download_type", "video");
|
||||
items.forEach {
|
||||
list.add(createDownloadItemFromResult(it!!, Type.video))
|
||||
list.add(createDownloadItemFromResult(it!!, Type.valueOf(preferredType!!)))
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class DownloadWorker(
|
|||
DownloadViewModel.Type.audio -> {
|
||||
request.addOption("-x")
|
||||
var audioQualityId : String = downloadItem.format.format_id
|
||||
if (audioQualityId.isEmpty() || audioQualityId == "0") audioQualityId = ""
|
||||
if (audioQualityId.isEmpty() || audioQualityId == "0" || audioQualityId == context.getString(R.string.best_quality)) audioQualityId = ""
|
||||
if (audioQualityId.isNotEmpty()){
|
||||
request.addOption("-f", audioQualityId)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearLayout2"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearlayout2_horizontalscrollview"
|
||||
app:layout_constraintEnd_toStartOf="@+id/active_download_cancel"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
|
@ -96,47 +96,65 @@
|
|||
</LinearLayout>
|
||||
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/linearLayout2"
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/linearlayout2_horizontalscrollview"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="10dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="horizontal"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintBottom_toTopOf="@+id/output"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/format_note"
|
||||
style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:layout_constraintBottom_toTopOf="@+id/output"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
android:paddingHorizontal="10dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/type"
|
||||
style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:layout_constraintBottom_toTopOf="@+id/output"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/format_note"
|
||||
style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/codec"
|
||||
style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/codec"
|
||||
style="@style/Widget.Material3.FloatingActionButton.Large.Secondary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/file_size"
|
||||
style="@style/Widget.Material3.FloatingActionButton.Large.Tertiary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/file_size"
|
||||
style="@style/Widget.Material3.FloatingActionButton.Large.Tertiary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
</com.google.android.material.chip.ChipGroup>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
|
||||
<TextView
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
android:checkable="true"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardMaxElevation="12dp"
|
||||
app:cardElevation="5dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="10dp"
|
||||
app:cardElevation="5dp"
|
||||
app:cardMaxElevation="12dp"
|
||||
android:checkable="true"
|
||||
app:strokeWidth="0dp"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="10dp"
|
||||
app:cardElevation="5dp"
|
||||
app:cardMaxElevation="12dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
android:checkable="true"
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@
|
|||
app:title="@string/audio_quality" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="Best Quality"
|
||||
android:defaultValue="@string/best_quality"
|
||||
android:entries="@array/video_formats"
|
||||
android:entryValues="@array/video_formats"
|
||||
android:icon="@drawable/ic_video"
|
||||
|
|
|
|||
Loading…
Reference in a new issue