调整关闭屏幕和电源按钮的功能实现
安卓targetsdk更新到29
This commit is contained in:
Barry 2019-06-19 20:34:27 +08:00
commit 299cbb5c28
9 changed files with 38 additions and 25 deletions

Binary file not shown.

View file

@ -113,14 +113,22 @@
<translation>expand notify</translation>
</message>
<message>
<location filename="../../toolform.ui" line="59"/>
<source>turn off</source>
<translation>turn off</translation>
<translation type="vanished">turn off</translation>
</message>
<message>
<source>turn on</source>
<translation type="vanished">turn on</translation>
</message>
<message>
<location filename="../../toolform.ui" line="59"/>
<source>close screen</source>
<translation>close screen</translation>
</message>
<message>
<location filename="../../toolform.ui" line="69"/>
<source>turn on</source>
<translation>turn on</translation>
<source>power</source>
<translation>power</translation>
</message>
<message>
<location filename="../../toolform.ui" line="79"/>

View file

@ -113,14 +113,22 @@
<translation></translation>
</message>
<message>
<location filename="../../toolform.ui" line="59"/>
<source>turn off</source>
<translation></translation>
<translation type="vanished"></translation>
</message>
<message>
<source>turn on</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../../toolform.ui" line="59"/>
<source>close screen</source>
<translation></translation>
</message>
<message>
<location filename="../../toolform.ui" line="69"/>
<source>turn on</source>
<translation></translation>
<source>power</source>
<translation></translation>
</message>
<message>
<location filename="../../toolform.ui" line="79"/>

View file

@ -33,11 +33,11 @@ void ToolForm::initStyle()
IconHelper::Instance()->SetIcon(ui->homeBtn, QChar(0xf1db), 15);
//IconHelper::Instance()->SetIcon(ui->returnBtn, QChar(0xf104), 15);
IconHelper::Instance()->SetIcon(ui->returnBtn, QChar(0xf053), 15);
IconHelper::Instance()->SetIcon(ui->appSwitchBtn, QChar(0xf24d), 15);
IconHelper::Instance()->SetIcon(ui->powerBtn, QChar(0xf023), 15);
IconHelper::Instance()->SetIcon(ui->appSwitchBtn, QChar(0xf24d), 15);
IconHelper::Instance()->SetIcon(ui->volumeUpBtn, QChar(0xf028), 15);
IconHelper::Instance()->SetIcon(ui->volumeDownBtn, QChar(0xf027), 15);
IconHelper::Instance()->SetIcon(ui->turnOnBtn, QChar(0xf09c), 15);
IconHelper::Instance()->SetIcon(ui->closeScreenBtn, QChar(0xf070), 15);
IconHelper::Instance()->SetIcon(ui->powerBtn, QChar(0xf011), 15);
IconHelper::Instance()->SetIcon(ui->expandNotifyBtn, QChar(0xf103), 15);
}
@ -128,10 +128,10 @@ void ToolForm::on_volumeDownBtn_clicked()
}
}
void ToolForm::on_turnOnBtn_clicked()
void ToolForm::on_closeScreenBtn_clicked()
{
if (m_videoForm) {
m_videoForm->postTurnOn();
m_videoForm->setScreenPowerMode(ControlMsg::SPM_OFF);
}
}

View file

@ -44,7 +44,7 @@ private slots:
void on_volumeDownBtn_clicked();
void on_turnOnBtn_clicked();
void on_closeScreenBtn_clicked();
void on_expandNotifyBtn_clicked();

View file

@ -54,9 +54,9 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="powerBtn">
<widget class="QPushButton" name="closeScreenBtn">
<property name="toolTip">
<string>turn off</string>
<string>close screen</string>
</property>
<property name="text">
<string/>
@ -64,9 +64,9 @@
</widget>
</item>
<item>
<widget class="QPushButton" name="turnOnBtn">
<widget class="QPushButton" name="powerBtn">
<property name="toolTip">
<string>turn on</string>
<string>power</string>
</property>
<property name="text">
<string/>

View file

@ -11,14 +11,11 @@ b35733edb6df2a00b6af9b1c98627d344c377963
只录制不启动窗口先重构目前启动流程在videoform里
跳过帧改为动态配置,而不是静态编译 https://github.com/Genymobile/scrcpy/commit/ebccb9f6cc111e8acfbe10d656cac5c1f1b744a0
国际化
单独线程打印帧率 https://github.com/Genymobile/scrcpy/commit/e2a272bf99ecf48fcb050177113f903b3fb323c4
重构input
重构videoform
重构整个目录
checkbox
ネコソリ
mark:

View file

@ -22,11 +22,11 @@ allprojects {
}
android {
compileSdkVersion 27
compileSdkVersion 29
defaultConfig {
applicationId "com.genymobile.scrcpy"
minSdkVersion 21
targetSdkVersion 27
targetSdkVersion 29
versionCode 5
versionName "1.4"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

View file

@ -204,7 +204,7 @@ public final class Device {
public void setScreenPowerMode(int mode) {
IBinder d = SurfaceControl.getBuiltInDisplay(0);
SurfaceControl.setDisplayPowerMode(d, mode);
Ln.i("Device screen turned " + (mode == Device.POWER_MODE_OFF ? "off" : "on"));
Ln.i("Device screen turned " + (mode == Device.POWER_MODE_OFF ? "off " : "on ") + mode);
}
static Rect flipRect(Rect crop) {