From f6fce0355c3fbf6d8c7658d37a6d92b2ec328049 Mon Sep 17 00:00:00 2001 From: Karim Abou Zeid Date: Thu, 5 Mar 2015 17:54:41 +0100 Subject: [PATCH] Removed all Log.i --- app/build.gradle | 2 +- .../kabouzeid/gramophone/helper/MusicPlayerRemote.java | 1 - .../gramophone/lastfm/album/LastFMAlbumImageLoader.java | 5 ----- .../gramophone/lastfm/album/LastFMAlbumInfoUtil.java | 1 - .../lastfm/artist/LastFMArtistBiographyLoader.java | 4 ---- .../lastfm/artist/LastFMArtistImageLoader.java | 9 --------- .../gramophone/lastfm/artist/LastFMArtistInfoUtil.java | 3 +-- .../lastfm/artist/LastFMArtistThumbnailLoader.java | 9 --------- .../gramophone/service/MediaButtonIntentReceiver.java | 1 - .../com/kabouzeid/gramophone/service/MusicService.java | 3 --- 10 files changed, 2 insertions(+), 36 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 0d0ac07f..f9ad4824 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -55,7 +55,7 @@ dependencies { compile 'com.github.ksoichiro:android-observablescrollview:1.3.0' compile 'com.mcxiaoke.volley:library:1.0.+' compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3' - compile 'com.afollestad:material-dialogs:0.6.3.0' + compile 'com.afollestad:material-dialogs:0.6.3.4' compile('com.crashlytics.sdk.android:crashlytics:2.2.1@aar') { transitive = true; } diff --git a/app/src/main/java/com/kabouzeid/gramophone/helper/MusicPlayerRemote.java b/app/src/main/java/com/kabouzeid/gramophone/helper/MusicPlayerRemote.java index 82c7a2af..16f07504 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/helper/MusicPlayerRemote.java +++ b/app/src/main/java/com/kabouzeid/gramophone/helper/MusicPlayerRemote.java @@ -275,7 +275,6 @@ public class MusicPlayerRemote implements OnMusicRemoteEventListener { position = restoredPosition; notifyOnMusicRemoteEventListeners(MusicRemoteEvent.STATE_RESTORED); - Log.i(TAG, "restored last state"); } catch (IOException | ClassNotFoundException | ClassCastException e) { Log.e(TAG, "error while restoring music service state", e); playingQueue = new ArrayList<>(); diff --git a/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumImageLoader.java b/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumImageLoader.java index 9ed6adb8..71dbfb88 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumImageLoader.java +++ b/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumImageLoader.java @@ -30,21 +30,18 @@ public class LastFMAlbumImageLoader { if (queryAlbum != null) { String albumJSON = AlbumJSONStore.getInstance(context).getAlbumJSON(queryAlbum + queryArtist); if (albumJSON != null) { - Log.i(TAG, queryAlbum + " by " + queryArtist + " is in cache."); try { loadAlbumImageFromJSON(new JSONObject(albumJSON), callback); } catch (JSONException e) { Log.e(TAG, "Error while parsing string from cache to JSONObject", e); } } else { - Log.i(TAG, queryAlbum + " is not in cache."); downloadAlbumImage(context, queryAlbum, queryArtist, callback); } } } private static void loadAlbumImageFromJSON(JSONObject jsonObject, final AlbumImageLoaderCallback callback) { - Log.i(TAG, "Applying album art..."); String url = LastFMAlbumInfoUtil.getAlbumImageUrlFromJSON(jsonObject); if (!url.trim().equals("")) { DisplayImageOptions options = new DisplayImageOptions.Builder() @@ -84,13 +81,11 @@ public class LastFMAlbumImageLoader { } private static void downloadAlbumImage(final Context context, final String album, final String artist, final AlbumImageLoaderCallback callback) { - Log.i(TAG, "Downloading details for " + album); App app = (App) context.getApplicationContext(); String albumUrl = LastFMAlbumInfoUtil.getAlbumUrl(album, artist); JsonObjectRequest albumInfoJSONRequest = new JsonObjectRequest(0, albumUrl, null, new Response.Listener() { @Override public void onResponse(JSONObject response) { - Log.i(TAG, "Download was successful!"); LastFMAlbumInfoUtil.saveAlbumJSONDataToCacheAndDisk(context, album, artist, response); loadAlbumImageFromJSON(response, callback); } diff --git a/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumInfoUtil.java b/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumInfoUtil.java index f3ea7a8e..2a2a8b40 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumInfoUtil.java +++ b/app/src/main/java/com/kabouzeid/gramophone/lastfm/album/LastFMAlbumInfoUtil.java @@ -81,7 +81,6 @@ public class LastFMAlbumInfoUtil { } public static void saveAlbumJSONDataToCacheAndDisk(Context context, String album, String artist, JSONObject jsonObject) { - Log.i(TAG, "Saving new JSON album data for " + album + "..."); AlbumJSONStore.getInstance(context).addAlbumJSON(album + artist, jsonObject.toString()); } } diff --git a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistBiographyLoader.java b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistBiographyLoader.java index d67afeab..86255a2b 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistBiographyLoader.java +++ b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistBiographyLoader.java @@ -22,7 +22,6 @@ public class LastFMArtistBiographyLoader { if (queryArtist != null) { String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist); if (artistJSON != null) { - Log.i(TAG, queryArtist + " is in cache."); try { JSONObject json = new JSONObject(artistJSON); String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(json); @@ -31,20 +30,17 @@ public class LastFMArtistBiographyLoader { Log.e(TAG, "Error while parsing bio from cache to JSONObject", e); } } else { - Log.i(TAG, queryArtist + " is not in cache."); downloadArtistBio(context, queryArtist, callback); } } } private static void downloadArtistBio(final Context context, final String artist, final ArtistBioLoaderCallback callback) { - Log.i(TAG, "Downloading details for " + artist); App app = (App) context.getApplicationContext(); String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist); JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener() { @Override public void onResponse(JSONObject response) { - Log.i(TAG, "Download was successful!"); LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response); String bio = LastFMArtistInfoUtil.getArtistBiographyFromJSON(response); callback.onArtistBioLoaded(bio); diff --git a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistImageLoader.java b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistImageLoader.java index 7f64bd41..269a8381 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistImageLoader.java +++ b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistImageLoader.java @@ -33,25 +33,18 @@ public class LastFMArtistImageLoader { if (queryArtist != null) { String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist); if (artistJSON != null && !forceDownload) { - Log.i(TAG, queryArtist + " is in cache."); try { loadArtistImageFromJSON(new JSONObject(artistJSON), callback); } catch (JSONException e) { Log.e(TAG, "Error while parsing string from cache to JSONObject", e); } } else { - if(forceDownload){ - Log.i(TAG, queryArtist + " force re-download"); - } else { - Log.i(TAG, queryArtist + " is not in cache."); - } downloadArtistJSONAndStartImageDownload(context, queryArtist, callback); } } } private static void loadArtistImageFromJSON(JSONObject jsonObject, final ArtistImageLoaderCallback callback) { - Log.i(TAG, "Applying artist art..."); String url = LastFMArtistInfoUtil.getArtistImageUrlFromJSON(jsonObject); if (!url.trim().equals("")) { ImageLoader.getInstance().loadImage(url, ImageLoaderUtil.getCacheOnDiskOptions(), new ImageLoadingListener() { @@ -81,13 +74,11 @@ public class LastFMArtistImageLoader { } private static void downloadArtistJSONAndStartImageDownload(final Context context, final String artist, final ArtistImageLoaderCallback callback) { - Log.i(TAG, "Downloading details for " + artist); App app = (App) context.getApplicationContext(); String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist); JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener() { @Override public void onResponse(JSONObject response) { - Log.i(TAG, "Download was successful!"); LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response); loadArtistImageFromJSON(response, callback); } diff --git a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistInfoUtil.java b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistInfoUtil.java index 7866418d..9038dc05 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistInfoUtil.java +++ b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistInfoUtil.java @@ -83,13 +83,12 @@ public class LastFMArtistInfoUtil { try { return rootJSON.getJSONObject("artist").getJSONObject("bio").getString("content"); } catch (JSONException e) { - //Log.e(TAG, "Error while getting artist biografie from JSON parameter!", e); + //Log.e(TAG, "Error while getting artist biography from JSON parameter!", e); return ""; } } public static void saveArtistJSONDataToCacheAndDisk(Context context, String artist, JSONObject jsonObject) { - Log.i(TAG, "Saving new JSON artist data for " + artist + "..."); ArtistJSONStore.getInstance(context).removeItem(artist); ArtistJSONStore.getInstance(context).addArtistJSON(artist, jsonObject.toString()); } diff --git a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistThumbnailLoader.java b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistThumbnailLoader.java index f9157ad7..9650d9d9 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistThumbnailLoader.java +++ b/app/src/main/java/com/kabouzeid/gramophone/lastfm/artist/LastFMArtistThumbnailLoader.java @@ -33,25 +33,18 @@ public class LastFMArtistThumbnailLoader { if (queryArtist != null) { String artistJSON = ArtistJSONStore.getInstance(context).getArtistJSON(queryArtist); if (artistJSON != null && !forceDownload) { - Log.i(TAG, queryArtist + " is in cache."); try { loadArtistThumbnailFromJSON(new JSONObject(artistJSON), callback); } catch (JSONException e) { Log.e(TAG, "Error while parsing string from cache to JSONObject", e); } } else { - if(forceDownload){ - Log.i(TAG, queryArtist + " force re-download"); - } else { - Log.i(TAG, queryArtist + " is not in cache."); - } downloadArtistThumbnail(context, queryArtist, callback); } } } private static void loadArtistThumbnailFromJSON(JSONObject jsonObject, final ArtistThumbnailLoaderCallback callback) { - Log.i(TAG, "Applying artist thumbnail..."); String url = LastFMArtistInfoUtil.getArtistThumbnailUrlFromJSON(jsonObject); if (!url.trim().equals("")) { ImageLoader.getInstance().loadImage(url, ImageLoaderUtil.getCacheOnDiskOptions(), new ImageLoadingListener() { @@ -81,13 +74,11 @@ public class LastFMArtistThumbnailLoader { } private static void downloadArtistThumbnail(final Context context, final String artist, final ArtistThumbnailLoaderCallback callback) { - Log.i(TAG, "Downloading details for " + artist); App app = (App) context.getApplicationContext(); String artistUrl = LastFMArtistInfoUtil.getArtistUrl(artist); JsonObjectRequest artistInfoJSONRequest = new JsonObjectRequest(0, artistUrl, null, new Response.Listener() { @Override public void onResponse(JSONObject response) { - Log.i(TAG, "Download was successful!"); LastFMArtistInfoUtil.saveArtistJSONDataToCacheAndDisk(context, artist, response); loadArtistThumbnailFromJSON(response, callback); } diff --git a/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java b/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java index b95533d5..a384f59f 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java +++ b/app/src/main/java/com/kabouzeid/gramophone/service/MediaButtonIntentReceiver.java @@ -15,7 +15,6 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Intent.ACTION_MEDIA_BUTTON)) { - Log.i(TAG, intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT).toString()); final KeyEvent event = intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT); if (event == null) return; diff --git a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java index c8387575..443805a2 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java +++ b/app/src/main/java/com/kabouzeid/gramophone/service/MusicService.java @@ -170,7 +170,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe @Override public IBinder onBind(Intent intent) { - Log.i(TAG, "onBind"); return musicBind; } @@ -226,7 +225,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe try { InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_PLAYING_QUEUE, playingQueue); InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_ORIGINAL_PLAYING_QUEUE, originalPlayingQueue); - Log.i(TAG, "saved current queue state"); } catch (IOException e) { Log.e(TAG, "error while saving music service queue state", e); } @@ -238,7 +236,6 @@ public class MusicService extends Service implements MediaPlayer.OnPreparedListe public void run() { try { InternalStorageUtil.writeObject(MusicService.this, AppKeys.IS_POSITION_IN_QUEUE, getPosition()); - Log.i(TAG, "saved current position state"); } catch (IOException e) { Log.e(TAG, "error while saving music service position state", e); }