Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Show both 'Artist' and 'Album Artist' fields in tag editor activities #783

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand All @@ -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());
Expand Down Expand Up @@ -164,7 +168,7 @@ protected void save() {
Map<FieldKey, String> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand All @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/res/layout/activity_album_tag_editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,24 @@
android:orientation="vertical"
android:padding="16dp">

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/artist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif"
android:gravity="center_vertical"
android:hint="@string/artist"
android:inputType="text|textCapWords"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
Expand Down
18 changes: 18 additions & 0 deletions app/src/main/res/layout/activity_song_tag_editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,24 @@

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/album_artist"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:fontFamily="sans-serif"
android:gravity="center_vertical"
android:hint="@string/album_artist"
android:inputType="text|textCapWords"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Title" />

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
Expand Down