Skip to content

Commit

Permalink
更新V11.6
Browse files Browse the repository at this point in the history
修复通知权限申请bug
修复全屏打开横屏闪退bug
修复小窗打开错误bug
  • Loading branch information
mingzhixian committed Jun 28, 2023
1 parent 1af6296 commit 83e0474
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
2 changes: 1 addition & 1 deletion scrcpy_android/.idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scrcpy_android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "top.saymzx.scrcpy.android"
minSdk 24
targetSdk 33
versionCode 115
versionName "11.5"
versionCode 116
versionName "11.6"
resConfigs "zh"
resConfigs "xhdpi"
ndk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ class FloatVideo(
floatVideo.findViewById<LinearLayout>(R.id.float_video_title1).visibility = View.VISIBLE
floatVideo.findViewById<LinearLayout>(R.id.float_video_title2).visibility = View.VISIBLE
// 隐藏导航球
floatNav.setOnTouchListener(null)
try {
floatNav.setOnTouchListener(null)
} catch (_: Exception) {
}
hideFloatNav()
// 设置屏幕方向
appData.main.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ import android.view.*
import android.view.KeyEvent.*
import android.view.MotionEvent.*
import android.widget.*
import androidx.core.app.NotificationManagerCompat
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.ViewModelStore
import androidx.lifecycle.ViewModelStoreOwner
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import okhttp3.Request
Expand Down Expand Up @@ -74,11 +72,6 @@ class MainActivity : Activity(), ViewModelStoreOwner {
}
}

override fun onDestroy() {
super.onDestroy()
appData.mainScope.cancel()
}

// 其他页面回调
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
// ShowApp页面回调
Expand All @@ -103,23 +96,6 @@ class MainActivity : Activity(), ViewModelStoreOwner {
Toast.makeText(appData.main, "请授予悬浮窗权限", Toast.LENGTH_SHORT).show()
return
}
// 检查通知权限
if (!NotificationManagerCompat.from(this).areNotificationsEnabled()) {
// 请求通知权限
val intent =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
.putExtra(Settings.EXTRA_APP_PACKAGE, packageName)
.putExtra(Settings.EXTRA_CHANNEL_ID, applicationInfo.uid)
} else {
Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
.putExtra("app_package", packageName)
.putExtra("app_uid", applicationInfo.uid)
}
startActivity(intent)
Toast.makeText(appData.main, "请授予通知权限", Toast.LENGTH_SHORT).show()
return
}
}

// 读取数据库并展示设备列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ class Scrcpy(private val device: Device) {
setAudioDecodec()
// 配置音频播放
if (canAudio) setAudioTrack()
// 投屏中
device.status = 1
// 设置被控端熄屏(默认投屏后熄屏)
setPowerOff()
} catch (e: Exception) {
Expand Down Expand Up @@ -128,6 +126,8 @@ class Scrcpy(private val device: Device) {
stop("投屏停止", e)
}
}.start()
// 投屏中
device.status = 1
}
}

Expand Down

0 comments on commit 83e0474

Please sign in to comment.