changed bottom sheet design
This commit is contained in:
parent
ad452de1ae
commit
9f7ef2f93d
4 changed files with 69 additions and 79 deletions
|
|
@ -414,8 +414,12 @@ class HomeFragment : Fragment(), HomeAdapter.OnItemClickListener, View.OnClickLi
|
||||||
it.forEachIndexed { i, itemID ->
|
it.forEachIndexed { i, itemID ->
|
||||||
downloadList[i].id = itemID
|
downloadList[i].id = itemID
|
||||||
}
|
}
|
||||||
val bottomSheet = DownloadMultipleBottomSheetDialog(downloadList)
|
if (sharedPreferences!!.getBoolean("download_card", true)) {
|
||||||
bottomSheet.show(parentFragmentManager, "downloadMultipleSheet")
|
val bottomSheet = DownloadMultipleBottomSheetDialog(downloadList)
|
||||||
|
bottomSheet.show(parentFragmentManager, "downloadMultipleSheet")
|
||||||
|
} else {
|
||||||
|
downloadViewModel.queueDownloads(downloadList)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (viewIdName == "downloadAll") {
|
if (viewIdName == "downloadAll") {
|
||||||
|
|
@ -424,8 +428,12 @@ class HomeFragment : Fragment(), HomeAdapter.OnItemClickListener, View.OnClickLi
|
||||||
it.forEachIndexed { i, itemID ->
|
it.forEachIndexed { i, itemID ->
|
||||||
downloadList[i].id = itemID
|
downloadList[i].id = itemID
|
||||||
}
|
}
|
||||||
val bottomSheet = DownloadMultipleBottomSheetDialog(downloadList)
|
if (sharedPreferences!!.getBoolean("download_card", true)) {
|
||||||
bottomSheet.show(parentFragmentManager, "downloadMultipleSheet")
|
val bottomSheet = DownloadMultipleBottomSheetDialog(downloadList)
|
||||||
|
bottomSheet.show(parentFragmentManager, "downloadMultipleSheet")
|
||||||
|
} else {
|
||||||
|
downloadViewModel.queueDownloads(downloadList)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,9 @@ class DownloadBottomSheetDialog(private val resultItem: ResultItem, private val
|
||||||
|
|
||||||
dialog.setOnShowListener {
|
dialog.setOnShowListener {
|
||||||
behavior = BottomSheetBehavior.from(view.parent as View)
|
behavior = BottomSheetBehavior.from(view.parent as View)
|
||||||
behavior.skipCollapsed = true
|
behavior.peekHeight = 1200
|
||||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tabLayout = view.findViewById(R.id.download_tablayout)
|
tabLayout = view.findViewById(R.id.download_tablayout)
|
||||||
viewPager2 = view.findViewById(R.id.download_viewpager)
|
viewPager2 = view.findViewById(R.id.download_viewpager)
|
||||||
|
|
||||||
|
|
@ -133,11 +131,6 @@ class DownloadBottomSheetDialog(private val resultItem: ResultItem, private val
|
||||||
datepicker.show()
|
datepicker.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
val cancelBtn = view.findViewById<MaterialButton>(R.id.bottomsheet_cancel_button)
|
|
||||||
cancelBtn.setOnClickListener{
|
|
||||||
dismiss()
|
|
||||||
}
|
|
||||||
|
|
||||||
val download = view.findViewById<Button>(R.id.bottomsheet_download_button)
|
val download = view.findViewById<Button>(R.id.bottomsheet_download_button)
|
||||||
download!!.setOnClickListener {
|
download!!.setOnClickListener {
|
||||||
val item: DownloadItem = getDownloadItem();
|
val item: DownloadItem = getDownloadItem();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
|
@ -8,43 +9,78 @@
|
||||||
<ScrollView
|
<ScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:orientation="vertical"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="20dp"
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="0dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:paddingHorizontal="20dp"
|
android:paddingTop="20dp">
|
||||||
android:orientation="vertical">
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bottom_sheet_title"
|
android:id="@+id/bottom_sheet_title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:textSize="25sp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/download" />
|
android:text="@string/download"
|
||||||
|
android:textSize="25sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/bottom_sheet_subtitle"
|
android:id="@+id/bottom_sheet_subtitle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:textSize="15sp"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/configure_download" />
|
android:text="@string/configure_download"
|
||||||
</LinearLayout>
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/bottom_sheet_title" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bottomsheet_schedule_button"
|
||||||
|
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:icon="@drawable/ic_clock"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/bottomsheet_download_button"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bottomsheet_download_button"
|
||||||
|
style="@style/Widget.Material3.Button.ElevatedButton.Icon"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autoLink="all"
|
||||||
|
android:text="@string/download"
|
||||||
|
app:icon="@drawable/ic_down"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabLayout
|
<com.google.android.material.tabs.TabLayout
|
||||||
|
android:id="@+id/download_tablayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:backgroundTint="@android:color/transparent"
|
|
||||||
app:tabMode="scrollable"
|
|
||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
|
android:backgroundTint="@android:color/transparent"
|
||||||
app:tabGravity="fill"
|
app:tabGravity="fill"
|
||||||
android:id="@+id/download_tablayout" >
|
app:tabMode="scrollable">
|
||||||
|
|
||||||
<com.google.android.material.tabs.TabItem
|
<com.google.android.material.tabs.TabItem
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
@ -62,63 +98,16 @@
|
||||||
android:text="@string/run_command" />
|
android:text="@string/run_command" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</com.google.android.material.tabs.TabLayout>
|
</com.google.android.material.tabs.TabLayout>
|
||||||
|
|
||||||
|
|
||||||
<androidx.viewpager2.widget.ViewPager2
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
|
android:id="@+id/download_viewpager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
android:id="@+id/download_viewpager" />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
|
||||||
android:id="@+id/bottomsheet_schedule_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
app:icon="@drawable/ic_clock" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:gravity="end"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.Material3.Button.OutlinedButton.Icon"
|
|
||||||
android:id="@+id/bottomsheet_cancel_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/cancel"
|
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
app:icon="@drawable/ic_cancel" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
style="@style/Widget.Material3.Button.ElevatedButton.Icon"
|
|
||||||
android:id="@+id/bottomsheet_download_button"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/download"
|
|
||||||
app:icon="@drawable/ic_down"
|
|
||||||
android:autoLink="all"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
<string name="write_ytdlp_command">Write yt-dlp command</string>
|
<string name="write_ytdlp_command">Write yt-dlp command</string>
|
||||||
<string name="run">Run</string>
|
<string name="run">Run</string>
|
||||||
<string name="running_ytdlp_command">Running custom yt-dlp command…</string>
|
<string name="running_ytdlp_command">Running custom yt-dlp command…</string>
|
||||||
<string name="command_directory">Folder for Custom Command</string>
|
<string name="command_directory">Custom Command Folder</string>
|
||||||
<string name="error_checking_latest_version">Could not check for latest version.</string>
|
<string name="error_checking_latest_version">Could not check for latest version.</string>
|
||||||
<string name="couldnt_find_apk">Could not find a suitable APK.</string>
|
<string name="couldnt_find_apk">Could not find a suitable APK.</string>
|
||||||
<string name="downloading_update">Downloading new version…</string>
|
<string name="downloading_update">Downloading new version…</string>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue