Skip to content

Commit 30bffd0

Browse files
committed
Bug Fix
1 parent cc35636 commit 30bffd0

File tree

9 files changed

+42
-20
lines changed

9 files changed

+42
-20
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ apply(plugin = "dagger.hilt.android.plugin")
1212
val versionMajor = 0
1313
val versionMinor = 0
1414
val versionPatch = 8
15-
val versionBuild = 4
16-
val isStable = false
15+
val versionBuild = 5
16+
val isStable = true
1717

1818
val composeVersion = "1.2.0-beta03"
1919
val lifecycleVersion = "2.5.0-rc01"
@@ -23,6 +23,7 @@ val accompanistVersion = "0.24.7-alpha"
2323
val kotlinVersion = "1.6.21"
2424
val hiltVersion = "2.42"
2525
val composeMd3Version = "1.0.0-alpha13"
26+
2627
val keystorePropertiesFile = rootProject.file("keystore.properties")
2728
val keystoreProperties = Properties()
2829
keystoreProperties.load(FileInputStream(keystorePropertiesFile))

app/src/main/java/com/junkfood/seal/MainActivity.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import androidx.activity.compose.setContent
77
import androidx.activity.viewModels
88
import androidx.appcompat.app.AppCompatActivity
99
import androidx.appcompat.app.AppCompatDelegate
10+
import androidx.compose.animation.ExperimentalAnimationApi
1011
import androidx.core.os.LocaleListCompat
1112
import androidx.core.view.ViewCompat
1213
import androidx.core.view.WindowCompat
@@ -22,6 +23,8 @@ import kotlinx.coroutines.runBlocking
2223
@AndroidEntryPoint
2324
class MainActivity : AppCompatActivity() {
2425
private val downloadViewModel: DownloadViewModel by viewModels()
26+
27+
@OptIn(ExperimentalAnimationApi::class)
2528
override fun onCreate(savedInstanceState: Bundle?) {
2629
runBlocking {
2730
AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(PreferenceUtil.getLanguageConfiguration()))
@@ -50,12 +53,18 @@ class MainActivity : AppCompatActivity() {
5053
intent.getStringExtra(Intent.EXTRA_TEXT)
5154
?.let { it ->
5255
TextUtil.matchUrlFromSharedText(it)
53-
?.let { it1 -> downloadViewModel.updateUrl(it1) }
56+
?.let { it1 ->
57+
if (sharedUrl != it1) {
58+
sharedUrl = it1
59+
downloadViewModel.updateUrl(sharedUrl)
60+
}
61+
}
5462
}
5563
}
5664

5765
companion object {
5866
private const val TAG = "MainActivity"
67+
private var sharedUrl = ""
5968
fun setLanguage(locale: String) {
6069
if (locale.isEmpty()) return
6170
BaseApplication.applicationScope.launch(Dispatchers.Main) {

app/src/main/java/com/junkfood/seal/ui/component/VideoListItem.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ fun VideoListItem(
5454
AsyncImage(
5555
modifier = Modifier
5656
.fillMaxWidth(0.45f)
57-
.aspectRatio(16f / 9f, matchHeightConstraintsFirst = true)
58-
,
57+
.aspectRatio(16f / 9f, matchHeightConstraintsFirst = true),
5958
model = ImageRequest.Builder(LocalContext.current)
6059
.data(thumbnailUrl)
6160
.networkCachePolicy(CachePolicy.DISABLED)
@@ -117,7 +116,10 @@ fun VideoListItem(
117116
.align(Alignment.BottomEnd),
118117
onClick = onLongClick
119118
) {
120-
Icon(imageVector = Icons.Outlined.MoreVert, contentDescription = "More")
119+
Icon(
120+
imageVector = Icons.Outlined.MoreVert,
121+
contentDescription = stringResource(id = R.string.show_more_actions)
122+
)
121123
}
122124
}
123125
}
@@ -211,7 +213,10 @@ fun AudioListItem(
211213
.align(Alignment.BottomEnd),
212214
onClick = onLongClick
213215
) {
214-
Icon(imageVector = Icons.Outlined.MoreVert, contentDescription = "More")
216+
Icon(
217+
imageVector = Icons.Outlined.MoreVert,
218+
contentDescription = stringResource(id = R.string.show_more_actions)
219+
)
215220
}
216221
}
217222
}

app/src/main/java/com/junkfood/seal/ui/page/settings/download/AdvancedSettingDialogs.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ import androidx.compose.foundation.layout.*
66
import androidx.compose.foundation.rememberScrollState
77
import androidx.compose.foundation.verticalScroll
88
import androidx.compose.material.icons.Icons
9+
import androidx.compose.material.icons.outlined.ContentPaste
910
import androidx.compose.material.icons.outlined.OpenInNew
1011
import androidx.compose.material3.*
1112
import androidx.compose.runtime.*
1213
import androidx.compose.ui.Modifier
14+
import androidx.compose.ui.platform.LocalClipboardManager
1315
import androidx.compose.ui.platform.LocalContext
1416
import androidx.compose.ui.res.stringResource
1517
import androidx.compose.ui.unit.dp
@@ -26,7 +28,7 @@ fun CommandTemplateDialog(
2628
val context = LocalContext.current
2729
val ytdlpReference = "https://github.com/yt-dlp/yt-dlp#usage-and-options"
2830
var template by remember { mutableStateOf(PreferenceUtil.getTemplate()) }
29-
31+
val clipboardManager = LocalClipboardManager.current
3032
AlertDialog(
3133
title = { Text(stringResource(R.string.edit_custom_command_template)) },
3234
onDismissRequest = onDismissRequest,
@@ -53,8 +55,13 @@ fun CommandTemplateDialog(
5355
OutlinedTextField(
5456
modifier = Modifier.padding(vertical = 12.dp),
5557
value = template,
56-
onValueChange = { template = it },
57-
label = { Text(stringResource(R.string.custom_command_template)) })
58+
onValueChange = { template = it }, trailingIcon = {
59+
IconButton(onClick = {
60+
clipboardManager.getText()?.let { template = it.text }
61+
}) { Icon(Icons.Outlined.ContentPaste, stringResource(R.string.paste)) }
62+
},
63+
label = { Text(stringResource(R.string.custom_command_template)) },maxLines = 3
64+
)
5865

5966
TextButton(
6067
onClick = {

app/src/main/java/com/junkfood/seal/util/NotificationUtil.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object NotificationUtil {
1717
private const val CHANNEL_ID = "download_notification"
1818
private const val NOTIFICATION_ID = 100
1919

20-
private val builder = NotificationCompat.Builder(context, CHANNEL_ID)
20+
private var builder = NotificationCompat.Builder(context, CHANNEL_ID)
2121

2222
fun createNotificationChannel() {
2323
val name = context.getString(R.string.channel_name)
@@ -30,7 +30,7 @@ object NotificationUtil {
3030
}
3131

3232
fun makeNotification(notificationId: Int = NOTIFICATION_ID, title: String, text: String) {
33-
builder.setContentTitle(title)
33+
builder = NotificationCompat.Builder(context, CHANNEL_ID).setContentTitle(title)
3434
.setContentText(text)
3535
.setSmallIcon(R.drawable.seal)
3636
.setProgress(PROGRESS_MAX, PROGRESS_INITIAL, false)

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
<string name="concurrent_download_num">将同时使用 %d 个线程下载 HLS/DASH 流视频</string>
117117
<string name="options">选项</string>
118118
<string name="additional_settings">附加设置</string>
119-
<string name="quality">画质</string>
120119
<string name="share_fail_msg">未能从分享内容中匹配到视频链接</string>
121120
<string name="share_success_msg">从分享内容获取视频链接</string>
121+
<string name="show_more_actions">显示更多操作</string>
122122
</resources>

app/src/main/res/values/strings.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<string name="concurrent_download_num">%d thread(s) would be used to download dash/hlsnative video concurrently.</string>
131131
<string name="options">Options</string>
132132
<string name="additional_settings">Additional settings</string>
133-
<string name="quality">Quality</string>
134133
<string name="share_fail_msg">Unable to match URL from shared content</string>
135-
<string name="share_success_msg">Obtain video link from shared content</string>
134+
<string name="share_success_msg">Reading video link from shared content</string>
135+
<string name="show_more_actions">Show more actions</string>
136136
</resources>

build.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
buildscript {
2-
val kotlin_version = "1.6.21"
3-
val hilt_version = "2.42"
2+
val kotlinVersion = "1.6.21"
3+
val hiltVersion = "2.42"
44

55
repositories {
66
mavenCentral()
77
}
88
dependencies {
9-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
10-
classpath("com.google.dagger:hilt-android-gradle-plugin:$hilt_version")
9+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
10+
classpath("com.google.dagger:hilt-android-gradle-plugin:$hiltVersion")
1111
}
1212
}
1313
plugins {

0 commit comments

Comments
 (0)