Skip to content

Commit

Permalink
revert jsoup to 1.16.1 and hide donate button on TV/STB
Browse files Browse the repository at this point in the history
  • Loading branch information
tsynik committed Oct 21, 2023
1 parent 6a88cdf commit 0aa81a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ dependencies {
implementation 'com.google.android.flexbox:flexbox:3.0.0'
implementation('org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3')
// http client/parser
implementation 'org.jsoup:jsoup:1.16.2'
//noinspection GradleDependency 1.16.2 thorow VerifyError at org.jsoup.helper.HttpConnection$Request on api19
implementation 'org.jsoup:jsoup:1.16.1'
// json serializer
//noinspection GradleDependency 2.10.1 thorow java.lang.VerifyError on api17
implementation 'com.google.code.gson:gson:2.9.1' // 2.10.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import ru.yourok.torrserve.R
import ru.yourok.torrserve.app.App
import ru.yourok.torrserve.atv.Utils
import ru.yourok.torrserve.settings.Settings
import ru.yourok.torrserve.ui.fragments.TSFragment
import ru.yourok.torrserve.utils.Format
Expand All @@ -34,7 +35,7 @@ class DonateFragment : TSFragment() {
savedInstanceState: Bundle?
): View {
val vi = inflater.inflate(R.layout.donate_fragment, container, false)
Settings.setLastViewDonate(System.currentTimeMillis() + 12 * 60 * 60 * 1000)
Settings.setLastViewDonate(System.currentTimeMillis() + 24 * 60 * 60 * 1000)

vi.findViewById<Button>(R.id.btnBoosty)?.setOnClickListener {
val link = "https://boosty.to/yourok"
Expand Down Expand Up @@ -70,7 +71,7 @@ class DonateFragment : TSFragment() {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
intent.data = Uri.parse("https://t.me/torrserve")
startActivitySafely(intent)
Settings.setLastViewDonate(System.currentTimeMillis() + 30 * 24 * 60 * 60 * 1000)
Settings.setLastViewDonate(System.currentTimeMillis() + 15 * 24 * 60 * 60 * 1000)
}

vi.findViewById<ImageView>(R.id.ivTelegram)?.apply {
Expand Down Expand Up @@ -144,11 +145,12 @@ object DonateMessage {
val vmargin = Format.dp2px(64f)
layoutParams.setMargins(hmargin, vmargin, hmargin, vmargin)
snackbarLayout.layoutParams = layoutParams
snackbar
.setAction(android.R.string.ok) {
DonateFragment().show(activity, R.id.container, true)
}
.show()
if (!Utils.isTvBox())
snackbar
.setAction(android.R.string.ok) {
DonateFragment().show(activity, R.id.container, true)
}
snackbar.show()
}, 5000)
Handler(Looper.getMainLooper()).postDelayed({
if (snackbar.isShown) {
Expand Down

0 comments on commit 0aa81a3

Please sign in to comment.