优化体验

main
Matthew 1 year ago
parent 48aeff77ef
commit d9a966e3a9

@ -38,6 +38,7 @@ public class CertActivity extends AppCompatActivity {
private static long AUTO_CLOSE_TIMEOUT = 200;
private Handler mHandler = null;
TextView mTextView = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -60,19 +61,18 @@ public class CertActivity extends AppCompatActivity {
String version = MicroPhotoService.querySecVersion();
TextView textView = (TextView)findViewById(R.id.textView);
textView.setText(R.string.nrsec_version + version);
mTextView = (TextView)findViewById(R.id.textView);
mTextView.setText(R.string.nrsec_version + version);
ActionBar actionBar = getSupportActionBar();
String text = getResources().getString(R.string.nrsec_version);
actionBar.setTitle(actionBar.getTitle().toString() + " " + text + " " + version);
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date dt = new Date();
text = format.format(dt);
((TextView) findViewById(R.id.textView)).setText(text);
mTextView.setText(text);
mHandler = new Handler();
@ -338,13 +338,29 @@ public class CertActivity extends AppCompatActivity {
f = new File(path);
f = new File(f, "progress.txt");
writeTextFile(f.getAbsolutePath(), Integer.toString(idx - startIdx + 1));
final String fullSn = sn + idxStr;
mHandler.post(new Runnable() {
@Override
public void run() {
SimpleDateFormat format = new SimpleDateFormat("HH:mm:ss");
Date dt = new Date();
mTextView.setText(format.format(dt) + " " + fullSn);
}
});
}
f = new File(path);
f = new File(f, "log.txt");
File dest = new File(f, "log.txt");
f = new File(f, "log");
writeTextFile(f.getAbsolutePath(), logs.toString());
try {
Files.move(f.toPath(), dest.toPath());
} catch (Exception ex) {
}
}
final Activity activity = this;
mHandler.postDelayed(new Runnable() {

@ -11,6 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="32sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"

Loading…
Cancel
Save