Skip to content

Commit

Permalink
android camera - ux fix
Browse files Browse the repository at this point in the history
  • Loading branch information
matkatz committed Jun 26, 2019
1 parent d45e822 commit 33c488e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ public class DetachedActivity extends AppCompatActivity {
private boolean mPermissionsGrunted = false;
private Button mPlaybackButton;

private Context mAppContext;
private RsContext mRsContext = new RsContext();
;

private Map<ProductLine,String> mMinimalFirmwares = new HashMap<>();
private boolean mUpdating = false;
private Context mAppContext;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -64,10 +63,15 @@ public void onClick(View view) {
return;
}

String appVersion = BuildConfig.VERSION_NAME;
String lrsVersion = RsContext.getVersion();
TextView versions = findViewById(R.id.versionsText);
versions.setText("librealsense version: " + lrsVersion + "\ncamera app version: " + appVersion);
runOnUiThread(new Runnable() {
@Override
public void run() {
String appVersion = BuildConfig.VERSION_NAME;
String lrsVersion = RsContext.getVersion();
TextView versions = findViewById(R.id.versionsText);
versions.setText("librealsense version: " + lrsVersion + "\ncamera app version: " + appVersion);
}
});

mMinimalFirmwares.put(ProductLine.D400, MINIMAL_D400_FW_VERSION);

Expand All @@ -88,8 +92,7 @@ public void onRequestPermissionsResult(int requestCode, String permissions[], in
protected void onResume() {
super.onResume();

if(mPermissionsGrunted)
{
if(mPermissionsGrunted) {
RsContext.init(getApplicationContext());
mRsContext.setDevicesChangedCallback(mListener);
validatedDevice();
Expand Down Expand Up @@ -183,9 +186,9 @@ public void onDeviceAttach() {

@Override
public void onDeviceDetach() {
finish();
Intent intent = new Intent(mAppContext, DetachedActivity.class);
startActivity(intent);
finish();
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ public void onClick(View view) {
try(Device d = dl.createDevice(0)){
if(d.is(Extension.UPDATABLE))
d.<Updatable>as(Extension.UPDATABLE).enterUpdateState();
else
throw new RuntimeException("request to update a non updatable device");
}
}
}
Expand Down

0 comments on commit 33c488e

Please sign in to comment.