|
|
@@ -57,6 +57,7 @@ import android.content.DialogInterface;
|
|
|
import android.net.Uri;
|
|
|
import android.provider.Settings;
|
|
|
import android.graphics.Color;
|
|
|
+import org.las2mile.okio.utils.ZipUtils;
|
|
|
|
|
|
|
|
|
public class MainActivity extends FragmentActivity implements Scrcpy.ServiceCallbacks, SensorEventListener {
|
|
|
@@ -151,12 +152,18 @@ public class MainActivity extends FragmentActivity implements Scrcpy.ServiceCall
|
|
|
private void initDownloadBtn(){
|
|
|
final Button btn_dl_status = findViewById(R.id.btn_dl_status);
|
|
|
btn_dl_status.setOnClickListener(v -> {
|
|
|
- Log.e("scrcpy","Asset initDownloadBtn");
|
|
|
Message msg = new Message();
|
|
|
msg.what = GOT_REMOTE_LOG_PROCEDURE_START;
|
|
|
mainHandler.sendMessage(msg);
|
|
|
scrcpy.downloadLog();
|
|
|
});
|
|
|
+ final Button btn_dl_imgs = findViewById(R.id.btn_dl_imgs);
|
|
|
+ btn_dl_imgs.setOnClickListener(v -> {
|
|
|
+ Message msg = new Message();
|
|
|
+ msg.what = GOT_REMOTE_LOG_PROCEDURE_START;
|
|
|
+ mainHandler.sendMessage(msg);
|
|
|
+ scrcpy.downloadPics();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private final ServiceConnection serviceConnection = new ServiceConnection() {
|
|
|
@@ -239,8 +246,9 @@ public class MainActivity extends FragmentActivity implements Scrcpy.ServiceCall
|
|
|
public void onOkIoMsg(BaseMsg baseMsg){
|
|
|
if(baseMsg instanceof LogFileMsgResp){
|
|
|
LogFileMsgResp logFileMsgResp = (LogFileMsgResp)baseMsg;
|
|
|
+ String sizeFmt = ZipUtils.formetFileSize(logFileMsgResp.fileSize);
|
|
|
String percentStr = logFileMsgResp.writenPercent+"%";//Math.round((logFileMsgResp.pktNo+1)*1.0f/logFileMsgResp.pktNums * 100)+"%";
|
|
|
- String str_save_log_to_local = String.format(getResources().getString(R.string.str_save_log_to_local),logFileMsgResp.zipPath,percentStr);
|
|
|
+ String str_save_log_to_local = String.format(getResources().getString(R.string.str_save_log_to_local),logFileMsgResp.zipPath,sizeFmt,percentStr);
|
|
|
Message msg = new Message();
|
|
|
msg.what = GOT_REMOTE_LOG_PROCEDURE;
|
|
|
msg.obj = str_save_log_to_local;
|