tags = new ResponseParser().parseTagLookup(stream);
32 | stream.close();
33 | return tags;
34 | }
35 |
36 | @Test
37 | public void testArtistTags() {
38 | assertEquals(artistTags.size(), 34);
39 | }
40 |
41 | @Test
42 | public void testReleaseGroupTags() {
43 | assertEquals(releaseGroupTags.size(), 7);
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/api/src/test/resources/barcodeSearch_792258106329.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
11 | It's Hard to Find a Friend
12 | Official
13 |
14 | eng
15 |
16 |
17 |
18 |
19 |
20 | Pedro the Lion
21 | Pedro the Lion
22 |
23 |
24 |
25 |
28 | 2001-10-16
29 | US
30 | 792258106329
31 | B00005O7SN
32 |
33 |
34 | JT1063
35 |
36 | Jade Tree
37 |
38 |
39 |
40 |
41 | 12
42 |
43 | CD
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/api/src/test/resources/collectionListLookup.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Want list
5 | jdamcd
6 |
7 |
8 |
9 | My Collection
10 | jdamcd
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/api/src/test/resources/labelLookup_a4f904e0-f048-4c13-88ec-f9f31f3e6109.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | Barsuk Records
6 | Barsuk Records
7 | US
8 |
9 | 1994
10 |
11 |
12 |
13 | ftp://ftp.barsuk.com/2006BlueBarsukWithText.jpg
14 |
15 |
16 | http://en.wikipedia.org/wiki/Barsuk_Records
17 |
18 |
19 | http://www.barsuk.com/
20 |
21 |
22 | http://www.discogs.com/label/Barsuk+Records
23 |
24 |
25 |
26 |
27 | american
28 |
29 |
30 | américain
31 |
32 |
33 | indie rock
34 |
35 |
36 | usa
37 |
38 |
39 | 5
40 |
41 |
--------------------------------------------------------------------------------
/api/src/test/resources/ratingLookup_artist_b10bbbfc-cf9e-42e0-be17-e2c3e1d2600d.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | The Beatles
7 | Beatles, The
8 | GB
9 |
10 | 1957
11 | 1970-04-10
12 |
13 | 4.7
14 |
15 |
--------------------------------------------------------------------------------
/api/src/test/resources/ratingLookup_release-group_bc7630eb-521a-3312-a281-adfb8c5aac7d.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | Plans
7 | 2005-08-29
8 | 4
9 |
10 |
--------------------------------------------------------------------------------
/api/src/test/resources/releaseGroupLookup_60089b39-412b-326c-afc7-aaa47113d84f.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | Miss Machine
6 | 2004-07-20
7 |
8 |
9 |
10 | The Dillinger Escape Plan
11 | Dillinger Escape Plan, The
12 |
13 |
14 |
15 |
16 |
17 | http://en.wikipedia.org/wiki/Miss_Machine
18 |
19 |
20 | http://www.discogs.com/master/2681
21 |
22 |
23 |
24 |
25 | experimental rock
26 |
27 |
28 | mathcore
29 |
30 |
31 | 4.5
32 |
33 |
--------------------------------------------------------------------------------
/api/src/test/resources/tagLookup_release-group_bc7630eb-521a-3312-a281-adfb8c5aac7d.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 | Plans
7 | 2005-08-29
8 |
9 |
10 | alternative
11 |
12 |
13 | alternative and punk
14 |
15 |
16 | alternative punk
17 |
18 |
19 | indie
20 |
21 |
22 | indie pop
23 |
24 |
25 | indie rock
26 |
27 |
28 | rock
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/app/assets/Roboto-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/assets/Roboto-Light.ttf
--------------------------------------------------------------------------------
/app/assets/Roboto-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/assets/Roboto-Regular.ttf
--------------------------------------------------------------------------------
/app/assets/about.html:
--------------------------------------------------------------------------------
1 |
2 | MusicBrainz is an open music encyclopedia that collects music metadata and makes it available to the public.
3 |
4 | What does it do?
5 |
6 | This app gives you easy access to MusicBrainz data on your Android device. Scan a barcode to look up release information or search for artists and releases. Registered users can submit tags, ratings, barcodes and manage their collections.
7 |
8 | Development
9 |
10 | The app is developed by Jamie McDonald. It began as a Google Summer of Code project in 2010. The source code is available on GitHub. Bug reports and comments are welcomed, just tap 'Feedback' in the menu.
11 |
12 | Bugs
13 |
14 | You should be aware that error logs are sent from this app in the event of a crash. Personally identifiable information is not included. You can disable this in the settings menu if you like.
15 |
--------------------------------------------------------------------------------
/app/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/res/anim/linear_interpolator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/res/anim/main_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/action_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/action_delete.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/action_feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/action_feedback.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/action_refresh.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/action_search.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/action_settings.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/actionbar.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/actionbar.9.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/launcher.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/tab_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/tab_selected.9.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/tab_selected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/tab_selected_focused.9.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/tab_selected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/tab_selected_pressed.9.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/tab_unselected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/tab_unselected.9.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/tab_unselected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/tab_unselected_focused.9.png
--------------------------------------------------------------------------------
/app/res/drawable-hdpi/tab_unselected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-hdpi/tab_unselected_pressed.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/action_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/action_delete.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/action_feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/action_feedback.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/action_refresh.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/action_search.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/action_settings.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/actionbar.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/actionbar.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/launcher.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/tab_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/tab_selected.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/tab_selected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/tab_selected_focused.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/tab_selected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/tab_selected_pressed.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/tab_unselected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/tab_unselected.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/tab_unselected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/tab_unselected_focused.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/tab_unselected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/tab_unselected_pressed.9.png
--------------------------------------------------------------------------------
/app/res/drawable-mdpi/tag_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-mdpi/tag_background.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/action_add_collection.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/action_add_collection.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/action_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/action_delete.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/action_feedback.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/action_feedback.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/action_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/action_refresh.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/action_search.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/action_settings.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/actionbar.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/actionbar.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/btn_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/btn_search.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/btn_tag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/btn_tag.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_about_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_about_default.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_about_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_about_pressed.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_collections_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_collections_default.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_collections_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_collections_pressed.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_donate_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_donate_default.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_donate_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_donate_pressed.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_scan_default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_scan_default.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/dash_scan_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/dash_scan_pressed.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/launcher.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_buy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_buy.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_community.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_community.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_discog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_discog.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_download.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_facebook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_facebook.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_film.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_film.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_generic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_generic.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_home.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_info.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_lyrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_lyrics.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_soundcloud.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_soundcloud.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_streaming.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_streaming.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_twitter.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_vimeo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_vimeo.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/link_youtube.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/link_youtube.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/logo_lastfm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/logo_lastfm.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/logo_wikipedia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/logo_wikipedia.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tab_selected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tab_selected.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tab_selected_focus.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tab_selected_focus.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tab_selected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tab_selected_pressed.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tab_unselected.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tab_unselected.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tab_unselected_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tab_unselected_focused.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tab_unselected_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tab_unselected_pressed.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tile_bg_default.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tile_bg_default.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tile_bg_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tile_bg_focused.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xhdpi/tile_bg_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xhdpi/tile_bg_pressed.9.png
--------------------------------------------------------------------------------
/app/res/drawable-xxhdpi/actionbar.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/app/res/drawable-xxhdpi/actionbar.9.png
--------------------------------------------------------------------------------
/app/res/drawable/background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/res/drawable/dash_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/app/res/drawable/dash_collections.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/app/res/drawable/dash_donate.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/app/res/drawable/dash_grid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/app/res/drawable/dash_scan.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/app/res/drawable/link_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/res/drawable/link_button_default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/res/drawable/link_button_pressed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/res/drawable/link_button_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/res/drawable/list_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/res/drawable/progress_spinner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/res/drawable/tab_indicator.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
16 |
17 |
18 |
23 |
28 |
29 |
30 |
35 |
40 |
41 |
42 |
47 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/app/res/layout-land/activity_dash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
19 |
24 |
25 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
40 |
41 |
44 |
45 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/app/res/layout-land/activity_donate.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/app/res/layout-land/fragment_cover_art.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
14 |
15 |
18 |
19 |
24 |
25 |
26 |
27 |
28 |
32 |
33 |
36 |
37 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/res/layout-land/fragment_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
11 |
12 |
16 |
17 |
22 |
23 |
28 |
29 |
34 |
35 |
--------------------------------------------------------------------------------
/app/res/layout-small-port/activity_dash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
13 |
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/res/layout/activity_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/res/layout/activity_artist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
12 |
17 |
18 |
23 |
24 |
28 |
29 |
33 |
34 |
39 |
40 |
--------------------------------------------------------------------------------
/app/res/layout/activity_barcode.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/res/layout/activity_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/res/layout/activity_collections.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/res/layout/activity_dash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
13 |
16 |
17 |
22 |
23 |
27 |
28 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/res/layout/activity_donate.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/res/layout/activity_preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/app/res/layout/activity_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/res/layout/activity_search_all.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
12 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/app/res/layout/activity_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/res/layout/dialog_add_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/res/layout/dialog_barcode_submit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
13 |
14 |
17 |
18 |
21 |
22 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/app/res/layout/dialog_release_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
14 |
15 |
18 |
--------------------------------------------------------------------------------
/app/res/layout/dropdown_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
17 |
18 |
21 |
22 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_artist_release_groups.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
11 |
12 |
17 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
18 |
19 |
23 |
24 |
29 |
30 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_collections.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
18 |
19 |
23 |
24 |
29 |
30 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_cover_art.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
11 |
12 |
16 |
17 |
20 |
21 |
26 |
27 |
28 |
31 |
32 |
35 |
36 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_dash_buttons.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_dash_search.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
20 |
21 |
29 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_dash_welcome.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_donate.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
12 |
16 |
17 |
21 |
22 |
23 |
30 |
31 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_donate_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_edit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
14 |
15 |
24 |
25 |
30 |
31 |
37 |
38 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_links.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
11 |
12 |
17 |
18 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
11 |
12 |
18 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_tracklist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/res/layout/fragment_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/res/layout/layout_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/res/layout/layout_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
15 |
16 |
21 |
22 |
23 |
27 |
28 |
33 |
34 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/res/layout/layout_retry.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
15 |
16 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/res/layout/layout_search_artists.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
17 |
--------------------------------------------------------------------------------
/app/res/layout/layout_search_release_groups.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
13 |
14 |
17 |
18 |
--------------------------------------------------------------------------------
/app/res/layout/layout_tags_rating.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
15 |
16 |
23 |
24 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/res/layout/list_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/res/layout/list_collection_release.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
14 |
15 |
21 |
22 |
27 |
28 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/res/layout/list_link.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
14 |
15 |
19 |
20 |
25 |
26 |
--------------------------------------------------------------------------------
/app/res/layout/list_release_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
13 |
14 |
18 |
19 |
25 |
--------------------------------------------------------------------------------
/app/res/layout/list_search_artist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
10 |
13 |
14 |
15 |
19 |
--------------------------------------------------------------------------------
/app/res/layout/list_search_release_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
13 |
14 |
20 |
21 |
27 |
28 |
--------------------------------------------------------------------------------
/app/res/layout/list_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
13 |
14 |
20 |
21 |
26 |
27 |
31 |
--------------------------------------------------------------------------------
/app/res/layout/view_dash_tile.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
11 |
12 |
16 |
17 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/res/menu-v11/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/res/menu/about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/res/menu/artist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/res/menu/context_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/res/menu/dash.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
9 |
10 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/res/menu/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/res/menu/fragment_collection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/res/menu/fragment_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
--------------------------------------------------------------------------------
/app/res/menu/release.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/app/res/menu/release_logged_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
16 |
17 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/res/menu/search.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
16 |
17 |
--------------------------------------------------------------------------------
/app/res/values-h720dp/dimensions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 420dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/res/values-large/dimensions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 14sp
6 | 16sp
7 | 18sp
8 | 20sp
9 | 30sp
10 |
11 | 55dp
12 | 300dp
13 | 420dp
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | - @string/searchtype_artist
7 | - @string/searchtype_release
8 |
10 |
11 |
12 |
13 | - $5
14 | - $10
15 | - $25
16 | - $50
17 | - $100
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/res/values/colours.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #000000
7 | #ffffff
8 | #dddddd
9 | #00000000
10 |
11 |
12 | #eeeeee
13 | #ffffff
14 | #666666
15 | #3366cc
16 | #dddddd
17 |
18 | #ffffff
19 | #33dddddd
20 | #eeeeee
21 |
22 |
23 | #bcaeed
24 | #736dab
25 | #34176b
26 |
27 | #ffba58
28 | #cc9546
29 |
30 |
--------------------------------------------------------------------------------
/app/res/values/dimensions.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 12sp
6 | 14sp
7 | 16sp
8 | 17sp
9 | 24sp
10 |
11 | 10dp
12 | 14dp
13 | 20dp
14 | 32dp
15 | 7dp
16 | 5dp
17 |
18 | 45dp
19 | 47dp
20 | 1dp
21 | 200dp
22 | 240dp
23 |
24 | 1dp
25 |
26 |
27 |
--------------------------------------------------------------------------------
/app/res/values/style_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
13 |
14 |
18 |
19 |
24 |
25 |
30 |
31 |
36 |
37 |
42 |
43 |
--------------------------------------------------------------------------------
/app/res/values/theme.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
14 |
15 |
23 |
24 |
29 |
30 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/res/xml/preferences.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/res/xml/searchable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/activity/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.activity;
2 |
3 | import org.musicbrainz.mobile.R;
4 |
5 | import android.os.Bundle;
6 |
7 | import com.actionbarsherlock.view.Menu;
8 |
9 | public class AboutActivity extends MusicBrainzActivity {
10 |
11 | @Override
12 | public void onCreate(Bundle savedInstanceState) {
13 | super.onCreate(savedInstanceState);
14 | setContentView(R.layout.activity_about);
15 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
16 | }
17 |
18 | @Override
19 | public boolean onCreateOptionsMenu(Menu menu) {
20 | getSupportMenuInflater().inflate(R.menu.about, menu);
21 | return true;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/activity/BarcodeSearchActivity.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.activity;
2 |
3 | import org.musicbrainz.mobile.R;
4 | import org.musicbrainz.mobile.fragment.BarcodeSearchFragment.LoadingCallbacks;
5 |
6 | import android.os.Bundle;
7 |
8 | import com.actionbarsherlock.view.Window;
9 |
10 | /**
11 | * Activity to submit a barcode to a selected release in MusicBrainz.
12 | */
13 | public class BarcodeSearchActivity extends MusicBrainzActivity implements LoadingCallbacks {
14 |
15 | public void onCreate(Bundle savedInstanceState) {
16 | requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.activity_barcode);
19 | setSupportProgressBarIndeterminateVisibility(false);
20 | }
21 |
22 | @Override
23 | public void startLoading() {
24 | setSupportProgressBarIndeterminateVisibility(true);
25 | }
26 |
27 | @Override
28 | public void stopLoading() {
29 | setSupportProgressBarIndeterminateVisibility(false);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/activity/CollectionActivity.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.activity;
2 |
3 | import org.musicbrainz.mobile.R;
4 | import org.musicbrainz.mobile.fragment.CollectionFragment.FragmentLoadingCallbacks;
5 | import org.musicbrainz.mobile.intent.IntentFactory;
6 | import org.musicbrainz.mobile.intent.IntentFactory.Extra;
7 |
8 | import android.os.Bundle;
9 |
10 | import com.actionbarsherlock.view.MenuItem;
11 | import com.actionbarsherlock.view.Window;
12 |
13 | public class CollectionActivity extends MusicBrainzActivity implements FragmentLoadingCallbacks {
14 |
15 | @Override
16 | public void onCreate(Bundle savedInstanceState) {
17 | requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_collection);
20 | setSupportProgressBarIndeterminateVisibility(false);
21 | setTitleFromIntent();
22 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
23 | }
24 |
25 | public void setTitleFromIntent() {
26 | String collectionName = getIntent().getStringExtra(Extra.TITLE);
27 | getSupportActionBar().setTitle(collectionName);
28 | }
29 |
30 | @Override
31 | public boolean onOptionsItemSelected(MenuItem item) {
32 | if (item.getItemId() == android.R.id.home) {
33 | startActivity(IntentFactory.getCollectionList(getApplicationContext()));
34 | return true;
35 | }
36 | return super.onOptionsItemSelected(item);
37 | }
38 |
39 | @Override
40 | public void onLoadStart() {
41 | setSupportProgressBarIndeterminateVisibility(true);
42 | }
43 |
44 | @Override
45 | public void onLoadFinish() {
46 | setSupportProgressBarIndeterminateVisibility(false);
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/activity/CollectionListActivity.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.activity;
2 |
3 | import org.musicbrainz.mobile.App;
4 | import org.musicbrainz.mobile.R;
5 |
6 | import android.os.Bundle;
7 |
8 | public class CollectionListActivity extends MusicBrainzActivity {
9 |
10 | @Override
11 | public void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_collections);
14 | setUserNameTitle();
15 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
16 | }
17 |
18 | public void setUserNameTitle() {
19 | String userName = App.getUser().getUsername();
20 | getSupportActionBar().setTitle(userName + getString(R.string.plural) + " " + getString(R.string.collections));
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/activity/DonateActivity.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.activity;
2 |
3 | import org.musicbrainz.mobile.R;
4 | import org.musicbrainz.mobile.fragment.DonateFragment.DonationCallbacks;
5 |
6 | import android.os.Bundle;
7 |
8 | import com.actionbarsherlock.view.Window;
9 |
10 | public class DonateActivity extends MusicBrainzActivity implements DonationCallbacks {
11 |
12 | public void onCreate(Bundle savedInstanceState) {
13 | requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_donate);
16 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
17 | }
18 |
19 | @Override
20 | public void startLoading() {
21 | setSupportProgressBarIndeterminateVisibility(true);
22 | }
23 |
24 | @Override
25 | public void stopLoading() {
26 | setSupportProgressBarIndeterminateVisibility(false);
27 | }
28 |
29 | @Override
30 | public void onResult() {
31 | finish();
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/activity/LoginActivity.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.activity;
2 |
3 | import org.musicbrainz.mobile.R;
4 | import org.musicbrainz.mobile.fragment.LoginFragment.LoginCallback;
5 |
6 | import android.os.Bundle;
7 |
8 | public class LoginActivity extends MusicBrainzActivity implements LoginCallback {
9 |
10 | public void onCreate(Bundle savedInstanceState) {
11 | super.onCreate(savedInstanceState);
12 | setContentView(R.layout.activity_login);
13 | getSupportActionBar().setDisplayHomeAsUpEnabled(true);
14 | }
15 |
16 | @Override
17 | public void onLoggedIn() {
18 | finish();
19 | }
20 |
21 | }
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/activity/WebActivity.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.activity;
2 |
3 | import org.musicbrainz.mobile.R;
4 | import org.musicbrainz.mobile.fragment.WebFragment.WebFragmentCallbacks;
5 | import org.musicbrainz.mobile.intent.IntentFactory.Extra;
6 |
7 | import android.os.Bundle;
8 |
9 | import com.actionbarsherlock.view.Window;
10 |
11 | public class WebActivity extends MusicBrainzActivity implements WebFragmentCallbacks {
12 |
13 | @Override
14 | public void onCreate(Bundle savedInstanceState) {
15 | requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.activity_webview);
18 | getSupportActionBar().setTitle(getIntent().getIntExtra(Extra.TITLE, R.string.app_name));
19 | }
20 |
21 | @Override
22 | public void onPageStart() {
23 | setSupportProgressBarIndeterminateVisibility(true);
24 | }
25 |
26 | @Override
27 | public void onPageFinish() {
28 | setSupportProgressBarIndeterminateVisibility(false);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/adapter/pager/ReleasePagerAdapter.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.adapter.pager;
2 |
3 | import org.musicbrainz.android.api.webservice.Entity;
4 | import org.musicbrainz.mobile.App;
5 | import org.musicbrainz.mobile.R;
6 | import org.musicbrainz.mobile.fragment.CoverArtFragment;
7 | import org.musicbrainz.mobile.fragment.EditFragment;
8 | import org.musicbrainz.mobile.fragment.TracksFragment;
9 |
10 | import android.content.res.Resources;
11 | import android.support.v4.app.Fragment;
12 | import android.support.v4.app.FragmentManager;
13 | import android.support.v4.app.FragmentPagerAdapter;
14 |
15 | public class ReleasePagerAdapter extends FragmentPagerAdapter {
16 |
17 | private static final int[] TITLES = {R.string.tab_tracks, R.string.tab_cover_art, R.string.tab_edits};
18 |
19 | public ReleasePagerAdapter(FragmentManager fm) {
20 | super(fm);
21 | }
22 |
23 | @Override
24 | public Fragment getItem(int position) {
25 | switch (position) {
26 | case 0:
27 | return TracksFragment.newInstance();
28 | case 1:
29 | return CoverArtFragment.newInstance();
30 | case 2:
31 | return EditFragment.newInstance(Entity.RELEASE_GROUP);
32 | }
33 | return null;
34 | }
35 |
36 | @Override
37 | public CharSequence getPageTitle(int position) {
38 | Resources res = App.getContext().getResources();
39 | return res.getString(TITLES[position]);
40 | }
41 |
42 | @Override
43 | public int getCount() {
44 | return TITLES.length;
45 | }
46 |
47 | public String makeTag(int position) {
48 | return "android:switcher:" + R.id.pager + ":" + position;
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/CollectionEditLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.mobile.App;
7 | import org.musicbrainz.mobile.async.result.AsyncResult;
8 | import org.musicbrainz.mobile.async.result.LoaderStatus;
9 |
10 | import android.support.v4.content.AsyncTaskLoader;
11 |
12 | public class CollectionEditLoader extends AsyncTaskLoader> {
13 |
14 | private MusicBrainz client;
15 | private String collectionMbid;
16 | private String releaseMbid;
17 | private boolean isAdd;
18 |
19 | public CollectionEditLoader(String collectionMbid, String releaseMbid, boolean isAdd) {
20 | super(App.getContext());
21 | client = App.getWebClient();
22 | this.collectionMbid = collectionMbid;
23 | this.releaseMbid = releaseMbid;
24 | this.isAdd = isAdd;
25 | }
26 |
27 | @Override
28 | protected void onStartLoading() {
29 | super.onStartLoading();
30 | forceLoad();
31 | }
32 |
33 | @Override
34 | public AsyncResult loadInBackground() {
35 | try {
36 | if (isAdd) {
37 | client.addReleaseToCollection(collectionMbid, releaseMbid);
38 | } else {
39 | client.deleteReleaseFromCollection(collectionMbid, releaseMbid);
40 | }
41 | return new AsyncResult(LoaderStatus.SUCCESS);
42 | } catch (IOException e) {
43 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
44 | }
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/CollectionListLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 | import java.util.List;
5 |
6 | import org.musicbrainz.android.api.MusicBrainz;
7 | import org.musicbrainz.android.api.data.UserCollectionInfo;
8 | import org.musicbrainz.mobile.App;
9 | import org.musicbrainz.mobile.async.result.AsyncResult;
10 | import org.musicbrainz.mobile.async.result.LoaderStatus;
11 |
12 | import android.support.v4.content.AsyncTaskLoader;
13 |
14 | public class CollectionListLoader extends AsyncTaskLoader>> {
15 |
16 | private MusicBrainz client;
17 |
18 | public CollectionListLoader() {
19 | super(App.getContext());
20 | client = App.getWebClient();
21 | }
22 |
23 | @Override
24 | protected void onStartLoading() {
25 | forceLoad();
26 | }
27 |
28 | @Override
29 | public AsyncResult> loadInBackground() {
30 | try {
31 | return new AsyncResult>(LoaderStatus.SUCCESS, client.lookupUserCollections());
32 | } catch (IOException e) {
33 | return new AsyncResult>(LoaderStatus.EXCEPTION, e);
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/CollectionLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.android.api.data.UserCollection;
7 | import org.musicbrainz.mobile.App;
8 | import org.musicbrainz.mobile.async.result.AsyncResult;
9 | import org.musicbrainz.mobile.async.result.LoaderStatus;
10 |
11 | public class CollectionLoader extends PersistingAsyncTaskLoader> {
12 |
13 | private MusicBrainz client;
14 | private String mbid;
15 |
16 | public CollectionLoader(String mbid) {
17 | client = App.getWebClient();
18 | this.mbid = mbid;
19 | }
20 |
21 | @Override
22 | public AsyncResult loadInBackground() {
23 | try {
24 | data = new AsyncResult(LoaderStatus.SUCCESS, client.lookupCollection(mbid));
25 | return data;
26 | } catch (IOException e) {
27 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
28 | }
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/LoadPayPalTask.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import org.musicbrainz.mobile.App;
4 | import org.musicbrainz.mobile.config.Secrets;
5 |
6 | import com.paypal.android.MEP.PayPal;
7 |
8 | import android.os.AsyncTask;
9 |
10 | public class LoadPayPalTask extends AsyncTask {
11 |
12 | @Override
13 | protected Void doInBackground(Void... params) {
14 | try {
15 | PayPal payPal = PayPal.initWithAppID(App.getContext(), Secrets.PAYPAL_APP_ID, PayPal.ENV_LIVE);
16 | payPal.setShippingEnabled(false);
17 | } catch (IllegalStateException e) {
18 | // Already initialised.
19 | }
20 | return null;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/LoginLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.android.api.SimpleUser;
7 | import org.musicbrainz.android.api.User;
8 | import org.musicbrainz.android.api.webservice.MusicBrainzWebClient;
9 | import org.musicbrainz.mobile.App;
10 | import org.musicbrainz.mobile.async.result.AsyncResult;
11 | import org.musicbrainz.mobile.async.result.LoaderStatus;
12 |
13 | import android.content.Context;
14 | import android.support.v4.content.AsyncTaskLoader;
15 |
16 | public class LoginLoader extends AsyncTaskLoader> {
17 |
18 | private String username;
19 | private String password;
20 |
21 | public LoginLoader(Context appContext, String username, String password) {
22 | super(App.getContext());
23 | this.username = username;
24 | this.password = password;
25 | }
26 |
27 | @Override
28 | protected void onStartLoading() {
29 | super.onStartLoading();
30 | forceLoad();
31 | }
32 |
33 | @Override
34 | public AsyncResult loadInBackground() {
35 | User credentials = new SimpleUser(username, password);
36 | MusicBrainz client = new MusicBrainzWebClient(credentials, App.getUserAgent(), App.getClientId());
37 | try {
38 | return new AsyncResult(LoaderStatus.SUCCESS, client.autenticateCredentials());
39 | } catch (IOException e) {
40 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
41 | }
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/PersistingAsyncTaskLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import org.musicbrainz.mobile.App;
4 |
5 | import android.support.v4.content.AsyncTaskLoader;
6 |
7 | public abstract class PersistingAsyncTaskLoader extends AsyncTaskLoader {
8 |
9 | protected D data;
10 |
11 | public PersistingAsyncTaskLoader() {
12 | super(App.getContext());
13 | }
14 |
15 | @Override
16 | protected void onStartLoading() {
17 | if (data != null) {
18 | deliverResult(data);
19 | }
20 | if (takeContentChanged() || data == null) {
21 | forceLoad();
22 | }
23 | }
24 |
25 | @Override
26 | public void deliverResult(D data) {
27 | if (isReset()) {
28 | return;
29 | }
30 | this.data = data;
31 | super.deliverResult(data);
32 | }
33 |
34 | @Override
35 | protected void onStopLoading() {
36 | cancelLoad();
37 | }
38 |
39 | @Override
40 | protected void onReset() {
41 | super.onReset();
42 | onStopLoading();
43 | data = null;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/ReleaseGroupReleasesLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 | import java.util.List;
5 |
6 | import org.musicbrainz.android.api.MusicBrainz;
7 | import org.musicbrainz.android.api.data.ReleaseInfo;
8 | import org.musicbrainz.mobile.App;
9 | import org.musicbrainz.mobile.async.result.AsyncResult;
10 | import org.musicbrainz.mobile.async.result.LoaderStatus;
11 |
12 | import android.support.v4.content.AsyncTaskLoader;
13 |
14 | public class ReleaseGroupReleasesLoader extends AsyncTaskLoader>> {
15 |
16 | private MusicBrainz client;
17 | private String mbid;
18 |
19 | public ReleaseGroupReleasesLoader(String mbid) {
20 | super(App.getContext());
21 | client = App.getWebClient();
22 | this.mbid = mbid;
23 | }
24 |
25 | @Override
26 | protected void onStartLoading() {
27 | super.onStartLoading();
28 | forceLoad();
29 | }
30 |
31 | @Override
32 | public AsyncResult> loadInBackground() {
33 | try {
34 | return new AsyncResult>(LoaderStatus.SUCCESS, client.browseReleases(mbid));
35 | } catch (IOException e) {
36 | return new AsyncResult>(LoaderStatus.EXCEPTION, e);
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/SearchArtistLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.mobile.App;
7 | import org.musicbrainz.mobile.async.result.AsyncResult;
8 | import org.musicbrainz.mobile.async.result.LoaderStatus;
9 | import org.musicbrainz.mobile.async.result.SearchResults;
10 | import org.musicbrainz.mobile.async.result.SearchResults.SearchType;
11 |
12 | public class SearchArtistLoader extends PersistingAsyncTaskLoader> {
13 |
14 | private MusicBrainz client;
15 | private String term;
16 |
17 | public SearchArtistLoader(String term) {
18 | client = App.getWebClient();
19 | this.term = term;
20 | }
21 |
22 | @Override
23 | public AsyncResult loadInBackground() {
24 | try {
25 | SearchResults results = new SearchResults(SearchType.ARTIST, client.searchArtist(term));
26 | data = new AsyncResult(LoaderStatus.SUCCESS, results);
27 | return data;
28 | } catch (IOException e) {
29 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/SearchLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.mobile.App;
7 | import org.musicbrainz.mobile.async.result.AsyncResult;
8 | import org.musicbrainz.mobile.async.result.LoaderStatus;
9 | import org.musicbrainz.mobile.async.result.SearchResults;
10 |
11 | public class SearchLoader extends PersistingAsyncTaskLoader> {
12 |
13 | private MusicBrainz client;
14 | private String term;
15 |
16 | public SearchLoader(String term) {
17 | client = App.getWebClient();
18 | this.term = term;
19 | }
20 |
21 | @Override
22 | public AsyncResult loadInBackground() {
23 | try {
24 | SearchResults results = new SearchResults(client.searchArtist(term), client.searchReleaseGroup(term));
25 | data = new AsyncResult(LoaderStatus.SUCCESS, results);
26 | return data;
27 | } catch (IOException e) {
28 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/SearchReleaseGroupLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.mobile.App;
7 | import org.musicbrainz.mobile.async.result.AsyncResult;
8 | import org.musicbrainz.mobile.async.result.LoaderStatus;
9 | import org.musicbrainz.mobile.async.result.SearchResults;
10 | import org.musicbrainz.mobile.async.result.SearchResults.SearchType;
11 |
12 | public class SearchReleaseGroupLoader extends PersistingAsyncTaskLoader> {
13 |
14 | private MusicBrainz client;
15 | private String term;
16 |
17 | public SearchReleaseGroupLoader(String term) {
18 | client = App.getWebClient();
19 | this.term = term;
20 | }
21 |
22 | @Override
23 | public AsyncResult loadInBackground() {
24 | try {
25 | SearchResults results = new SearchResults(SearchType.RELEASE_GROUP, client.searchReleaseGroup(term));
26 | data = new AsyncResult(LoaderStatus.SUCCESS, results);
27 | return data;
28 | } catch (IOException e) {
29 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/SearchReleaseLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 | import java.util.List;
5 |
6 | import org.musicbrainz.android.api.MusicBrainz;
7 | import org.musicbrainz.android.api.data.ReleaseInfo;
8 | import org.musicbrainz.mobile.App;
9 | import org.musicbrainz.mobile.async.result.AsyncResult;
10 | import org.musicbrainz.mobile.async.result.LoaderStatus;
11 |
12 | public class SearchReleaseLoader extends PersistingAsyncTaskLoader>> {
13 |
14 | private MusicBrainz client;
15 | private String term;
16 |
17 | public SearchReleaseLoader(String term) {
18 | client = App.getWebClient();
19 | this.term = term;
20 | }
21 |
22 | @Override
23 | public AsyncResult> loadInBackground() {
24 | try {
25 | data = new AsyncResult>(LoaderStatus.SUCCESS, client.searchRelease(term));
26 | return data;
27 | } catch (IOException e) {
28 | return new AsyncResult>(LoaderStatus.EXCEPTION, e);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/SubmitBarcodeLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.mobile.App;
7 | import org.musicbrainz.mobile.async.result.AsyncResult;
8 | import org.musicbrainz.mobile.async.result.LoaderStatus;
9 |
10 | import android.support.v4.content.AsyncTaskLoader;
11 |
12 | public class SubmitBarcodeLoader extends AsyncTaskLoader> {
13 |
14 | private MusicBrainz client;
15 | private String mbid;
16 | private String barcode;
17 |
18 | public SubmitBarcodeLoader(String mbid, String barcode) {
19 | super(App.getContext());
20 | client = App.getWebClient();
21 | this.mbid = mbid;
22 | this.barcode = barcode;
23 | }
24 |
25 | @Override
26 | protected void onStartLoading() {
27 | super.onStartLoading();
28 | forceLoad();
29 | }
30 |
31 | @Override
32 | public AsyncResult loadInBackground() {
33 | try {
34 | client.submitBarcode(mbid, barcode);
35 | return new AsyncResult(LoaderStatus.SUCCESS);
36 | } catch (IOException e) {
37 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/SubmitRatingLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.android.api.MusicBrainz;
6 | import org.musicbrainz.android.api.webservice.Entity;
7 | import org.musicbrainz.mobile.App;
8 | import org.musicbrainz.mobile.async.result.AsyncResult;
9 | import org.musicbrainz.mobile.async.result.LoaderStatus;
10 |
11 | import android.support.v4.content.AsyncTaskLoader;
12 |
13 | public class SubmitRatingLoader extends AsyncTaskLoader> {
14 |
15 | private MusicBrainz client;
16 | private Entity type;
17 | private String mbid;
18 | private int rating;
19 |
20 | public SubmitRatingLoader(Entity type, String mbid, int rating) {
21 | super(App.getContext());
22 | client = App.getWebClient();
23 | this.type = type;
24 | this.mbid = mbid;
25 | this.rating = rating;
26 | }
27 |
28 | @Override
29 | protected void onStartLoading() {
30 | super.onStartLoading();
31 | forceLoad();
32 | }
33 |
34 | @Override
35 | public AsyncResult loadInBackground() {
36 | try {
37 | client.submitRating(type, mbid, rating);
38 | Float updatedRating = client.lookupRating(type, mbid);
39 | return new AsyncResult(LoaderStatus.SUCCESS, updatedRating);
40 | } catch (IOException e) {
41 | return new AsyncResult(LoaderStatus.EXCEPTION, e);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/SubmitTagsLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async;
2 |
3 | import java.io.IOException;
4 | import java.util.List;
5 |
6 | import org.musicbrainz.android.api.MusicBrainz;
7 | import org.musicbrainz.android.api.data.Tag;
8 | import org.musicbrainz.android.api.util.WebServiceUtils;
9 | import org.musicbrainz.android.api.webservice.Entity;
10 | import org.musicbrainz.mobile.App;
11 | import org.musicbrainz.mobile.async.result.AsyncResult;
12 | import org.musicbrainz.mobile.async.result.LoaderStatus;
13 |
14 | import android.support.v4.content.AsyncTaskLoader;
15 |
16 | public class SubmitTagsLoader extends AsyncTaskLoader>> {
17 |
18 | private MusicBrainz client;
19 | private Entity type;
20 | private String mbid;
21 | private String tags;
22 |
23 | public SubmitTagsLoader(Entity type, String mbid, String tags) {
24 | super(App.getContext());
25 | client = App.getWebClient();
26 | this.type = type;
27 | this.mbid = mbid;
28 | this.tags = tags;
29 | }
30 |
31 | @Override
32 | protected void onStartLoading() {
33 | super.onStartLoading();
34 | forceLoad();
35 | }
36 |
37 | @Override
38 | public AsyncResult> loadInBackground() {
39 | List sanitisedTags = WebServiceUtils.sanitiseCommaSeparatedTags(tags);
40 | try {
41 | client.submitTags(type, mbid, sanitisedTags);
42 | List updatedTags = client.lookupTags(type, mbid);
43 | return new AsyncResult>(LoaderStatus.SUCCESS, updatedTags);
44 | } catch (IOException e) {
45 | return new AsyncResult>(LoaderStatus.EXCEPTION, e);
46 | }
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/external/ArtistBioLoader.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.external;
2 |
3 | import java.io.IOException;
4 |
5 | import org.musicbrainz.mobile.async.PersistingAsyncTaskLoader;
6 | import org.musicbrainz.mobile.async.external.result.ArtistBio;
7 | import org.musicbrainz.mobile.async.external.result.LastFmArtist;
8 |
9 | import android.text.TextUtils;
10 |
11 | public class ArtistBioLoader extends PersistingAsyncTaskLoader {
12 |
13 | private String mbid;
14 | private String wikiPageName;
15 |
16 | public ArtistBioLoader(String mbid, String wikiPageName) {
17 | this.mbid = mbid;
18 | this.wikiPageName = wikiPageName;
19 | }
20 |
21 | @Override
22 | public ArtistBio loadInBackground() {
23 | try {
24 | LastFmArtist lastfm = new LastFmClient().getArtistInfo(mbid);
25 | if (!TextUtils.isEmpty(wikiPageName)) {
26 | String wikiBio = new WikipediaClient().getArtistBio(wikiPageName);
27 | data = new ArtistBio(lastfm.image.get(4).text, lastfm.bio.full, wikiBio);
28 | return data;
29 | }
30 | data = new ArtistBio(lastfm.image.get(4).text, lastfm.bio.full);
31 | return data;
32 | } catch (IOException e) {
33 | return null;
34 | } catch (IllegalStateException ise) {
35 | return null;
36 | }
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/external/LastFmClient.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.external;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 | import java.io.InputStreamReader;
6 | import java.io.Reader;
7 |
8 |
9 | import org.musicbrainz.mobile.async.external.result.LastFmArtist;
10 | import org.musicbrainz.mobile.config.Secrets;
11 |
12 | import com.google.gson.Gson;
13 | import com.google.gson.JsonObject;
14 | import com.google.gson.JsonParser;
15 |
16 | public class LastFmClient extends SimpleWebClient {
17 |
18 | public LastFmArtist getArtistInfo(String mbid) throws IOException {
19 | InputStream stream = getConnection(buildArtistInfoUrl(mbid));
20 | LastFmArtist artist = parseResult(stream);
21 | stream.close();
22 | return artist;
23 | }
24 |
25 | private String buildArtistInfoUrl(String mbid) {
26 | return "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&format=json&mbid=" + mbid + "&api_key="
27 | + Secrets.LASTFM_API_KEY;
28 | }
29 |
30 | private LastFmArtist parseResult(InputStream stream) {
31 | Reader reader = new InputStreamReader(stream);
32 | JsonObject obj = new JsonParser().parse(reader).getAsJsonObject();
33 | return new Gson().fromJson(obj.get("artist"), LastFmArtist.class);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/external/SimpleWebClient.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.external;
2 |
3 | import java.io.BufferedInputStream;
4 | import java.io.File;
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 | import java.net.URL;
8 | import java.net.URLConnection;
9 |
10 | import org.musicbrainz.mobile.App;
11 | import org.musicbrainz.mobile.util.Log;
12 |
13 | import android.os.Build;
14 |
15 | public abstract class SimpleWebClient {
16 |
17 | public SimpleWebClient() {
18 | enableHttpResponseCache();
19 | disableConnectionReuseIfNecessary();
20 | }
21 |
22 | protected InputStream getConnection(String url) throws IOException {
23 | URLConnection conn = new URL(url).openConnection();
24 | conn.setRequestProperty("User-Agent", App.getUserAgent());
25 | return new BufferedInputStream(conn.getInputStream());
26 | }
27 |
28 | private void enableHttpResponseCache() {
29 | try {
30 | long httpCacheSize = 10 * 1024 * 1024; // 10 MB
31 | File httpCacheDir = new File(App.getContext().getCacheDir(), "http");
32 | Class.forName("android.net.http.HttpResponseCache").getMethod("install", File.class, long.class)
33 | .invoke(null, httpCacheDir, httpCacheSize);
34 | } catch (Exception e) {
35 | Log.d("HTTP response cache not available.");
36 | }
37 | }
38 |
39 | @SuppressWarnings("deprecation")
40 | private void disableConnectionReuseIfNecessary() {
41 | // Work around pre-Froyo bugs in HTTP connection reuse.
42 | if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {
43 | System.setProperty("http.keepAlive", "false");
44 | }
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/external/WikipediaClient.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.external;
2 |
3 | import java.io.IOException;
4 | import java.io.InputStream;
5 | import java.io.InputStreamReader;
6 | import java.io.Reader;
7 |
8 | import org.musicbrainz.mobile.async.external.result.WikipediaBio;
9 |
10 | import com.google.gson.Gson;
11 | import com.google.gson.JsonObject;
12 | import com.google.gson.JsonParser;
13 |
14 | public class WikipediaClient extends SimpleWebClient {
15 |
16 | public String getArtistBio(String pageName) throws IOException {
17 | InputStream stream = getConnection(buildWikipediaUrl(pageName));
18 | String response = parseResult(stream);
19 | stream.close();
20 | return response;
21 | }
22 |
23 | public String buildWikipediaUrl(String pageName) {
24 | return "http://en.wikipedia.org/w/api.php?action=mobileview&format=json&prop=text§ions=0&page=" + pageName;
25 | }
26 |
27 | private String parseResult(InputStream stream) {
28 | Reader reader = new InputStreamReader(stream);
29 | JsonObject obj = new JsonParser().parse(reader).getAsJsonObject();
30 | WikipediaBio response = new Gson().fromJson(obj.get("mobileview"), WikipediaBio.class);
31 | return response.sections.get(0).text;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/external/result/LastFmArtist.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.external.result;
2 |
3 | import java.util.ArrayList;
4 |
5 | import com.google.gson.annotations.SerializedName;
6 |
7 | public class LastFmArtist {
8 |
9 | public String url;
10 | public ArrayList image;
11 | public Bio bio;
12 |
13 | public class Bio {
14 | @SerializedName("content")
15 | public String full;
16 | }
17 |
18 | public class Image {
19 | @SerializedName("#text")
20 | public String text;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/external/result/WikipediaBio.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.external.result;
2 |
3 | import java.util.List;
4 |
5 | public class WikipediaBio {
6 |
7 | public List sections;
8 |
9 | public class Section {
10 | public String text;
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/result/AsyncEntityResult.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.result;
2 |
3 | import org.musicbrainz.android.api.data.UserData;
4 |
5 | public class AsyncEntityResult extends AsyncResult{
6 |
7 | protected final UserData userData;
8 |
9 | public AsyncEntityResult(LoaderStatus status, T data) {
10 | super(status, data);
11 | this.userData = null;
12 | }
13 |
14 | public AsyncEntityResult(LoaderStatus status, T data, UserData userData) {
15 | super(status, data);
16 | this.userData = userData;
17 | }
18 |
19 | public AsyncEntityResult(LoaderStatus status, Throwable exception) {
20 | super(status, exception);
21 | this.userData = null;
22 | }
23 |
24 | public UserData getUserData() {
25 | return userData;
26 | }
27 |
28 | public boolean hasUserData() {
29 | return userData != null;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/result/AsyncResult.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.result;
2 |
3 | public class AsyncResult {
4 |
5 | protected final LoaderStatus status;
6 | protected final T data;
7 | protected final Throwable exception;
8 |
9 | public AsyncResult(LoaderStatus status) {
10 | this.status = status;
11 | this.data = null;
12 | this.exception = null;
13 | }
14 |
15 | public AsyncResult(LoaderStatus status, T data) {
16 | this.status = status;
17 | this.data = data;
18 | this.exception = null;
19 | }
20 |
21 | public AsyncResult(LoaderStatus status, Throwable exception) {
22 | this.status = status;
23 | this.data = null;
24 | this.exception = exception;
25 | }
26 |
27 | public LoaderStatus getStatus() {
28 | return status;
29 | }
30 |
31 | public T getData() {
32 | return data;
33 | }
34 |
35 | public Throwable getException() {
36 | return exception;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/result/LoaderStatus.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.result;
2 |
3 | public enum LoaderStatus {
4 | SUCCESS, EXCEPTION;
5 | }
6 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/async/result/SearchResults.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.async.result;
2 |
3 | import java.util.List;
4 |
5 | import org.musicbrainz.android.api.data.ArtistSearchResult;
6 | import org.musicbrainz.android.api.data.ReleaseGroupInfo;
7 |
8 | public class SearchResults {
9 |
10 | private final SearchType type;
11 | private final List artistResults;
12 | private final List releaseGroupResults;
13 |
14 | @SuppressWarnings("unchecked")
15 | public SearchResults(SearchType type, List> results) {
16 | if (type == SearchType.ARTIST) {
17 | artistResults = (List) results;
18 | releaseGroupResults = null;
19 | } else {
20 | artistResults = null;
21 | releaseGroupResults = (List) results;
22 | }
23 | this.type = type;
24 | }
25 |
26 | public SearchResults(List artistResults, List releaseGroupResults) {
27 | this.artistResults = artistResults;
28 | this.releaseGroupResults = releaseGroupResults;
29 | this.type = SearchType.ALL;
30 | }
31 |
32 | public SearchType getType() {
33 | return type;
34 | }
35 |
36 | public List getArtistResults() {
37 | return artistResults;
38 | }
39 |
40 | public List getReleaseGroupResults() {
41 | return releaseGroupResults;
42 | }
43 |
44 | public enum SearchType {
45 | ARTIST, RELEASE_GROUP, ALL;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/backup/MusicBrainzBackupAgent.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.backup;
2 |
3 | import android.app.backup.BackupAgentHelper;
4 | import android.app.backup.SharedPreferencesBackupHelper;
5 |
6 | public class MusicBrainzBackupAgent extends BackupAgentHelper {
7 |
8 | private static final String PREFERENCES_NAME = "org.musicbrainz.mobile_preferences";
9 | private static final String PREFERENCES_BACKUP_KEY = "MusicBrainzPrefs";
10 |
11 | @Override
12 | public void onCreate() {
13 | super.onCreate();
14 | SharedPreferencesBackupHelper helper = new SharedPreferencesBackupHelper(getApplicationContext(), PREFERENCES_NAME);
15 | addHelper(PREFERENCES_BACKUP_KEY, helper);
16 | }
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/config/Configuration.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.config;
2 |
3 | public class Configuration {
4 |
5 | public static final boolean LIVE = false;
6 | public static final String TAG = "MusicBrainz";
7 |
8 | public static final String FEEDBACK_EMAIL = "support@musicbrainz.org";
9 | public static final String FEEDBACK_SUBJECT = "[MBAndroid] Feedback";
10 |
11 | public static final String USER_AGENT = "MBAndroid";
12 | public static final String CLIENT_NAME = "musicbrainz.android";
13 |
14 | public static final String WEBSITE = "http://musicbrainz.org/";
15 |
16 | public static final String URL_REGISTER = WEBSITE + "register";
17 | public static final String URL_FORGOT_PASS = WEBSITE + "lost-password";
18 | public static final String URL_DONATE = "http://metabrainz.org/donate";
19 |
20 | public static final String ARTIST_SHARE = WEBSITE + "artist/";
21 | public static final String RELEASE_SHARE = WEBSITE + "release/";
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/config/Secrets.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.config;
2 |
3 | /**
4 | * These values are required to build the app but they are simply debug/sandbox
5 | * values. Release builds use a file with a different set of values for obvious
6 | * reasons.
7 | */
8 | public class Secrets {
9 |
10 | public static final String BUGSENSE_API_KEY = "99f3740e";
11 | public static final String PAYPAL_APP_ID = "APP-80W284485P519543T";
12 | public static final String LASTFM_API_KEY = "b25b959554ed76058ac220b7b2e0a026";
13 |
14 | public String getKey() {
15 | return "aplaceholderstring";
16 | }
17 |
18 | }
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/dialog/AuthenticatingDialog.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.dialog;
2 |
3 | import org.musicbrainz.mobile.fragment.LoginFragment;
4 |
5 | import android.app.Activity;
6 | import android.app.Dialog;
7 | import android.app.ProgressDialog;
8 | import android.content.Context;
9 | import android.content.DialogInterface;
10 | import android.os.Bundle;
11 | import android.support.v4.app.DialogFragment;
12 |
13 | public class AuthenticatingDialog extends DialogFragment {
14 |
15 | public static final String TAG = "loading";
16 | private static final String MESSAGE = "messageId";
17 |
18 | private Context context;
19 |
20 | public static AuthenticatingDialog newInstance(int messageId) {
21 | AuthenticatingDialog dialog = new AuthenticatingDialog();
22 | Bundle args = new Bundle();
23 | args.putInt(MESSAGE, messageId);
24 | dialog.setArguments(args);
25 | return dialog;
26 | }
27 |
28 | @Override
29 | public void onAttach(Activity activity) {
30 | super.onAttach(activity);
31 | context = activity.getApplicationContext();
32 | }
33 |
34 | @Override
35 | public Dialog onCreateDialog(Bundle savedInstanceState) {
36 | ProgressDialog dialog = new ProgressDialog(getActivity());
37 | dialog.setMessage(getMessage());
38 | dialog.setCancelable(true);
39 | return dialog;
40 | }
41 |
42 | private String getMessage() {
43 | int messageId = getArguments().getInt(MESSAGE);
44 | return context.getResources().getString(messageId);
45 | }
46 |
47 | @Override
48 | public void onCancel(DialogInterface dialog) {
49 | getLoaderManager().destroyLoader(LoginFragment.LOGIN_LOADER);
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/AboutFragment.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment;
2 |
3 | import org.musicbrainz.mobile.App;
4 | import org.musicbrainz.mobile.R;
5 | import org.musicbrainz.mobile.view.HtmlAssetTextView;
6 |
7 | import com.actionbarsherlock.app.SherlockFragment;
8 | import com.actionbarsherlock.view.Menu;
9 | import com.actionbarsherlock.view.MenuInflater;
10 |
11 | import android.os.Bundle;
12 | import android.view.LayoutInflater;
13 | import android.view.View;
14 | import android.view.ViewGroup;
15 | import android.widget.TextView;
16 |
17 | public class AboutFragment extends SherlockFragment {
18 |
19 | private TextView versionLabel;
20 |
21 | @Override
22 | public void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setHasOptionsMenu(true);
25 | }
26 |
27 | @Override
28 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
29 | View layout = inflater.inflate(R.layout.fragment_about, container);
30 | versionLabel = (TextView) layout.findViewById(R.id.version_text);
31 | HtmlAssetTextView body = (HtmlAssetTextView) layout.findViewById(R.id.about_text);
32 | body.setAsset("about.html");
33 | return layout;
34 | }
35 |
36 | @Override
37 | public void onActivityCreated(Bundle savedInstanceState) {
38 | super.onActivityCreated(savedInstanceState);
39 | versionLabel.setText(getText(R.string.version_text) + " " + App.getVersion());
40 | }
41 |
42 | @Override
43 | public void onCreateOptionsMenu (Menu menu, MenuInflater inflater) {
44 | inflater.inflate(R.menu.fragment_about, menu);
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/ContextFragment.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.support.v4.app.Fragment;
6 |
7 | public class ContextFragment extends Fragment {
8 |
9 | protected Context context;
10 |
11 | @Override
12 | public void onAttach(Activity activity) {
13 | super.onAttach(activity);
14 | context = activity.getApplicationContext();
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/DonateTextFragment.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment;
2 |
3 | import org.musicbrainz.mobile.R;
4 |
5 | import android.os.Bundle;
6 | import android.support.v4.app.Fragment;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 |
11 | public class DonateTextFragment extends Fragment {
12 |
13 | @Override
14 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
15 | View layout = inflater.inflate(R.layout.fragment_donate_text, container);
16 | return layout;
17 | }
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/LinksFragment.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment;
2 |
3 | import org.musicbrainz.android.api.data.Artist;
4 | import org.musicbrainz.android.api.data.WebLink;
5 | import org.musicbrainz.mobile.R;
6 | import org.musicbrainz.mobile.adapter.list.WeblinkAdapter;
7 | import org.musicbrainz.mobile.fragment.contracts.EntityTab;
8 |
9 | import android.content.Intent;
10 | import android.net.Uri;
11 | import android.os.Bundle;
12 | import android.support.v4.app.ListFragment;
13 | import android.view.LayoutInflater;
14 | import android.view.View;
15 | import android.view.ViewGroup;
16 | import android.widget.ListView;
17 |
18 | public class LinksFragment extends ListFragment implements EntityTab {
19 |
20 | public static LinksFragment newInstance() {
21 | return new LinksFragment();
22 | }
23 |
24 | @Override
25 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
26 | return inflater.inflate(R.layout.fragment_links, container, false);
27 | }
28 |
29 | @Override
30 | public void update(Artist artist) {
31 | setListAdapter(new WeblinkAdapter(getActivity(), artist.getLinks()));
32 | }
33 |
34 | @Override
35 | public void onListItemClick(ListView l, View v, int position, long id) {
36 | super.onListItemClick(l, v, position, id);
37 | WebLink link = (WebLink) getListAdapter().getItem(position);
38 | startBrowserLink(link.getUrl());
39 | }
40 |
41 | private void startBrowserLink(String url) {
42 | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/TracksFragment.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment;
2 |
3 | import org.musicbrainz.android.api.data.Release;
4 | import org.musicbrainz.mobile.R;
5 | import org.musicbrainz.mobile.adapter.list.ReleaseTrackAdapter;
6 | import org.musicbrainz.mobile.fragment.contracts.EntityTab;
7 |
8 | import android.os.Bundle;
9 | import android.support.v4.app.ListFragment;
10 | import android.view.LayoutInflater;
11 | import android.view.View;
12 | import android.view.ViewGroup;
13 |
14 | public class TracksFragment extends ListFragment implements EntityTab {
15 |
16 | public static TracksFragment newInstance() {
17 | return new TracksFragment();
18 | }
19 |
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
22 | return inflater.inflate(R.layout.fragment_tracklist, container, false);
23 | }
24 |
25 | @Override
26 | public void update(Release release) {
27 | setListAdapter(new ReleaseTrackAdapter(getActivity(), release.getTrackList()));
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/WelcomeFragment.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment;
2 |
3 | import org.musicbrainz.mobile.App;
4 | import org.musicbrainz.mobile.R;
5 |
6 | import android.os.Bundle;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.ViewGroup;
10 | import android.widget.TextView;
11 |
12 | public class WelcomeFragment extends ContextFragment {
13 |
14 | private TextView welcomeText;
15 |
16 | @Override
17 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
18 | View layout = inflater.inflate(R.layout.fragment_dash_welcome, container);
19 | welcomeText = (TextView) layout.findViewById(R.id.welcome_text);
20 | return layout;
21 | }
22 |
23 | @Override
24 | public void onResume() {
25 | super.onResume();
26 | updateText();
27 | }
28 |
29 | public void updateText() {
30 | if (App.isUserLoggedIn()) {
31 | welcomeText.setText(getString(R.string.welcome_loggedin) + " " + App.getUser().getUsername());
32 | } else {
33 | welcomeText.setText(R.string.welcome);
34 | }
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/contracts/ContractFragment.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment.contracts;
2 |
3 | import android.app.Activity;
4 | import android.support.v4.app.Fragment;
5 |
6 | public abstract class ContractFragment extends Fragment {
7 |
8 | private T contract;
9 |
10 | @SuppressWarnings("unchecked")
11 | @Override
12 | public void onAttach(Activity activity) {
13 | try {
14 | contract = (T) activity;
15 | } catch (ClassCastException e) {
16 | throw new IllegalStateException(activity.getClass().getSimpleName() + " must implement "
17 | + getClass().getSimpleName() + "'s contract interface.", e);
18 | }
19 | super.onAttach(activity);
20 | }
21 |
22 | @Override
23 | public void onDetach() {
24 | super.onDetach();
25 | contract = null;
26 | }
27 |
28 | public final T getContract() {
29 | return contract;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/fragment/contracts/EntityTab.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.fragment.contracts;
2 |
3 | public interface EntityTab {
4 |
5 | void update(E entity);
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/intent/zxing/IntentResult.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2009 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package org.musicbrainz.mobile.intent.zxing;
18 |
19 | /**
20 | *
21 | * Encapsulates the result of a barcode scan invoked through
22 | * {@link IntentIntegrator}.
23 | *
24 | *
25 | * @author Sean Owen
26 | */
27 | public final class IntentResult {
28 |
29 | private final String contents;
30 | private final String formatName;
31 |
32 | IntentResult(String contents, String formatName) {
33 | this.contents = contents;
34 | this.formatName = formatName;
35 | }
36 |
37 | /**
38 | * @return raw content of barcode
39 | */
40 | public String getContents() {
41 | return contents;
42 | }
43 |
44 | /**
45 | * @return name of format, like "QR_CODE", "UPC_A". See
46 | * BarcodeFormat
for more format names.
47 | */
48 | public String getFormatName() {
49 | return formatName;
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/suggestion/SuggestionProvider.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.suggestion;
2 |
3 | import android.content.SearchRecentSuggestionsProvider;
4 |
5 | public class SuggestionProvider extends SearchRecentSuggestionsProvider {
6 |
7 | public final static String AUTHORITY = "org.musicbrainz.mobile.SearchSuggestionProvider";
8 | public final static int MODE = DATABASE_MODE_QUERIES;
9 |
10 | public SuggestionProvider() {
11 | setupSuggestions(AUTHORITY, MODE);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/user/AppUser.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.user;
2 |
3 | import org.musicbrainz.android.api.User;
4 |
5 | public interface AppUser extends User {
6 |
7 | void setUsername(String username);
8 |
9 | void setPassword(String password);
10 |
11 | boolean isLoggedIn();
12 |
13 | void clearData();
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/util/CoverArt.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.util;
2 |
3 | public class CoverArt {
4 |
5 | private static final String CAA = "http://coverartarchive.org";
6 |
7 | public enum Size {
8 | SMALL, LARGE
9 | }
10 |
11 | public static String getFront(String mbid, Size size) {
12 | return CAA + "/release/" + mbid + "/front" + sizePostfix(size);
13 | }
14 |
15 | public static String getBack(String mbid, Size size) {
16 | return CAA + "/release/" + mbid + "/back" + sizePostfix(size);
17 | }
18 |
19 | private static String sizePostfix(Size size) {
20 | if (size == Size.LARGE) {
21 | return "-500";
22 | } else {
23 | return "-250";
24 | }
25 | }
26 |
27 | public static String getThumb(String asin) {
28 | return "http://ec1.images-amazon.com/images/P/" + asin + ".01.THUMZ";
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/util/DonationBuilder.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.util;
2 |
3 | import java.math.BigDecimal;
4 |
5 | import com.paypal.android.MEP.PayPal;
6 | import com.paypal.android.MEP.PayPalPayment;
7 |
8 | public class DonationBuilder {
9 |
10 | public static final String DONATION_CURRENCY = "USD";
11 | public static final String DONATION_EMAIL = "paypal@metabrainz.org";
12 | public static final String DONATION_NAME = "MetaBrainz Foundation";
13 | public static final String DONATION_DESCRIPTION = "MusicBrainz donation via Android app";
14 |
15 | private double amount;
16 |
17 | public DonationBuilder(double amount) {
18 | this.amount = amount;
19 | }
20 |
21 | public PayPalPayment getPayPalPayment() {
22 | PayPalPayment donation = new PayPalPayment();
23 | donation.setSubtotal(convertAmountToBigDecimal());
24 | donation.setCurrencyType(DONATION_CURRENCY);
25 | donation.setRecipient(DONATION_EMAIL);
26 | donation.setMerchantName(DONATION_NAME);
27 | donation.setDescription(DONATION_DESCRIPTION);
28 | donation.setPaymentType(PayPal.PAYMENT_TYPE_NONE);
29 | donation.setPaymentSubtype(PayPal.PAYMENT_SUBTYPE_DONATIONS);
30 | return donation;
31 | }
32 |
33 | private BigDecimal convertAmountToBigDecimal() {
34 | return BigDecimal.valueOf(amount);
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/util/Log.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.util;
2 |
3 | import org.musicbrainz.mobile.config.Configuration;
4 |
5 | public class Log {
6 |
7 | public static final String TAG = Configuration.TAG;
8 |
9 | public static void e(String message) {
10 | android.util.Log.e(TAG, message);
11 | }
12 |
13 | public static void d(String message) {
14 | android.util.Log.d(TAG, message);
15 | }
16 |
17 | public static void v(String message) {
18 | android.util.Log.v(TAG, message);
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/util/Utils.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.util;
2 |
3 | import java.io.ByteArrayOutputStream;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 |
7 | import android.content.Context;
8 | import android.content.Intent;
9 | import android.net.Uri;
10 |
11 | /**
12 | * A set of fairly general Android utility methods.
13 | */
14 | public class Utils {
15 |
16 | public static Intent shareIntent(String text) {
17 | Intent intent = new Intent(Intent.ACTION_SEND).setType("text/plain");
18 | return intent.putExtra(Intent.EXTRA_TEXT, text);
19 | }
20 |
21 | public static Intent emailIntent(String recipient, String subject) {
22 | Uri uri = Uri.parse("mailto:" + recipient);
23 | Intent intent = new Intent(Intent.ACTION_SENDTO, uri);
24 | intent.putExtra(Intent.EXTRA_SUBJECT, subject);
25 | return intent;
26 | }
27 |
28 | public static Intent urlIntent(String url) {
29 | return new Intent(Intent.ACTION_VIEW, Uri.parse(url));
30 | }
31 |
32 | public static String stringFromAsset(Context context, String asset) {
33 | try {
34 | InputStream input = context.getResources().getAssets().open(asset);
35 | byte[] buffer = new byte[input.available()];
36 | input.read(buffer);
37 | ByteArrayOutputStream output = new ByteArrayOutputStream();
38 | output.write(buffer);
39 | output.close();
40 | input.close();
41 | return output.toString();
42 | } catch (IOException e) {
43 | Log.e("Error reading text file from assets folder.");
44 | return "";
45 | }
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/view/DashTileView.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.view;
2 |
3 | import org.musicbrainz.mobile.R;
4 |
5 | import android.content.Context;
6 | import android.util.AttributeSet;
7 | import android.view.LayoutInflater;
8 | import android.widget.ImageView;
9 | import android.widget.RelativeLayout;
10 | import android.widget.TextView;
11 |
12 | public class DashTileView extends RelativeLayout {
13 |
14 | private ImageView icon;
15 | private TextView text;
16 |
17 | public DashTileView(Context context, AttributeSet attrs) {
18 | super(context, attrs);
19 | LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
20 | inflater.inflate(R.layout.view_dash_tile, this);
21 | }
22 |
23 | @Override
24 | protected void onFinishInflate() {
25 | super.onFinishInflate();
26 | setFocusable(true);
27 | setBackgroundResource(R.drawable.dash_grid);
28 | icon = (ImageView) findViewById(R.id.dash_tile_icon);
29 | text = (TextView) findViewById(R.id.dash_tile_text);
30 | }
31 |
32 | public void setIcon(int drawableId) {
33 | icon.setImageResource(drawableId);
34 | }
35 |
36 | public void setText(int stringId) {
37 | text.setText(stringId);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/view/FadeImageView.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.view;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.net.Uri;
6 | import android.util.AttributeSet;
7 | import android.view.animation.AlphaAnimation;
8 | import android.widget.ImageView;
9 |
10 | public class FadeImageView extends ImageView {
11 |
12 | private static final int DURATION = 500;
13 |
14 | public FadeImageView(Context context) {
15 | super(context);
16 | }
17 |
18 | public FadeImageView(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | }
21 |
22 | @Override
23 | public void setImageBitmap(Bitmap bm) {
24 | super.setImageBitmap(bm);
25 | fadeIn();
26 | }
27 |
28 | @Override
29 | public void setImageResource(int resId) {
30 | super.setImageResource(resId);
31 | fadeIn();
32 | }
33 |
34 | @Override
35 | public void setImageURI(Uri uri) {
36 | super.setImageURI(uri);
37 | fadeIn();
38 | }
39 |
40 | private void fadeIn() {
41 | AlphaAnimation fadeIn = new AlphaAnimation(0, 1);
42 | fadeIn.setDuration(DURATION);
43 | startAnimation(fadeIn);
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/view/HeightRelativeLayout.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.RelativeLayout;
6 |
7 | public class HeightRelativeLayout extends RelativeLayout {
8 |
9 | public HeightRelativeLayout(Context context) {
10 | super(context);
11 | }
12 |
13 | public HeightRelativeLayout(Context context, AttributeSet attributes) {
14 | super(context, attributes);
15 | }
16 |
17 | @Override
18 | public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
19 | super.onMeasure(heightMeasureSpec, heightMeasureSpec);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/view/HtmlAssetTextView.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.view;
2 |
3 | import org.musicbrainz.mobile.util.Utils;
4 |
5 | import android.content.Context;
6 | import android.text.Html;
7 | import android.util.AttributeSet;
8 | import android.widget.TextView;
9 |
10 | public class HtmlAssetTextView extends TextView {
11 |
12 | private Context context;
13 |
14 | public HtmlAssetTextView(Context context, AttributeSet attrs) {
15 | super(context, attrs);
16 | this.context = context;
17 | }
18 |
19 | public void setAsset(String asset) {
20 | setText(Html.fromHtml(Utils.stringFromAsset(context, asset)));
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/view/RobotoLightTextView.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.view;
2 |
3 | import org.musicbrainz.mobile.App;
4 |
5 | import android.content.Context;
6 | import android.graphics.Typeface;
7 | import android.util.AttributeSet;
8 | import android.widget.TextView;
9 |
10 | public class RobotoLightTextView extends TextView {
11 |
12 | public RobotoLightTextView(Context context) {
13 | super(context);
14 | }
15 |
16 | public RobotoLightTextView(Context context, AttributeSet attrs) {
17 | super(context, attrs);
18 | }
19 |
20 | public RobotoLightTextView(Context context, AttributeSet attrs, int defStyle) {
21 | super(context, attrs, defStyle);
22 | }
23 |
24 | @Override
25 | public void setTypeface(Typeface tf) {
26 | if (isInEditMode()) {
27 | super.setTypeface(tf);
28 | } else {
29 | super.setTypeface(App.getRobotoLight());
30 | }
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/org/musicbrainz/mobile/view/WidthRelativeLayout.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.view;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.widget.RelativeLayout;
6 |
7 | public class WidthRelativeLayout extends RelativeLayout {
8 |
9 | public WidthRelativeLayout(Context context) {
10 | super(context);
11 | }
12 |
13 | public WidthRelativeLayout(Context context, AttributeSet attributes) {
14 | super(context, attributes);
15 | }
16 |
17 | @Override
18 | public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
19 | super.onMeasure(widthMeasureSpec, widthMeasureSpec);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/deployer/PayPal_MPL-1.5.6.46.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jdamcd/musicbrainz-android/fc6f518a0067b27cb28316a0d7d441086559f6bd/deployer/PayPal_MPL-1.5.6.46.jar
--------------------------------------------------------------------------------
/deployer/pom.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 | 4.0.0
7 |
8 |
9 | org.musicbrainz.mobile
10 | aggregator
11 | 1.0-SNAPSHOT
12 |
13 |
14 | deployer
15 | deployer
16 | pom
17 |
18 |
19 |
20 |
21 | maven-install-plugin
22 |
23 |
24 | paypal-mpl
25 | install
26 | install-file
27 |
28 | com.paypal
29 | mpl
30 | jar
31 | 1.5.6.46
32 | PayPal_MPL-1.5.6.46.jar
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/instrumentation/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
--------------------------------------------------------------------------------
/instrumentation/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/instrumentation/src/org/musicbrainz/mobile/test/TestProjectSetup.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.test;
2 |
3 | import android.test.AndroidTestCase;
4 | import android.test.suitebuilder.annotation.SmallTest;
5 |
6 | public class TestProjectSetup extends AndroidTestCase {
7 |
8 | @SmallTest
9 | public void testTheTruth() {
10 | assertTrue(true);
11 | }
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/instrumentation/src/org/musicbrainz/mobile/test/application/RenamingContext.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.test.application;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 | import android.test.RenamingDelegatingContext;
6 | import android.test.mock.MockContext;
7 |
8 | public class RenamingContext extends RenamingDelegatingContext {
9 |
10 | private static final String PREFIX = "test.";
11 |
12 | public RenamingContext(Context context) {
13 | super(new DelegatedMockContext(context), PREFIX);
14 | }
15 |
16 | private static class DelegatedMockContext extends MockContext {
17 |
18 | private Context delegatedContext;
19 |
20 | public DelegatedMockContext(Context context) {
21 | delegatedContext = context;
22 | }
23 |
24 | @Override
25 | public String getPackageName() {
26 | return delegatedContext.getPackageName();
27 | }
28 |
29 | @Override
30 | public SharedPreferences getSharedPreferences(String name, int mode) {
31 | return delegatedContext.getSharedPreferences(PREFIX + name, mode);
32 | }
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/instrumentation/src/org/musicbrainz/mobile/test/robotium/Account.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.test.robotium;
2 |
3 | /**
4 | * Put your account details in this file to run login tests.
5 | */
6 | public class Account {
7 |
8 | public static final String USERNAME = "jdamcd";
9 | public static final String PASSWORD = "password";
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/instrumentation/src/org/musicbrainz/mobile/test/robotium/search/ReleseGroupSearchTest.java:
--------------------------------------------------------------------------------
1 | package org.musicbrainz.mobile.test.robotium.search;
2 |
3 | import org.musicbrainz.mobile.R;
4 | import org.musicbrainz.mobile.activity.DashboardActivity;
5 | import org.musicbrainz.mobile.activity.ReleaseActivity;
6 | import org.musicbrainz.mobile.activity.SearchActivity;
7 |
8 | import android.test.ActivityInstrumentationTestCase2;
9 | import android.test.suitebuilder.annotation.LargeTest;
10 |
11 | import com.jayway.android.robotium.solo.Solo;
12 |
13 | public class ReleseGroupSearchTest extends ActivityInstrumentationTestCase2 {
14 |
15 | private Solo solo;
16 |
17 | public ReleseGroupSearchTest() {
18 | super(DashboardActivity.class);
19 | }
20 |
21 | public void setUp() throws Exception {
22 | solo = new Solo(getInstrumentation(), getActivity());
23 | }
24 |
25 | @LargeTest
26 | public void testSearchWithExistingRG() throws Exception {
27 | solo.pressSpinnerItem(0, 1);
28 | solo.enterText(0, "codes and keys");
29 | clickSearch();
30 | solo.assertCurrentActivity("Expected Search Activity", SearchActivity.class);
31 | assertTrue(solo.searchText("Release"));
32 | solo.clickInList(0);
33 | solo.assertCurrentActivity("Expected Release Activity", ReleaseActivity.class);
34 | solo.clickInList(0);
35 | assertTrue(solo.searchText("Death Cab for Cutie"));
36 | }
37 |
38 | private void clickSearch() {
39 | solo.clickOnView(getActivity().findViewById(R.id.search_btn));
40 | }
41 |
42 | @Override
43 | public void tearDown() throws Exception {
44 | solo.finishOpenedActivities();
45 | }
46 |
47 | }
--------------------------------------------------------------------------------