Last active
December 19, 2018 15:57
-
-
Save MwBakker/88d79d21f31070659b1a0ec05ba22864 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private DialogCmdHandler dialogHandler(Dialog customDialog, Storage storage) | |
{ | |
return new DialogCmdHandler() | |
{ | |
@Override | |
public void editItem() | |
{ | |
Intent intent = new Intent(MainActivity.this, StorageActivity.class); | |
intent.putExtra("storage_name", storage.getStorageName()); | |
intent.putExtra("storage_loc", storage.getStorageLoc()); | |
// This one is being performed after the switch of activity.. | |
mainVM.getStorageRepository().getAmountOfRacks(storage.storageID).observe(MainActivity.this, rackAmount -> | |
{ | |
intent.putExtra("storage_rack_amount", rackAmount); | |
}); | |
intent.putExtra("purpose", "Save storage edit"); | |
switchActivity(intent); | |
} | |
@Override | |
public void deleteItem() | |
{ | |
mainVM.getStorageRepository().deleteStorage(storage); | |
} | |
@Override | |
public void cancelDialog() | |
{ | |
customDialog.dismiss(); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment