Skip to content

Commit

Permalink
fix long toast duration
Browse files Browse the repository at this point in the history
  • Loading branch information
tsynik committed Nov 29, 2024
1 parent c10f30c commit 03aae4b
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import android.content.Context.POWER_SERVICE
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.os.PowerManager
import android.util.Log
import android.view.View
Expand Down Expand Up @@ -204,9 +206,12 @@ class SettingsFragment : PreferenceFragmentCompat() {
intent.`package` = "com.android.settings"
requireActivity().startActivity(intent)
} else { // show TV Settings and info toast
intent = Intent(android.provider.Settings.ACTION_SETTINGS)
requireActivity().startActivity(intent)
App.toast(R.string.show_battery_save_tv, true)
Handler(Looper.getMainLooper()).postDelayed({
intent = Intent(android.provider.Settings.ACTION_SETTINGS)
requireActivity().startActivity(intent)
}, App.LONG_TOAST_DURATION.toLong()) // as in toast duration

}
} else { // mobile - show request dialog / power prefs
requireActivity().startActivity(intent)
Expand Down

0 comments on commit 03aae4b

Please sign in to comment.