diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index b9ad2510f8..2b5676c628 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -54,7 +54,7 @@ jobs: shell: bash run: | contentbody=$( jq -Rsa . <<< "${{ github.event.head_commit.message }}" ) - curl -F "payload_json={\"content\":\" Alpha-Build: <@719439449423085569> **${{ env.VERSION }}**\n\n${contentbody:1:-1}\"}" -F "dantotsu_debug=@app/build/outputs/apk/alpha/app-alpha.apk" ${{ secrets.DISCORD_WEBHOOK }} + curl -F "payload_json={\"content\":\" Alpha-Build: <@659107544597266465> **${{ env.VERSION }}**\n\n${contentbody:1:-1}\"}" -F "dantotsu_debug=@app/build/outputs/apk/alpha/app-alpha.apk" ${{ secrets.DISCORD_WEBHOOK }} - name: Delete Old Pre-Releases id: delete-pre-releases diff --git a/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt b/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt index 052b4faf31..f7f3bf104a 100644 --- a/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt +++ b/app/src/main/java/ani/dantotsu/media/anime/ExoplayerView.kt @@ -385,21 +385,23 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL }, AUDIO_CONTENT_TYPE_MOVIE, AUDIOFOCUS_GAIN) if (System.getInt(contentResolver, System.ACCELEROMETER_ROTATION, 0) != 1) { - orientationListener = - object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_UI) { - override fun onOrientationChanged(orientation: Int) { - if (orientation in 45..135) { - if (rotation != ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) exoRotate.visibility = - View.VISIBLE - rotation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE - } else if (orientation in 225..315) { - if (rotation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) exoRotate.visibility = - View.VISIBLE - rotation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE + if (PrefManager.getVal(PrefName.RotationPlayer)) { + orientationListener = + object : OrientationEventListener(this, SensorManager.SENSOR_DELAY_UI) { + override fun onOrientationChanged(orientation: Int) { + if (orientation in 45..135) { + if (rotation != ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE) exoRotate.visibility = + View.VISIBLE + rotation = ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE + } else if (orientation in 225..315) { + if (rotation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) exoRotate.visibility = + View.VISIBLE + rotation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE + } } } - } - orientationListener?.enable() + orientationListener?.enable() + } requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE exoRotate.setOnClickListener { diff --git a/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt b/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt index 1b3ab88250..822211e1b6 100644 --- a/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt +++ b/app/src/main/java/ani/dantotsu/settings/PlayerSettingsActivity.kt @@ -221,6 +221,11 @@ class PlayerSettingsActivity : AppCompatActivity() { PrefManager.setVal(PrefName.Cast, isChecked) } + binding.playerSettingsRotate.isChecked = PrefManager.getVal(PrefName.RotationPlayer) + binding.playerSettingsRotate.setOnCheckedChangeListener { _, isChecked -> + PrefManager.setVal(PrefName.RotationPlayer, isChecked) + } + val resizeModes = arrayOf("Original", "Zoom", "Stretch") val resizeDialog = AlertDialog.Builder(this, R.style.MyPopup) .setTitle(getString(R.string.default_resize_mode)) diff --git a/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt b/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt index 45fec0531a..e499e669e6 100644 --- a/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt +++ b/app/src/main/java/ani/dantotsu/settings/saving/Preferences.kt @@ -83,6 +83,7 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files SkipTime(Pref(Location.Player, Int::class, 85)), Cast(Pref(Location.Player, Boolean::class, true)), Pip(Pref(Location.Player, Boolean::class, true)), + RotationPlayer(Pref(Location.Player, Boolean::class, true)), ContinueAnime(Pref(Location.Player, Set::class, setOf())), //Reader diff --git a/app/src/main/res/layout/activity_player_settings.xml b/app/src/main/res/layout/activity_player_settings.xml index 7c3eb8407d..b22f81bdb9 100644 --- a/app/src/main/res/layout/activity_player_settings.xml +++ b/app/src/main/res/layout/activity_player_settings.xml @@ -1054,8 +1054,7 @@ android:id="@+id/playerSettingsCast" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginBottom="8dp" - android:checked="false" + android:checked="true" android:drawableStart="@drawable/ic_round_cast_24" android:drawablePadding="16dp" app:drawableTint="?attr/colorPrimary" @@ -1073,6 +1072,29 @@ + + + +