From 471af9f0f8259f521f1aef2caabfd267d6c28c43 Mon Sep 17 00:00:00 2001 From: tguen Date: Tue, 5 Nov 2019 16:15:17 -0800 Subject: [PATCH 1/2] add 'artist' field to album tag editor --- .../tageditor/AlbumTagEditorActivity.java | 6 +++++- .../res/layout/activity_album_tag_editor.xml | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/AlbumTagEditorActivity.java b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/AlbumTagEditorActivity.java index 02d880ebc..f2729ee7b 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/AlbumTagEditorActivity.java +++ b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/AlbumTagEditorActivity.java @@ -47,6 +47,8 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text @BindView(R.id.title) EditText albumTitle; + @BindView(R.id.artist) + EditText artist; @BindView(R.id.album_artist) EditText albumArtist; @BindView(R.id.genre) @@ -71,6 +73,7 @@ protected void onCreate(Bundle savedInstanceState) { private void setUpViews() { fillViewsWithFileTags(); albumTitle.addTextChangedListener(this); + artist.addTextChangedListener(this); albumArtist.addTextChangedListener(this); genre.addTextChangedListener(this); year.addTextChangedListener(this); @@ -79,6 +82,7 @@ private void setUpViews() { private void fillViewsWithFileTags() { albumTitle.setText(getAlbumTitle()); + artist.setText(getArtistName()); albumArtist.setText(getAlbumArtistName()); genre.setText(getGenreName()); year.setText(getSongYear()); @@ -164,7 +168,7 @@ protected void save() { Map fieldKeyValueMap = new EnumMap<>(FieldKey.class); fieldKeyValueMap.put(FieldKey.ALBUM, albumTitle.getText().toString()); //android seems not to recognize album_artist field so we additionally write the normal artist field - fieldKeyValueMap.put(FieldKey.ARTIST, albumArtist.getText().toString()); + fieldKeyValueMap.put(FieldKey.ARTIST, artist.getText().toString()); fieldKeyValueMap.put(FieldKey.ALBUM_ARTIST, albumArtist.getText().toString()); fieldKeyValueMap.put(FieldKey.GENRE, genre.getText().toString()); fieldKeyValueMap.put(FieldKey.YEAR, year.getText().toString()); diff --git a/app/src/main/res/layout/activity_album_tag_editor.xml b/app/src/main/res/layout/activity_album_tag_editor.xml index 8a4559a3c..34f7b3ce8 100644 --- a/app/src/main/res/layout/activity_album_tag_editor.xml +++ b/app/src/main/res/layout/activity_album_tag_editor.xml @@ -76,6 +76,24 @@ android:orientation="vertical" android:padding="16dp"> + + + + + + From acf0f03beccfd937806d4b5100b1c32781925f03 Mon Sep 17 00:00:00 2001 From: tguen Date: Wed, 11 Dec 2019 19:42:55 -0800 Subject: [PATCH 2/2] add 'album artist' field to song tag editor --- .../tageditor/SongTagEditorActivity.java | 5 +++++ .../res/layout/activity_song_tag_editor.xml | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/SongTagEditorActivity.java b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/SongTagEditorActivity.java index 303e67fe3..8e8b3c2c2 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/SongTagEditorActivity.java +++ b/app/src/main/java/com/kabouzeid/gramophone/ui/activities/tageditor/SongTagEditorActivity.java @@ -29,6 +29,8 @@ public class SongTagEditorActivity extends AbsTagEditorActivity implements TextW EditText albumTitle; @BindView(R.id.artist) EditText artist; + @BindView(R.id.album_artist) + EditText albumArtist; @BindView(R.id.genre) EditText genre; @BindView(R.id.year) @@ -55,6 +57,7 @@ private void setUpViews() { songTitle.addTextChangedListener(this); albumTitle.addTextChangedListener(this); artist.addTextChangedListener(this); + albumArtist.addTextChangedListener(this); genre.addTextChangedListener(this); year.addTextChangedListener(this); trackNumber.addTextChangedListener(this); @@ -65,6 +68,7 @@ private void fillViewsWithFileTags() { songTitle.setText(getSongTitle()); albumTitle.setText(getAlbumTitle()); artist.setText(getArtistName()); + albumArtist.setText(getAlbumArtistName()); genre.setText(getGenreName()); year.setText(getSongYear()); trackNumber.setText(getTrackNumber()); @@ -97,6 +101,7 @@ protected void save() { fieldKeyValueMap.put(FieldKey.TITLE, songTitle.getText().toString()); fieldKeyValueMap.put(FieldKey.ALBUM, albumTitle.getText().toString()); fieldKeyValueMap.put(FieldKey.ARTIST, artist.getText().toString()); + fieldKeyValueMap.put(FieldKey.ALBUM_ARTIST, albumArtist.getText().toString()); fieldKeyValueMap.put(FieldKey.GENRE, genre.getText().toString()); fieldKeyValueMap.put(FieldKey.YEAR, year.getText().toString()); fieldKeyValueMap.put(FieldKey.TRACK, trackNumber.getText().toString()); diff --git a/app/src/main/res/layout/activity_song_tag_editor.xml b/app/src/main/res/layout/activity_song_tag_editor.xml index daee211e3..286a2dd73 100644 --- a/app/src/main/res/layout/activity_song_tag_editor.xml +++ b/app/src/main/res/layout/activity_song_tag_editor.xml @@ -103,6 +103,24 @@ + + + + + +