-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
445 additions
and
638 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
250 changes: 106 additions & 144 deletions
250
app/src/main/kotlin/ac/mdiq/podcini/ui/actions/SwipeActions.kt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ import ac.mdiq.podcini.util.Logd | |
import ac.mdiq.podcini.util.error.CrashReportWriter | ||
import android.content.ClipData | ||
import android.content.ClipboardManager | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.os.Build | ||
import android.os.Bundle | ||
import androidx.activity.compose.setContent | ||
|
@@ -19,6 +21,8 @@ import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.rememberScrollState | ||
import androidx.compose.foundation.verticalScroll | ||
import androidx.compose.material.icons.Icons | ||
import androidx.compose.material.icons.automirrored.filled.ArrowBack | ||
import androidx.compose.material.icons.filled.MoreVert | ||
|
@@ -65,7 +69,8 @@ class BugReportActivity : AppCompatActivity() { | |
fun MainView() { | ||
val textColor = MaterialTheme.colorScheme.onSurface | ||
Scaffold(topBar = { MyTopAppBar() }) { innerPadding -> | ||
Column(modifier = Modifier.padding(innerPadding).fillMaxSize().padding(horizontal = 10.dp)) { | ||
val scrollState = rememberScrollState() | ||
Column(modifier = Modifier.padding(innerPadding).fillMaxSize().padding(horizontal = 10.dp).verticalScroll(scrollState)) { | ||
if (showToast) CustomToast(message = toastMassege, onDismiss = { showToast = false }) | ||
ComfirmDialog(0, stringResource(R.string.confirm_export_log_dialog_message), showConfirmExport) { | ||
exportLog() | ||
|
@@ -82,6 +87,7 @@ class BugReportActivity : AppCompatActivity() { | |
toastMassege = getString(R.string.copied_to_clipboard) | ||
showToast = true | ||
}) { Text(stringResource(R.string.copy_to_clipboard)) } | ||
Button(modifier = Modifier.fillMaxWidth(), onClick = { sendEmail() }) { Text(stringResource(R.string.email_developer)) } | ||
Text(crashDetailsTextView, color = textColor) | ||
} | ||
} | ||
|
@@ -127,6 +133,19 @@ class BugReportActivity : AppCompatActivity() { | |
} | ||
} | ||
|
||
private fun sendEmail() { | ||
val emailIntent = Intent(Intent.ACTION_SENDTO).apply { | ||
data = Uri.parse("mailto:") | ||
putExtra(Intent.EXTRA_EMAIL, arrayOf("[email protected]")) | ||
putExtra(Intent.EXTRA_SUBJECT, "Podcini issue") | ||
putExtra(Intent.EXTRA_TEXT, crashDetailsTextView) | ||
} | ||
if (emailIntent.resolveActivity(packageManager) != null) startActivity(emailIntent) | ||
else { | ||
toastMassege = getString(R.string.need_email_client) | ||
showToast = true | ||
} | ||
} | ||
companion object { | ||
private val TAG: String = BugReportActivity::class.simpleName ?: "Anonymous" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,10 +347,31 @@ class PreferenceActivity : AppCompatActivity() { | |
} | ||
IconTitleSummaryActionRow(R.drawable.ic_questionmark, R.string.online_help, R.string.online_help_sum) { openInBrowser(this@PreferenceActivity, "https://github.com/XilinJia/Podcini/") } | ||
IconTitleSummaryActionRow(R.drawable.ic_info, R.string.privacy_policy, R.string.privacy_policy) { openInBrowser(this@PreferenceActivity, "https://github.com/XilinJia/Podcini/blob/main/PrivacyPolicy.md") } | ||
IconTitleSummaryActionRow(R.drawable.ic_info, R.string.licenses, R.string.licenses_summary) { | ||
navController.navigate(Screens.preferences_license.tag) | ||
// supportFragmentManager.beginTransaction().replace(R.id.settingsContainer, LicensesFragment()).addToBackStack(getString(R.string.translators)).commit() | ||
IconTitleSummaryActionRow(R.drawable.ic_info, R.string.licenses, R.string.licenses_summary) { navController.navigate(Screens.preferences_license.tag) } | ||
IconTitleSummaryActionRow(R.drawable.baseline_mail_outline_24, R.string.email_developer, R.string.email_sum) { | ||
val emailIntent = Intent(Intent.ACTION_SENDTO).apply { | ||
data = Uri.parse("mailto:") | ||
putExtra(Intent.EXTRA_EMAIL, arrayOf("[email protected]")) | ||
putExtra(Intent.EXTRA_SUBJECT, "Regarding Podcini") | ||
} | ||
if (emailIntent.resolveActivity(packageManager) != null) startActivity(emailIntent) | ||
else { | ||
toastMassege = getString(R.string.need_email_client) | ||
showToast = true | ||
} | ||
} | ||
// TextButton(modifier = Modifier.fillMaxWidth(), onClick = { | ||
// val emailIntent = Intent(Intent.ACTION_SENDTO).apply { | ||
// data = Uri.parse("mailto:") | ||
// putExtra(Intent.EXTRA_EMAIL, arrayOf("[email protected]")) | ||
// putExtra(Intent.EXTRA_SUBJECT, "Regarding Podcini") | ||
// } | ||
// if (emailIntent.resolveActivity(packageManager) != null) startActivity(emailIntent) | ||
// else { | ||
// toastMassege = getString(R.string.need_email_client) | ||
// showToast = true | ||
// } | ||
// }) { Text(stringResource(R.string.email_developer)) } | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.