Parse AM Constants to get keys:value for Dialog

Takes the AlarmManager csv string and parsees it for key:value
pairs. These key value pairs are then used to fill in information that
the DialogFragment class needs to display information. An ArrayMap is
used to initialize and store a key and the values associated with it
through a data object class. This data can be retrived in updated by
providing only a key.

Bug: 195056296
Bug: 195056102
Bug: 195055428

Test: Manual
Change-Id: Ia11f41bdd1790f7f3483d33148c251c58243e890
This commit is contained in:
Joshua
2021-08-11 22:20:48 +00:00
parent fc69958a51
commit 7b2293ef9a
2 changed files with 272 additions and 4 deletions

View File

@@ -45,24 +45,26 @@ public class TareFactorDialogFragment extends DialogFragment {
private int mFactorEditedValue;
private EditText mFactorValueView;
private TareFactorController mTareFactorController;
/**
* @param title the title that will show at the top of the Dialog for the Factor
* @param key the key of the Factor being initialized.
* @param defaultValue the initial value set for the Factor before any changes
*/
public TareFactorDialogFragment(@NonNull String title, @NonNull String key, int defaultValue) {
public TareFactorDialogFragment(@NonNull String title, @NonNull String key, int defaultValue,
TareFactorController tareFactorController) {
mFactorTitle = title;
mFactorKey = key;
mFactorValue = defaultValue;
mTareFactorController = tareFactorController;
}
/**
* Gets the current value of the Factor
*/
private String getFactorValue() {
// TODO: Get value from locally cached copy
return Integer.toString(mFactorEditedValue);
return Integer.toString(mFactorValue);
}
@NonNull
@@ -85,7 +87,7 @@ public class TareFactorDialogFragment extends DialogFragment {
// TODO: Update csv with new factor value
})
.setNegativeButton(android.R.string.cancel, (dialog, which) -> {
// TODO: Add proper dismiss for negative button press
// When the negative button is clicked do nothing
});
return builder.create();