Skip to content

Commit

Permalink
Limit length of file name & Add tg link
Browse files Browse the repository at this point in the history
  • Loading branch information
JunkFood02 committed Dec 26, 2022
1 parent b3e0af9 commit 1a7b8a5
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 13 deletions.
35 changes: 24 additions & 11 deletions app/src/main/java/com/junkfood/seal/ui/component/PreferenceItems.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.painter.Painter
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle
Expand All @@ -49,12 +50,11 @@ import com.junkfood.seal.ui.theme.applyOpacity
import com.junkfood.seal.ui.theme.harmonizeWithPrimary
import com.junkfood.seal.ui.theme.preferenceTitle


@Composable
fun PreferenceItem(
title: String,
description: String? = null,
icon: ImageVector? = null,
icon: Any? = null,
enabled: Boolean = true,
onClick: () -> Unit = {},
) {
Expand All @@ -67,16 +67,29 @@ fun PreferenceItem(
.padding(16.dp, 20.dp),
verticalAlignment = Alignment.CenterVertically,
) {
icon?.let {
Icon(
imageVector = icon,
contentDescription = null,
modifier = Modifier
.padding(start = 8.dp, end = 16.dp)
.size(24.dp),
tint = MaterialTheme.colorScheme.secondary.applyOpacity(enabled)
)
when (icon) {
is ImageVector -> {
Icon(
imageVector = icon,
contentDescription = null,
modifier = Modifier
.padding(start = 8.dp, end = 16.dp)
.size(24.dp),
tint = MaterialTheme.colorScheme.secondary.applyOpacity(enabled)
)
}
is Painter -> {
Icon(
painter = icon,
contentDescription = null,
modifier = Modifier
.padding(start = 8.dp, end = 16.dp)
.size(24.dp),
tint = MaterialTheme.colorScheme.secondary.applyOpacity(enabled)
)
}
}

Column(
modifier = Modifier
.weight(1f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.unit.dp
Expand All @@ -46,7 +47,7 @@ private const val releaseURL = "https://github.com/JunkFood02/Seal/releases"
private const val repoUrl = "https://github.com/JunkFood02/Seal"
const val weblate = "https://hosted.weblate.org/engage/seal/"
private const val githubIssueUrl = "https://github.com/JunkFood02/Seal/issues/new/choose"

private const val telegramChannelUrl = "https://t.me/seal_app"
private const val TAG = "AboutPage"

@OptIn(ExperimentalMaterial3Api::class)
Expand Down Expand Up @@ -125,6 +126,13 @@ fun AboutPage(onBackPressed: () -> Unit, jumpToCreditsPage: () -> Unit) {
icon = Icons.Outlined.ContactSupport,
) { openUrl(githubIssueUrl) }
}
item {
PreferenceItem(
title = stringResource(R.string.telegram_channel),
description = telegramChannelUrl,
icon = painterResource(id = R.drawable.icons8_telegram_app)
) { openUrl(telegramChannelUrl) }
}
item {
PreferenceItem(
title = stringResource(id = R.string.credits),
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/junkfood/seal/util/DownloadUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object DownloadUtil {
}

private const val TAG = "DownloadUtil"
private const val OUTPUT_TEMPLATE = "%(title).100s [%(id)s].%(ext)s"
private const val OUTPUT_TEMPLATE = "%(title).70s [%(id)s].%(ext)s"
private const val AUDIO_REGEX = "(mp3)|(aac)|(opus)|(m4a)"
private const val CROP_ARTWORK_COMMAND =
"""--ppa "ffmpeg: -c:v mjpeg -vf crop=in_h""""
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/icons8_telegram_app.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M20.572,3.012C20.24,2.976 19.879,3.028 19.516,3.172C19.066,3.349 12.014,6.315 5.441,9.082L3.27,9.996C2.429,10.337 2.004,10.892 2.004,11.639C2.004,12.162 2.225,12.871 3.281,13.289L6.947,14.758C7.264,15.709 8.001,17.917 8.186,18.504C8.296,18.852 8.573,19.729 9.275,19.934C9.419,19.983 9.57,20.008 9.723,20.008C10.166,20.008 10.485,19.802 10.641,19.682L12.971,17.711L15.801,20.328C15.91,20.439 16.487,21 17.262,21C18.229,21 18.962,20.195 19.115,19.416C19.198,18.989 21.928,5.287 21.928,5.289C22.173,4.19 21.732,3.62 21.449,3.377C21.207,3.169 20.905,3.047 20.572,3.012zM19.91,5.172C19.533,7.062 17.478,17.378 17.166,18.865L13.029,15.039L10.223,17.416L11,14.375C11,14.375 16.363,8.947 16.686,8.631C16.946,8.378 17,8.289 17,8.201C17,8.084 16.94,8 16.801,8C16.676,8 16.506,8.12 16.416,8.176C15.273,8.889 10.404,11.662 8.008,13.025L4.531,11.637L6.219,10.928C10.518,9.118 18.174,5.894 19.91,5.172z"/>
</vector>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,5 @@
<string name="how_does_it_work">How does it work?</string>
<string name="cookies_usage_msg">Downloading from some sites requires account authentication information. Click \"Generate new cookies\", enter the URL of the website and then log in with your account in the browser page, the app will generate it for you.</string>
<string name="custom_command_usage_msg" translatable="false"></string>
<string name="telegram_channel">Telegram channel</string>
</resources>

0 comments on commit 1a7b8a5

Please sign in to comment.