updated active download card design
This commit is contained in:
parent
ad6237d128
commit
07b28729a6
19 changed files with 266 additions and 126 deletions
|
|
@ -15,10 +15,15 @@ import androidx.recyclerview.widget.ListAdapter
|
|||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.deniscerri.ytdlnis.R
|
||||
import com.deniscerri.ytdlnis.database.models.DownloadItem
|
||||
import com.deniscerri.ytdlnis.database.viewmodel.DownloadViewModel
|
||||
import com.deniscerri.ytdlnis.util.FileUtil
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.card.MaterialCardView
|
||||
import com.google.android.material.chip.Chip
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator
|
||||
import com.google.android.material.shape.CornerFamily
|
||||
import com.google.android.material.shape.MaterialShapeDrawable
|
||||
import com.google.android.material.shape.ShapeAppearanceModel
|
||||
import com.squareup.picasso.Picasso
|
||||
|
||||
class ActiveDownloadAdapter(onItemClickListener: OnItemClickListener, activity: Activity) : ListAdapter<DownloadItem?, ActiveDownloadAdapter.ViewHolder>(AsyncDifferConfig.Builder(DIFF_CALLBACK).build()) {
|
||||
|
|
@ -58,7 +63,7 @@ class ActiveDownloadAdapter(onItemClickListener: OnItemClickListener, activity:
|
|||
} else {
|
||||
uiHandler.post { Picasso.get().load(R.color.black).into(thumbnail) }
|
||||
}
|
||||
thumbnail.setColorFilter(Color.argb(95, 0, 0, 0))
|
||||
thumbnail.setColorFilter(Color.argb(20, 0, 0, 0))
|
||||
|
||||
// PROGRESS BAR ----------------------------------------------------
|
||||
val progressBar = card.findViewById<LinearProgressIndicator>(R.id.progress)
|
||||
|
|
@ -83,12 +88,17 @@ class ActiveDownloadAdapter(onItemClickListener: OnItemClickListener, activity:
|
|||
}
|
||||
author.text = info
|
||||
|
||||
val type = card.findViewById<TextView>(R.id.type)
|
||||
type.text = item.type.toString().uppercase()
|
||||
val type = card.findViewById<MaterialButton>(R.id.download_type)
|
||||
when(item.type){
|
||||
DownloadViewModel.Type.audio -> type.setIconResource(R.drawable.ic_music)
|
||||
DownloadViewModel.Type.video -> type.setIconResource(R.drawable.ic_video)
|
||||
DownloadViewModel.Type.command -> type.setIconResource(R.drawable.ic_terminal)
|
||||
}
|
||||
|
||||
val formatNote = card.findViewById<TextView>(R.id.format_note)
|
||||
val formatNote = card.findViewById<Chip>(R.id.format_note)
|
||||
formatNote.text = item.format.format_note
|
||||
val codec = card.findViewById<TextView>(R.id.codec)
|
||||
|
||||
val codec = card.findViewById<Chip>(R.id.codec)
|
||||
val codecText =
|
||||
if (item.format.encoding != "") {
|
||||
item.format.encoding.uppercase()
|
||||
|
|
@ -104,10 +114,28 @@ class ActiveDownloadAdapter(onItemClickListener: OnItemClickListener, activity:
|
|||
codec.text = codecText
|
||||
}
|
||||
|
||||
val fileSize = card.findViewById<TextView>(R.id.file_size)
|
||||
val fileSize = card.findViewById<Chip>(R.id.file_size)
|
||||
fileSize.text = fileUtil.convertFileSize(item.format.filesize)
|
||||
if (fileSize.text == "?") fileSize.visibility = View.GONE
|
||||
|
||||
if (fileSize.visibility == View.VISIBLE && codec.visibility == View.GONE){
|
||||
fileSize.shapeAppearanceModel = ShapeAppearanceModel.builder()
|
||||
.setTopRightCorner(CornerFamily.ROUNDED, 40F)
|
||||
.setBottomRightCorner(CornerFamily.ROUNDED, 40F)
|
||||
.setTopLeftCorner(CornerFamily.ROUNDED, 0F)
|
||||
.setBottomLeftCorner(CornerFamily.ROUNDED, 0F)
|
||||
.build()
|
||||
}
|
||||
|
||||
if (fileSize.visibility == View.GONE && codec.visibility == View.GONE){
|
||||
formatNote.shapeAppearanceModel = ShapeAppearanceModel.builder()
|
||||
.setTopLeftCorner(CornerFamily.ROUNDED, 40F)
|
||||
.setBottomLeftCorner(CornerFamily.ROUNDED, 40F)
|
||||
.setTopRightCorner(CornerFamily.ROUNDED, 40F)
|
||||
.setBottomRightCorner(CornerFamily.ROUNDED, 40F)
|
||||
.build()
|
||||
}
|
||||
|
||||
//OUTPUT
|
||||
val output = card.findViewById<TextView>(R.id.output)
|
||||
output.tag = "${item.id}##output"
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class HistoryAdapter(onItemClickListener: OnItemClickListener, activity: Activit
|
|||
} else {
|
||||
uiHandler.post { Picasso.get().load(R.color.black).into(thumbnail) }
|
||||
}
|
||||
thumbnail.setColorFilter(Color.argb(95, 0, 0, 0))
|
||||
thumbnail.setColorFilter(Color.argb(20, 0, 0, 0))
|
||||
|
||||
// TITLE ----------------------------------
|
||||
val itemTitle = card.findViewById<TextView>(R.id.downloads_title)
|
||||
|
|
|
|||
|
|
@ -56,11 +56,11 @@ class HomeAdapter(onItemClickListener: OnItemClickListener, activity: Activity)
|
|||
if (imageURL.isNotEmpty()) {
|
||||
val uiHandler = Handler(Looper.getMainLooper())
|
||||
uiHandler.post { Picasso.get().load(imageURL).into(thumbnail) }
|
||||
thumbnail.setColorFilter(Color.argb(70, 0, 0, 0))
|
||||
thumbnail.setColorFilter(Color.argb(20, 0, 0, 0))
|
||||
} else {
|
||||
val uiHandler = Handler(Looper.getMainLooper())
|
||||
uiHandler.post { Picasso.get().load(R.color.black).into(thumbnail) }
|
||||
thumbnail.setColorFilter(Color.argb(70, 0, 0, 0))
|
||||
thumbnail.setColorFilter(Color.argb(20, 0, 0, 0))
|
||||
}
|
||||
|
||||
// TITLE ----------------------------------
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import android.content.Context.CLIPBOARD_SERVICE
|
|||
import android.content.res.ColorStateList
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.RippleDrawable
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
|
|
@ -16,6 +19,7 @@ import android.view.View.*
|
|||
import android.widget.*
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.view.ActionMode
|
||||
import androidx.appcompat.view.StandaloneActionMode
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
import androidx.core.view.children
|
||||
|
|
@ -27,6 +31,7 @@ import androidx.lifecycle.lifecycleScope
|
|||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.deniscerri.ytdlnis.App
|
||||
import com.deniscerri.ytdlnis.MainActivity
|
||||
import com.deniscerri.ytdlnis.R
|
||||
import com.deniscerri.ytdlnis.adapter.HomeAdapter
|
||||
|
|
@ -497,7 +502,6 @@ class HomeFragment : Fragment(), HomeAdapter.OnItemClickListener, View.OnClickLi
|
|||
selectedObjects!!.add(item!!)
|
||||
if (actionMode == null){
|
||||
actionMode = (getActivity() as AppCompatActivity?)!!.startSupportActionMode(contextualActionBar)
|
||||
|
||||
}else{
|
||||
actionMode!!.title = "${selectedObjects!!.size} ${getString(R.string.selected)}"
|
||||
}
|
||||
|
|
@ -537,9 +541,9 @@ class HomeFragment : Fragment(), HomeAdapter.OnItemClickListener, View.OnClickLi
|
|||
override fun onCreateActionMode(mode: ActionMode?, menu: Menu?): Boolean {
|
||||
mode!!.menuInflater.inflate(R.menu.main_menu_context, menu)
|
||||
mode.title = "${selectedObjects!!.size} ${getString(R.string.selected)}"
|
||||
(activity as MainActivity).disableBottomNavigation()
|
||||
searchBar?.isEnabled = false
|
||||
searchBar!!.isEnabled = false
|
||||
searchBar!!.menu.forEach { it.isEnabled = false }
|
||||
(activity as MainActivity).disableBottomNavigation()
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
@ -614,8 +618,9 @@ class HomeFragment : Fragment(), HomeAdapter.OnItemClickListener, View.OnClickLi
|
|||
actionMode = null
|
||||
(activity as MainActivity).enableBottomNavigation()
|
||||
clearCheckedItems()
|
||||
searchBar?.isEnabled = true
|
||||
searchBar!!.isEnabled = true
|
||||
searchBar!!.menu.forEach { it.isEnabled = true }
|
||||
searchBar?.expand(searchBar!!.parent as AppBarLayout)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.content.Context.POWER_SERVICE
|
|||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Build.VERSION_CODES
|
||||
import android.os.Bundle
|
||||
import android.os.Environment
|
||||
import android.os.PowerManager
|
||||
|
|
@ -64,6 +65,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
private var updateYTDL: Preference? = null
|
||||
private var updateNightlyYTDL: SwitchPreferenceCompat? = null
|
||||
private var updateFormats: SwitchPreferenceCompat? = null
|
||||
private var formatSource: ListPreference? = null
|
||||
private var updateApp: SwitchPreferenceCompat? = null
|
||||
private var exportPreferences : Preference? = null
|
||||
private var importPreferences : Preference? = null
|
||||
|
|
@ -129,6 +131,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
updateYTDL = findPreference("update_ytdl")
|
||||
updateNightlyYTDL = findPreference("nightly_ytdl")
|
||||
updateFormats = findPreference("update_formats")
|
||||
formatSource = findPreference("formats_source")
|
||||
updateApp = findPreference("update_app")
|
||||
exportPreferences = findPreference("export_preferences")
|
||||
importPreferences = findPreference("import_preferences")
|
||||
|
|
@ -192,6 +195,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
editor.putString("video_quality", videoQuality!!.value)
|
||||
editor.putBoolean("nightly_ytdl", updateNightlyYTDL!!.isChecked)
|
||||
editor.putBoolean("update_formats", updateFormats!!.isChecked)
|
||||
editor.putString("formats_source", formatSource!!.value)
|
||||
editor.putBoolean("update_app", updateApp!!.isChecked)
|
||||
editor.apply()
|
||||
}
|
||||
|
|
@ -208,6 +212,7 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
language!!.summary = Locale(newValue.toString()).getDisplayLanguage(Locale(newValue.toString()))
|
||||
editor.apply()
|
||||
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(newValue.toString()))
|
||||
if (Build.VERSION.SDK_INT >= VERSION_CODES.TIRAMISU) requireActivity().recreate()
|
||||
true
|
||||
}
|
||||
|
||||
|
|
@ -420,19 +425,19 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
editor.apply()
|
||||
true
|
||||
}
|
||||
audioFormat!!.summary = preferences.getString("audio_format", "")
|
||||
audioFormat!!.summary = preferences.getString("audio_format", "")!!.replace("Default", getString(R.string.defaultValue))
|
||||
audioFormat!!.onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
||||
editor.putString("audio_format", newValue.toString())
|
||||
audioFormat!!.summary = newValue.toString()
|
||||
audioFormat!!.summary = newValue.toString().replace("Default", getString(R.string.defaultValue))
|
||||
editor.apply()
|
||||
true
|
||||
}
|
||||
videoFormat!!.summary = preferences.getString("video_format", "")
|
||||
videoFormat!!.summary = preferences.getString("video_format", "")!!.replace("Default", getString(R.string.defaultValue))
|
||||
videoFormat!!.onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
||||
editor.putString("video_format", newValue.toString())
|
||||
videoFormat!!.summary = newValue.toString()
|
||||
videoFormat!!.summary = newValue.toString().replace("Default", getString(R.string.defaultValue))
|
||||
editor.apply()
|
||||
true
|
||||
}
|
||||
|
|
@ -483,6 +488,14 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
editor.apply()
|
||||
true
|
||||
}
|
||||
formatSource!!.summary = preferences.getString("formats_source", "")!!.replace("Default", getString(R.string.defaultValue))
|
||||
formatSource!!.onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
||||
editor.putString("formats_source", newValue.toString())
|
||||
formatSource!!.summary = newValue.toString().replace("Default", getString(R.string.defaultValue))
|
||||
editor.apply()
|
||||
true
|
||||
}
|
||||
updateNightlyYTDL!!.onPreferenceChangeListener =
|
||||
Preference.OnPreferenceChangeListener { _: Preference?, newValue: Any ->
|
||||
val enable = newValue as Boolean
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.deniscerri.ytdlnis.util
|
|||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import android.widget.Toast
|
||||
|
|
@ -24,12 +25,13 @@ import java.util.regex.Pattern
|
|||
|
||||
class InfoUtil(private val context: Context) {
|
||||
private var items: ArrayList<ResultItem?>
|
||||
private lateinit var sharedPreferences: SharedPreferences
|
||||
private var key: String? = null
|
||||
private var useInvidous = false
|
||||
|
||||
init {
|
||||
try {
|
||||
val sharedPreferences =
|
||||
sharedPreferences =
|
||||
context.getSharedPreferences("root_preferences", Activity.MODE_PRIVATE)
|
||||
key = sharedPreferences.getString("api_key", "")
|
||||
} catch (e: Exception) {
|
||||
|
|
@ -483,11 +485,10 @@ class InfoUtil(private val context: Context) {
|
|||
init()
|
||||
val p = Pattern.compile("^(https?)://(www.)?youtu(.be)?")
|
||||
val m = p.matcher(url)
|
||||
return if(m.find() && useInvidous){
|
||||
val formatSource = sharedPreferences.getString("formats_source", context.getString(R.string.defaultValue))!!
|
||||
return if(m.find() && useInvidous && formatSource == "Default"){
|
||||
val id = getIDFromYoutubeURL(url)
|
||||
Log.e("Aa", id)
|
||||
val res = genericRequest(invidousURL + "videos/" + id)
|
||||
Log.e("aa", res.toString())
|
||||
if (res.length() == 0) getFromYTDL(url)[0]!!
|
||||
else createVideofromInvidiousJSON(
|
||||
res
|
||||
|
|
@ -556,9 +557,17 @@ class InfoUtil(private val context: Context) {
|
|||
val formats : ArrayList<Format> = ArrayList()
|
||||
if (formatsInJSON != null) {
|
||||
for (f in 0 until formatsInJSON.length()){
|
||||
val format = formatsInJSON.getJSONObject(f).toString()
|
||||
val formatProper = Gson().fromJson(format, Format::class.java)
|
||||
if (formatProper.filesize > 0) formats.add(formatProper)
|
||||
val format = formatsInJSON.getJSONObject(f)
|
||||
val formatProper = Gson().fromJson(format.toString(), Format::class.java)
|
||||
if (formatProper.filesize > 0){
|
||||
if ( !formatProper.format_note.contains("audio only", true)) {
|
||||
formatProper.format_note = format.getString("format_note")
|
||||
}else{
|
||||
formatProper.format_note = "${format.getString("format_note")} audio"
|
||||
}
|
||||
formatProper.container = format.getString("ext")
|
||||
formats.add(formatProper)
|
||||
}
|
||||
}
|
||||
}
|
||||
Log.e("aa", formats.toString())
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ class DownloadWorker(
|
|||
request.addOption("-f", audioQualityId)
|
||||
|
||||
val ext = downloadItem.format.container
|
||||
if(ext != context.getString(R.string.defaultValue) && ext != "webm"){
|
||||
if(ext != "Default" && ext != "webm"){
|
||||
val codec = when(downloadItem.format.container){
|
||||
"aac" -> "aac"
|
||||
"mp3" -> "libmp3lame"
|
||||
|
|
@ -220,7 +220,7 @@ class DownloadWorker(
|
|||
Log.e(TAG, formatArgument)
|
||||
request.addOption("-f", formatArgument)
|
||||
val format = downloadItem.format.container
|
||||
if(format.isNotEmpty() && format != context.resources.getString(R.string.defaultValue)){
|
||||
if(format.isNotEmpty() && format != "Default"){
|
||||
request.addOption("--merge-output-format", format)
|
||||
if (format != "webm") {
|
||||
val embedThumb = sharedPreferences.getBoolean("embed_thumbnail", false)
|
||||
|
|
|
|||
5
app/src/main/res/drawable/baseline_manage_search_24.xml
Normal file
5
app/src/main/res/drawable/baseline_manage_search_24.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<vector android:autoMirrored="true" android:height="24dp"
|
||||
android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="?android:colorAccent" android:pathData="M7,9H2V7h5V9zM7,12H2v2h5V12zM20.59,19l-3.83,-3.83C15.96,15.69 15.02,16 14,16c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5s5,2.24 5,5c0,1.02 -0.31,1.96 -0.83,2.75L22,17.59L20.59,19zM17,11c0,-1.65 -1.35,-3 -3,-3s-3,1.35 -3,3s1.35,3 3,3S17,12.65 17,11zM2,19h10v-2H2V19z"/>
|
||||
</vector>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/downloads_card_constraintLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -18,7 +19,7 @@
|
|||
android:id="@+id/active_download_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="10dp"
|
||||
app:cardMaxElevation="12dp"
|
||||
android:checkable="true"
|
||||
|
|
@ -30,7 +31,6 @@
|
|||
android:id="@+id/image_view"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:foreground="@drawable/image_gradient_shape"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
|
@ -46,95 +46,51 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_author"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
android:dividerPadding="5dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/linearlayout2_horizontalscrollview"
|
||||
app:layout_constraintEnd_toStartOf="@+id/active_download_cancel"
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/download_type"
|
||||
style="?attr/materialIconButtonFilledTonalStyle"
|
||||
app:backgroundTint="?attr/colorSurface"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_margin="10dp"
|
||||
android:insetLeft="0dp"
|
||||
android:insetTop="0dp"
|
||||
android:insetRight="0dp"
|
||||
android:insetBottom="0dp"
|
||||
app:icon="@drawable/ic_music"
|
||||
app:iconPadding="0dp"
|
||||
app:iconSize="13dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingStart="10dp"
|
||||
android:textSize="17sp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="2"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowColor="@color/black" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="bottom"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingStart="10dp"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="1.5"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowColor="@color/black" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier"
|
||||
app:barrierDirection="bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="title_author,active_download_cancel"/>
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Full" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/linearlayout2_horizontalscrollview"
|
||||
android:layout_width="0dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="10dp"
|
||||
android:scrollbars="none"
|
||||
app:layout_constraintBottom_toTopOf="@+id/title_author"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/barrier">
|
||||
app:layout_constraintStart_toEndOf="@+id/download_type">
|
||||
|
||||
<com.google.android.material.chip.ChipGroup
|
||||
android:id="@+id/linearLayout2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="10dp">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/type"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:chipMinTouchTargetSize="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/output"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
android:paddingHorizontal="10dp"
|
||||
app:chipSpacingHorizontal="0dp">
|
||||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/format_note"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="false"
|
||||
app:chipStrokeWidth="0.5dp"
|
||||
app:shapeAppearance="@style/ShapeAppearanceOverlay.Chip.RoundedStart"
|
||||
android:textSize="11sp"
|
||||
app:chipMinTouchTargetSize="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -145,7 +101,10 @@
|
|||
android:id="@+id/codec"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:shapeAppearance="@style/ShapeAppearanceOverlay.Chip.Middle"
|
||||
android:clickable="false"
|
||||
app:chipStrokeWidth="0.5dp"
|
||||
android:textSize="11sp"
|
||||
app:chipMinTouchTargetSize="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -153,9 +112,12 @@
|
|||
|
||||
<com.google.android.material.chip.Chip
|
||||
android:id="@+id/file_size"
|
||||
app:chipStrokeWidth="0.5dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:shapeAppearance="@style/ShapeAppearanceOverlay.Chip.RoundedEnd"
|
||||
android:clickable="false"
|
||||
android:textSize="11sp"
|
||||
app:chipMinTouchTargetSize="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -165,32 +127,87 @@
|
|||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_author"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:dividerPadding="5dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/output"
|
||||
app:layout_constraintEnd_toStartOf="@+id/active_download_cancel"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/download_type">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:shadowColor="#000"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowRadius="2"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/author"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:gravity="bottom"
|
||||
android:maxLines="1"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:shadowColor="#000"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowRadius="1.5"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/output"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:clickable="true"
|
||||
android:padding="10dp"
|
||||
android:textSize="11sp"
|
||||
android:ellipsize="end"
|
||||
android:focusable="true"
|
||||
android:fontFamily="monospace"
|
||||
android:maxLines="2"
|
||||
android:padding="10dp"
|
||||
android:shadowColor="#000"
|
||||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowRadius="2"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="11sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:focusable="true" />
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/active_download_cancel"
|
||||
style="?attr/materialIconButtonFilledTonalStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="10dp"
|
||||
app:iconSize="30dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:cornerRadius="10dp"
|
||||
app:icon="@drawable/ic_cancel"
|
||||
app:iconSize="30dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="@+id/title_author" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@
|
|||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/download_viewpager"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/home_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
app:title="@string/app_name"
|
||||
app:layout_scrollFlags="scroll"
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@
|
|||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowRadius="10"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toStartOf="@+id/downloads_download_button_type"
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
android:shadowDx="4"
|
||||
android:shadowDy="4"
|
||||
android:shadowRadius="10"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
android:id="@+id/result_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="5dp"
|
||||
app:cardMaxElevation="12dp"
|
||||
app:cardPreventCornerOverlap="true"
|
||||
|
|
@ -72,7 +72,7 @@
|
|||
android:shadowDy="4"
|
||||
android:scrollbars="none"
|
||||
android:shadowRadius="2"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
android:shadowDy="4"
|
||||
android:scrollbars="none"
|
||||
android:shadowRadius="1.5"
|
||||
android:textColor="@color/white"
|
||||
android:textColor="#FFF"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
android:id="@+id/result_shimmer_card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardCornerRadius="20dp"
|
||||
app:cardElevation="10dp"
|
||||
app:cardMaxElevation="12dp"
|
||||
app:cardBackgroundColor="@color/grey"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="icon_bg">@android:color/background_dark</color>
|
||||
<color name="black">#000000</color>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,17 @@
|
|||
<item>wav</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="audio_containers_values">
|
||||
<item>Default</item>
|
||||
<item>mp3</item>
|
||||
<item>m4a</item>
|
||||
<item>aac</item>
|
||||
<item>alac</item>
|
||||
<item>flac</item>
|
||||
<item>opus</item>
|
||||
<item>wav</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="video_containers">
|
||||
<item>@string/defaultValue</item>
|
||||
<item>mp4</item>
|
||||
|
|
@ -17,6 +28,13 @@
|
|||
<item>webm</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="video_containers_values">
|
||||
<item>Default</item>
|
||||
<item>mp4</item>
|
||||
<item>mkv</item>
|
||||
<item>webm</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="video_formats">
|
||||
<item>@string/worst_quality</item>
|
||||
<item>360p</item>
|
||||
|
|
@ -97,4 +115,14 @@
|
|||
<item>0.0</item>
|
||||
<item>100.0</item>
|
||||
</array>
|
||||
|
||||
<array name="formats_source">
|
||||
<item>@string/defaultValue</item>
|
||||
<item>yt-dlp</item>
|
||||
</array>
|
||||
|
||||
<array name="formats_source_values">
|
||||
<item>@string/defaultValue</item>
|
||||
<item>yt-dlp</item>
|
||||
</array>
|
||||
</resources>
|
||||
|
|
@ -211,4 +211,5 @@
|
|||
<string name="save_subs">Save Subtitles</string>
|
||||
<string name="save_subs_desc">Write subtitle file</string>
|
||||
<string name="subtitle_languages">Subtitle languages</string>
|
||||
<string name="format_source">Formats Source</string>
|
||||
</resources>
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
<item name="android:windowLightStatusBar">?attr/isLightTheme</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:color">@android:color/transparent</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="alertDialogTheme">@style/ThemeOverlay.Material3.MaterialAlertDialog</item>
|
||||
<item name="dialogCornerRadius">28dp</item>
|
||||
</style>
|
||||
|
|
@ -52,4 +53,25 @@
|
|||
<item name="cornerSize">5dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Chip.RoundedStart" parent="ShapeAppearance.MaterialComponents.SmallComponent">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopLeft">15dp</item>
|
||||
<item name="cornerSizeTopRight">0dp</item>
|
||||
<item name="cornerSizeBottomLeft">15dp</item>
|
||||
<item name="cornerSizeBottomRight">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Chip.RoundedEnd" parent="ShapeAppearance.MaterialComponents.SmallComponent">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSizeTopLeft">0dp</item>
|
||||
<item name="cornerSizeTopRight">15dp</item>
|
||||
<item name="cornerSizeBottomLeft">0dp</item>
|
||||
<item name="cornerSizeBottomRight">15dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearanceOverlay.Chip.Middle" parent="ShapeAppearance.MaterialComponents.SmallComponent">
|
||||
<item name="cornerFamily">rounded</item>
|
||||
<item name="cornerSize">0dp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -212,18 +212,18 @@
|
|||
app:title="@string/save_thumb" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="@string/defaultValue"
|
||||
android:defaultValue="Default"
|
||||
android:entries="@array/audio_containers"
|
||||
android:entryValues="@array/audio_containers"
|
||||
android:entryValues="@array/audio_containers_values"
|
||||
android:icon="@drawable/ic_code"
|
||||
app:key="audio_format"
|
||||
app:summary="@string/defaultValue"
|
||||
app:title="@string/audio_format" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="@string/defaultValue"
|
||||
android:defaultValue="Default"
|
||||
android:entries="@array/video_containers"
|
||||
android:entryValues="@array/video_containers"
|
||||
android:entryValues="@array/video_containers_values"
|
||||
android:icon="@drawable/ic_code"
|
||||
app:key="video_format"
|
||||
app:summary="@string/defaultValue"
|
||||
|
|
@ -275,6 +275,15 @@
|
|||
app:summary="@string/update_formats_summary"
|
||||
app:title="@string/update_formats" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="Default"
|
||||
android:entries="@array/formats_source"
|
||||
android:entryValues="@array/formats_source_values"
|
||||
android:icon="@drawable/baseline_manage_search_24"
|
||||
app:key="formats_source"
|
||||
app:summary="@string/defaultValue"
|
||||
app:title="@string/format_source" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:widgetLayout="@layout/preferece_material_switch"
|
||||
app:defaultValue="true"
|
||||
|
|
@ -287,17 +296,17 @@
|
|||
|
||||
<PreferenceCategory android:title="@string/about">
|
||||
|
||||
<Preference
|
||||
app:isPreferenceVisible="false"
|
||||
app:icon="@drawable/ic_clipboard"
|
||||
app:key="export_preferences"
|
||||
app:title="@string/export_from_clipboard"/>
|
||||
<!-- <Preference-->
|
||||
<!-- app:isPreferenceVisible="false"-->
|
||||
<!-- app:icon="@drawable/ic_clipboard"-->
|
||||
<!-- app:key="export_preferences"-->
|
||||
<!-- app:title="@string/export_from_clipboard"/>-->
|
||||
|
||||
<Preference
|
||||
app:isPreferenceVisible="false"
|
||||
app:icon="@drawable/ic_copy"
|
||||
app:key="import_preferences"
|
||||
app:title="@string/import_from_clipboard"/>
|
||||
<!-- <Preference-->
|
||||
<!-- app:isPreferenceVisible="false"-->
|
||||
<!-- app:icon="@drawable/ic_copy"-->
|
||||
<!-- app:key="import_preferences"-->
|
||||
<!-- app:title="@string/import_from_clipboard"/>-->
|
||||
|
||||
<Preference
|
||||
app:icon="@drawable/ic_discord"
|
||||
|
|
|
|||
Loading…
Reference in a new issue