changed terminal design
This commit is contained in:
parent
1920afac33
commit
36d8f5f512
5 changed files with 74 additions and 69 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -6,4 +6,4 @@
|
|||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
benchmark
|
||||
/benchmark
|
||||
|
|
@ -57,8 +57,8 @@ class TerminalActivity : AppCompatActivity() {
|
|||
input!!.requestFocus()
|
||||
fab = findViewById(R.id.command_fab)
|
||||
fab!!.setOnClickListener {
|
||||
input!!.isEnabled = false
|
||||
output!!.text = ""
|
||||
input!!.visibility = View.GONE
|
||||
output!!.text = "${output!!.text}\n~ $ ${input!!.text}\n";
|
||||
swapFabs()
|
||||
startDownload(
|
||||
input!!.text.toString()
|
||||
|
|
@ -67,7 +67,7 @@ class TerminalActivity : AppCompatActivity() {
|
|||
cancelFab = findViewById(R.id.cancel_command_fab)
|
||||
cancelFab!!.setOnClickListener {
|
||||
cancelDownload()
|
||||
input!!.isEnabled = true
|
||||
input!!.visibility = View.VISIBLE
|
||||
}
|
||||
notificationUtil = NotificationUtil(this)
|
||||
handleIntent(intent)
|
||||
|
|
@ -166,7 +166,7 @@ class TerminalActivity : AppCompatActivity() {
|
|||
output!!.scrollTo(0, output!!.height)
|
||||
scrollView!!.fullScroll(View.FOCUS_DOWN)
|
||||
|
||||
input!!.isEnabled = true
|
||||
input!!.visibility = View.VISIBLE
|
||||
|
||||
cancelFab!!.visibility = View.GONE
|
||||
fab!!.visibility = View.VISIBLE
|
||||
|
|
@ -177,9 +177,10 @@ class TerminalActivity : AppCompatActivity() {
|
|||
.subscribeOn(Schedulers.newThread())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe({
|
||||
scrollView!!.scrollTo(0, scrollView!!.maxScrollAmount)
|
||||
output!!.scrollTo(0, output!!.height)
|
||||
scrollView!!.fullScroll(View.FOCUS_DOWN)
|
||||
input!!.setText("yt-dlp ")
|
||||
input!!.isEnabled = true
|
||||
input!!.visibility = View.VISIBLE
|
||||
|
||||
cancelFab!!.visibility = View.GONE
|
||||
fab!!.visibility = View.VISIBLE
|
||||
|
|
@ -193,9 +194,10 @@ class TerminalActivity : AppCompatActivity() {
|
|||
notificationUtil.cancelDownloadNotification(downloadID)
|
||||
}) { e ->
|
||||
e.printStackTrace()
|
||||
scrollView!!.scrollTo(0, scrollView!!.maxScrollAmount)
|
||||
output!!.scrollTo(0, output!!.height)
|
||||
scrollView!!.fullScroll(View.FOCUS_DOWN)
|
||||
input!!.setText("yt-dlp ")
|
||||
input!!.isEnabled = true
|
||||
input!!.visibility = View.VISIBLE
|
||||
|
||||
cancelFab!!.visibility = View.GONE
|
||||
fab!!.visibility = View.VISIBLE
|
||||
|
|
|
|||
|
|
@ -69,9 +69,7 @@ class DownloadWorker(
|
|||
val downloadLocation = downloadItem.downloadPath
|
||||
|
||||
val titleRegex = Regex("[^A-Za-z\\d ]")
|
||||
val tempFolder = StringBuilder(context.cacheDir.absolutePath + """/${titleRegex.replace(downloadItem.title, "")}##${downloadItem.type}""")
|
||||
tempFolder.append("##${downloadItem.format.format_id}")
|
||||
val tempFileDir = File(tempFolder.toString())
|
||||
val tempFileDir = File(context.cacheDir.absolutePath + downloadItem.id)
|
||||
tempFileDir.delete()
|
||||
tempFileDir.mkdir()
|
||||
|
||||
|
|
@ -115,6 +113,8 @@ class DownloadWorker(
|
|||
request.addOption("--restrict-filenames")
|
||||
}
|
||||
|
||||
request.addOption("--trim-filenames", 100)
|
||||
|
||||
when(type){
|
||||
DownloadViewModel.Type.audio -> {
|
||||
request.addOption("-x")
|
||||
|
|
|
|||
|
|
@ -22,31 +22,40 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/command_edittext"
|
||||
android:background="@android:color/transparent"
|
||||
android:text="yt-dlp "
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textMultiLine"
|
||||
android:gravity="start"
|
||||
android:maxLines="10" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/custom_command_scrollview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="150dp"
|
||||
android:paddingBottom="100dp"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/custom_command_output"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:fontFamily="monospace"
|
||||
android:gravity="bottom"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/custom_command_output"
|
||||
android:layout_width="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:fontFamily="monospace"
|
||||
android:gravity="bottom"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/command_edittext"
|
||||
android:background="@android:color/transparent"
|
||||
android:layout_width="match_parent"
|
||||
android:fontFamily="monospace"
|
||||
android:text="yt-dlp "
|
||||
android:textSize="13sp"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textMultiLine"
|
||||
android:gravity="start"
|
||||
android:maxLines="100" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
|
|
|
|||
|
|
@ -13,64 +13,58 @@
|
|||
android:hint="@string/search_hint"
|
||||
app:layout_anchor="@id/search_bar">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<ScrollView
|
||||
android:id="@+id/search_history_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/search_history_scroll_view"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="-10dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/link_you_copied"
|
||||
layout="@layout/search_suggestion_item"
|
||||
/>
|
||||
android:layout_marginBottom="-10dp"
|
||||
android:visibility="gone"
|
||||
android:id="@+id/link_you_copied"
|
||||
layout="@layout/search_suggestion_item"
|
||||
/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/search_history_linear_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/search_suggestions_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:id="@+id/search_suggestions_linear_layout"
|
||||
android:id="@+id/search_history_linear_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/search_suggestions_scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:id="@+id/search_suggestions_linear_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.search.SearchView>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue