This commit is contained in:
sebastian 2024-11-02 09:56:18 +01:00
parent 747fcdc429
commit 706cff79bf
4 changed files with 18 additions and 0 deletions

View File

@ -11,5 +11,15 @@
</jdbc-additional-properties> </jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir> <working-dir>$ProjectFileDir$</working-dir>
</data-source> </data-source>
<data-source source="LOCAL" name="music_database [2]" uuid="6f801a54-4854-4db5-910c-ae63a8207d3e">
<driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/music_database</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component> </component>
</project> </project>

View File

@ -168,9 +168,12 @@ public class MainActivity extends AppCompatActivity implements MetaDataDialog.On
@Override @Override
public void onSongsSelected(List<MusicNote> songs, int concertID) { public void onSongsSelected(List<MusicNote> songs, int concertID) {
Log.d("MainActivity", "Inserted Songs: " + songs.size());
new Thread(() -> { new Thread(() -> {
for(MusicNote musicNote : songs) { for(MusicNote musicNote : songs) {
ConcertSong concertSong = new ConcertSong(musicNote.getMusicNoteId(), concertID); ConcertSong concertSong = new ConcertSong(musicNote.getMusicNoteId(), concertID);
musicDB.musicNoteDao().insertConcertSong(concertSong);
Log.d("MainActivity", "Insert Song: " + musicNote.getTitle());
} }
}).start(); }).start();
} }

View File

@ -75,6 +75,11 @@ public class ConcertSongSelectorAdapter extends RecyclerView.Adapter<ConcertSong
super(itemView); super(itemView);
songTitle = itemView.findViewById(R.id.song_title); songTitle = itemView.findViewById(R.id.song_title);
songCheckbox = itemView.findViewById(R.id.song_checkbox); songCheckbox = itemView.findViewById(R.id.song_checkbox);
songCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
MusicNote musicNote = filteredSongs.get(getAbsoluteAdapterPosition());
selectedSongs.add(musicNote);
});
} }
void bind(MusicNote song) { void bind(MusicNote song) {

Binary file not shown.