Commit abdc7fb0 authored by Schoumi's avatar Schoumi

Move some functions in IspManager

Move the thread for flash in it's right place
parent ea3792f7
......@@ -18,6 +18,7 @@
package fr.mobdev.lpcprog.activity;
import android.annotation.SuppressLint;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
......@@ -49,6 +50,7 @@ public class DeviceActivity extends AppCompatActivity {
private long part_id;
@Override
@SuppressLint("SetTextI18n")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.device);
......@@ -69,7 +71,7 @@ public class DeviceActivity extends AppCompatActivity {
}
if(dev != null) {
TextView name = (TextView) findViewById(R.id.name);
name.setText("Name: " + dev.description);
name.setText(getApplicationContext().getString(R.string.dev_name)+ dev.description);
TextView vendor = (TextView) findViewById(R.id.vendor_id);
vendor.setText(String.format("Vendor Id: %04x", dev.VID));
TextView product = (TextView) findViewById(R.id.id);
......
......@@ -299,7 +299,12 @@ class BinaryHolder extends RecyclerView.ViewHolder{
flashView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
IspManager.getInstance(itemView.getContext()).flash(server,binary,flashListener);
new Thread(new Runnable() {
@Override
public void run() {
IspManager.getInstance(itemView.getContext()).flashBinary(server,binary,flashListener);
}
}).start();
}
});
}
......
......@@ -30,6 +30,7 @@
<string name="prepare_write_error">Prepare for write fail</string>
<string name="write_ram_error">write data in ram fail</string>
<string name="copy_to_flash_error">Copy to flash fail</string>
<string name="dev_name">Name: </string>
<array name="https">
<item>http://</item>
<item>https://</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment