4848import com .alipay .hulu .shared .io .bean .RecordCaseInfo ;
4949import com .alipay .hulu .shared .io .db .GreenDaoManager ;
5050import com .alipay .hulu .shared .io .db .RecordCaseInfoDao ;
51+ import com .alipay .hulu .shared .io .util .OperationStepUtil ;
5152import com .alipay .hulu .shared .node .action .OperationMethod ;
5253import com .alipay .hulu .shared .node .tree .export .bean .OperationStep ;
5354import com .alipay .hulu .ui .HeadControlPanel ;
@@ -93,6 +94,9 @@ public class SettingsActivity extends BaseActivity {
9394 private View mDisplaySystemAppSettingWrapper ;
9495 private TextView mDisplaySystemAppSettingInfo ;
9596
97+ private View mCheckUpdateSettingWrapper ;
98+ private TextView mCheckUpdateSettingInfo ;
99+
96100 private View mBaseDirSettingWrapper ;
97101 private TextView mBaseDirSettingInfo ;
98102
@@ -330,18 +334,18 @@ public void onDialogPositive(List<String> data) {
330334 public void onClick (View v ) {
331335 new AlertDialog .Builder (SettingsActivity .this , R .style .SimpleDialogTheme )
332336 .setMessage ("回放时是否高亮待操作控件?" )
333- .setPositiveButton ("是" , new DialogInterface .OnClickListener () {
337+ .setPositiveButton (R . string . constant__yes , new DialogInterface .OnClickListener () {
334338 @ Override
335339 public void onClick (DialogInterface dialog , int which ) {
336340 SPService .putBoolean (SPService .KEY_HIGHLIGHT_REPLAY_NODE , true );
337- mHightlightSettingInfo .setText ("是" );
341+ mHightlightSettingInfo .setText (R . string . constant__yes );
338342 dialog .dismiss ();
339343 }
340- }).setNegativeButton ("否" , new DialogInterface .OnClickListener () {
344+ }).setNegativeButton (R . string . constant__no , new DialogInterface .OnClickListener () {
341345 @ Override
342346 public void onClick (DialogInterface dialog , int which ) {
343347 SPService .putBoolean (SPService .KEY_HIGHLIGHT_REPLAY_NODE , false );
344- mHightlightSettingInfo .setText ("否" );
348+ mHightlightSettingInfo .setText (R . string . constant__no );
345349 dialog .dismiss ();
346350 }
347351 }).show ();
@@ -512,7 +516,7 @@ private void showMultipleEditDialog(final OnDialogResultListener listener, Strin
512516 new AlertDialog .Builder (SettingsActivity .this , R .style .AppDialogTheme )
513517 .setTitle (title )
514518 .setView (v )
515- .setPositiveButton ("确定" , new DialogInterface .OnClickListener () {
519+ .setPositiveButton (R . string . constant__confirm , new DialogInterface .OnClickListener () {
516520 @ Override
517521 public void onClick (DialogInterface dialog , int which ) {
518522 List <String > result = new ArrayList <>(editTexts .size () + 1 );
@@ -527,7 +531,7 @@ public void onClick(DialogInterface dialog, int which) {
527531 }
528532 dialog .dismiss ();
529533 }
530- }).setNegativeButton ("取消" , new DialogInterface .OnClickListener () {
534+ }).setNegativeButton (R . string . constant__cancel , new DialogInterface .OnClickListener () {
531535 @ Override
532536 public void onClick (DialogInterface dialog , int which ) {
533537 dialog .dismiss ();
@@ -544,7 +548,7 @@ private void initView() {
544548 mRecordScreenUploadInfo = (TextView ) findViewById (R .id .recordscreen_upload_setting_info );
545549 String path = SPService .getString (SPService .KEY_RECORD_SCREEN_UPLOAD );
546550 if (StringUtil .isEmpty (path )) {
547- mRecordScreenUploadInfo .setText ("未设置" );
551+ mRecordScreenUploadInfo .setText (R . string . settings__unset );
548552 } else {
549553 mRecordScreenUploadInfo .setText (path );
550554 }
@@ -553,7 +557,7 @@ private void initView() {
553557 mRecordUploadInfo = (TextView ) findViewById (R .id .performance_upload_setting_info );
554558 path = SPService .getString (SPService .KEY_PERFORMANCE_UPLOAD );
555559 if (StringUtil .isEmpty (path )) {
556- mRecordUploadInfo .setText ("未设置" );
560+ mRecordUploadInfo .setText (R . string . settings__unset );
557561 } else {
558562 mRecordUploadInfo .setText (path );
559563 }
@@ -578,15 +582,24 @@ private void initView() {
578582
579583 mHightlightSettingWrapper = findViewById (R .id .replay_highlight_setting_wrapper );
580584 mHightlightSettingInfo = (TextView ) findViewById (R .id .replay_highlight_setting_info );
581- mHightlightSettingInfo .setText (SPService .getBoolean (SPService .KEY_HIGHLIGHT_REPLAY_NODE , true )? "是" : "否" );
585+ mHightlightSettingInfo .setText (SPService .getBoolean (SPService .KEY_HIGHLIGHT_REPLAY_NODE , true )? R . string . constant__yes : R . string . constant__no );
582586
583587 mDisplaySystemAppSettingWrapper = findViewById (R .id .display_system_app_setting_wrapper );
584588 mDisplaySystemAppSettingInfo = (TextView ) findViewById (R .id .display_system_app_setting_info );
585589 boolean displaySystemApp = SPService .getBoolean (SPService .KEY_DISPLAY_SYSTEM_APP , false );
586590 if (displaySystemApp ) {
587- mDisplaySystemAppSettingInfo .setText ("是" );
591+ mDisplaySystemAppSettingInfo .setText (R .string .constant__yes );
592+ } else {
593+ mDisplaySystemAppSettingInfo .setText (R .string .constant__no );
594+ }
595+
596+ mCheckUpdateSettingWrapper = findViewById (R .id .check_update_setting_wrapper );
597+ mCheckUpdateSettingInfo = (TextView ) findViewById (R .id .check_update_setting_info );
598+ boolean checkUpdate = SPService .getBoolean (SPService .KEY_CHECK_UPDATE , true );
599+ if (checkUpdate ) {
600+ mCheckUpdateSettingInfo .setText (R .string .constant__yes );
588601 } else {
589- mDisplaySystemAppSettingInfo .setText ("否" );
602+ mCheckUpdateSettingInfo .setText (R . string . constant__no );
590603 }
591604
592605 mBaseDirSettingWrapper = findViewById (R .id .base_dir_setting_wrapper );
@@ -595,7 +608,7 @@ private void initView() {
595608
596609 mAesSeedSettingWrapper = findViewById (R .id .aes_seed_setting_wrapper );
597610 mAesSeedSettingInfo = (TextView ) findViewById (R .id .aes_seed_setting_info );
598- mAesSeedSettingInfo .setText (SPService .getString (SPService .KEY_AES_KEY , "com.alipay.hulu" ));
611+ mAesSeedSettingInfo .setText (SPService .getString (SPService .KEY_AES_KEY , AESUtils . DEFAULT_AES_KEY ));
599612
600613 mClearFilesSettingWrapper = findViewById (R .id .clear_files_setting_wrapper );
601614 mClearFilesSettingInfo = (TextView ) findViewById (R .id .clear_files_setting_info );
@@ -604,9 +617,9 @@ private void initView() {
604617 mHideLogSettingInfo = (TextView ) findViewById (R .id .hide_log_setting_info );
605618 boolean hideLog = SPService .getBoolean (SPService .KEY_HIDE_LOG , true );
606619 if (hideLog ) {
607- mHideLogSettingInfo .setText ("是" );
620+ mHideLogSettingInfo .setText (R . string . constant__yes );
608621 } else {
609- mHideLogSettingInfo .setText ("否" );
622+ mHideLogSettingInfo .setText (R . string . constant__no );
610623 }
611624
612625 mImportCaseSettingWrapper = findViewById (R .id .import_case_setting_wrapper );
@@ -647,7 +660,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
647660 * @param newSeed
648661 */
649662 private void updateStoredRecords (final String oldSeed , final String newSeed ) {
650- showProgressDialog ("开始更新用例" );
663+ showProgressDialog (getString ( R . string . settings__start_update_cases ) );
651664 BackgroundExecutor .execute (new Runnable () {
652665 @ Override
653666 public void run () {
@@ -658,7 +671,7 @@ public void run() {
658671
659672 if (cases != null && cases .size () > 0 ) {
660673 for (int i = 0 ; i < cases .size (); i ++) {
661- showProgressDialog ("更新用例(" + ( i + 1 ) + "/" + cases .size () + ")" );
674+ showProgressDialog (getString ( R . string . settings__updating_cases , i + 1 , cases .size ()) );
662675 RecordCaseInfo caseInfo = cases .get (i );
663676 GeneralOperationLogBean generalOperation ;
664677 try {
@@ -672,6 +685,10 @@ public void run() {
672685 if (generalOperation == null ) {
673686 continue ;
674687 }
688+
689+ // load file content
690+ OperationStepUtil .afterLoad (generalOperation );
691+
675692 List <OperationStep > steps = generalOperation .getSteps ();
676693 if (generalOperation .getSteps () != null ) {
677694 for (OperationStep step : steps ) {
@@ -691,6 +708,7 @@ public void run() {
691708 }
692709 }
693710 }
711+ OperationStepUtil .beforeStore (generalOperation );
694712
695713 // 更新operationLog字段
696714 caseInfo .setOperationLog (JSON .toJSONString (generalOperation ));
0 commit comments