Skip to content

Commit

Permalink
Single selection Mode Already working on dialog menu
Browse files Browse the repository at this point in the history
  • Loading branch information
votaguz authored and gubatron committed Mar 23, 2016
1 parent 954c9ce commit 9965eda
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,8 @@ public boolean[] getSelected() {
}
return result;
}

public int getLastSelected(){
return adapter.getLastSelectedRadioButtonIndex();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,11 @@ public void onClick(View v) {
// if (results == null || results.isEmpty()) { dlg.displayErrorNotice(ERROR_CODE); return; }

} else if (dlg.getSelectionMode() == AbstractConfirmListDialog.SelectionMode.SINGLE_SELECTION) {
SoundcloudSearchResult selected = results.get(dlg.getLastSelected());
results = new ArrayList<>();
results.add(selected);
// TODO: If results is empty, then we should probably trigger an error message in the dialog
// if (results == null || results.isEmpty()) { dlg.displayErrorNotice(ERROR_CODE); return; }
} else {
//We already know have NO_SELECTION mode. Then
}

startDownloads(ctxRef.get(), results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,4 +606,8 @@ protected void initRadioButton(View view, RadioButtonTag tag) {
radioButton.setChecked(tag.position == lastSelectedRadioButtonIndex);
}
}

public int getLastSelectedRadioButtonIndex(){
return lastSelectedRadioButtonIndex;
}
}

0 comments on commit 9965eda

Please sign in to comment.