filter recordings
This commit is contained in:
parent
ad5b4327d1
commit
e1bcc44fbe
@ -26,6 +26,7 @@ import com.safemobile.lib.AppParams;
|
|||||||
import com.safemobile.lib.OperationCodes;
|
import com.safemobile.lib.OperationCodes;
|
||||||
import com.safemobile.lib.Recording;
|
import com.safemobile.lib.Recording;
|
||||||
import com.safemobile.lib.SM;
|
import com.safemobile.lib.SM;
|
||||||
|
import com.safemobile.lib.Vehicle;
|
||||||
import com.safemobile.lib.radio.RadioGW;
|
import com.safemobile.lib.radio.RadioGW;
|
||||||
import com.safemobile.lib.sound.RecordingHandle;
|
import com.safemobile.lib.sound.RecordingHandle;
|
||||||
|
|
||||||
@ -295,9 +296,27 @@ public class RecordingsActivity extends Activity {
|
|||||||
private void updateResultsInUi() {
|
private void updateResultsInUi() {
|
||||||
// clear played items
|
// clear played items
|
||||||
playingPositions = new ArrayList<>();
|
playingPositions = new ArrayList<>();
|
||||||
|
|
||||||
|
ArrayList<Recording> recordings = getAllRecordings();
|
||||||
|
ArrayList<Recording> filteredList = new ArrayList<>();
|
||||||
|
ArrayList<Vehicle> vehicles = getParentTab().getAllVehicle();
|
||||||
|
for (Recording recording : recordings) {
|
||||||
|
if (recording.callType == 0 || recording.callType == 4) {
|
||||||
|
for (Vehicle vehicle : vehicles)
|
||||||
|
if (vehicle.imei.equals(String.valueOf(recording.subID))) {
|
||||||
|
filteredList.add(recording);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
filteredList.add(recording);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setAllRecordings(filteredList);
|
||||||
|
|
||||||
for (int i = 0; i < getAllRecordings().size(); i++)
|
for (int i = 0; i < getAllRecordings().size(); i++)
|
||||||
playingPositions.add(true);
|
playingPositions.add(true);
|
||||||
// set adapter - where playingPositions stores exists values
|
|
||||||
adapter = new RecordingsGridViewAdapter(activity, getAllRecordings(), playingPositions);
|
adapter = new RecordingsGridViewAdapter(activity, getAllRecordings(), playingPositions);
|
||||||
|
|
||||||
// playing positions need to be false because no recording is played
|
// playing positions need to be false because no recording is played
|
||||||
|
Loading…
Reference in New Issue
Block a user