diff options
Diffstat (limited to '')
21 files changed, 13 insertions, 104 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java index 609eee1f..ff9ae1f5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AccessTokenAuthenticator.java @@ -1,7 +1,5 @@ package ml.docilealligator.infinityforreddit; -import android.util.Log; - import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -73,7 +71,6 @@ class AccessTokenAuthenticator implements Authenticator { String newAccessToken = jsonObject.getString(RedditUtils.ACCESS_TOKEN_KEY); mRedditDataRoomDatabase.accountDao().changeAccessToken(account.getUsername(), newAccessToken); - Log.i("access token", newAccessToken); return newAccessToken; } return ""; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentDataSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentDataSource.java index ae2af2a1..04c95734 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentDataSource.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentDataSource.java @@ -88,19 +88,16 @@ public class CommentDataSource extends PageKeyedDataSource<String, CommentData> @Override public void parseFailed() { - Log.i("Comments fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }).execute(); } else { - Log.i("Comments fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("Comments fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); @@ -137,19 +134,16 @@ public class CommentDataSource extends PageKeyedDataSource<String, CommentData> @Override public void parseFailed() { - Log.i("Comments fetch error", "Error parsing data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }).execute(); } else { - Log.i("Comments fetch error", "Error fetching data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error fetching data")); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("Comments fetch error", "Error fetchin data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error fetching data")); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchComment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchComment.java index 5558a104..fd53414b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchComment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchComment.java @@ -1,7 +1,5 @@ package ml.docilealligator.infinityforreddit; -import android.util.Log; - import androidx.annotation.NonNull; import java.util.ArrayList; @@ -47,19 +45,16 @@ class FetchComment { @Override public void onParseCommentFailed() { - Log.i("parse failed", "parse failed"); fetchCommentListener.onFetchCommentFailed(); } }); } else { - Log.i("call failed", response.message()); fetchCommentListener.onFetchCommentFailed(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", t.getMessage()); fetchCommentListener.onFetchCommentFailed(); } }); @@ -100,18 +95,15 @@ class FetchComment { @Override public void onParseCommentFailed() { fetchMoreCommentListener.onFetchMoreCommentFailed(); - Log.i("comment parse failed", "comment parse failed"); } }); } else { - Log.i("more comment failed", response.message()); fetchMoreCommentListener.onFetchMoreCommentFailed(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("more comment failed", t.getMessage()); fetchMoreCommentListener.onFetchMoreCommentFailed(); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchMyInfo.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchMyInfo.java index 3a9ee4e5..1538a70e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchMyInfo.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchMyInfo.java @@ -26,14 +26,12 @@ class FetchMyInfo { if(response.isSuccessful()) { fetchUserMyListener.onFetchMyInfoSuccess(response.body()); } else { - Log.i("call failed", response.message()); fetchUserMyListener.onFetchMyInfoFail(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", t.getMessage()); fetchUserMyListener.onFetchMyInfoFail(); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchPost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchPost.java index d169cb10..02901768 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchPost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchPost.java @@ -1,7 +1,5 @@ package ml.docilealligator.infinityforreddit; -import android.util.Log; - import androidx.annotation.NonNull; import java.util.Locale; @@ -37,19 +35,16 @@ class FetchPost { @Override public void onParsePostFail() { fetchPostListener.fetchPostFailed(); - Log.i("error", "fetch post failed"); } }); } else { fetchPostListener.fetchPostFailed(); - Log.i("call failed", Integer.toString(response.code())); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { fetchPostListener.fetchPostFailed(); - Log.i("call failed", t.getMessage()); } }); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubredditData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubredditData.java index 8f6ff973..11416e32 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubredditData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubredditData.java @@ -39,19 +39,16 @@ class FetchSubredditData { @Override public void onParseSubredditDataFail() { - Log.i("parse failed", "true"); fetchSubredditDataListener.onFetchSubredditDataFail(); } }); } else { - Log.i("call failed", response.message()); fetchSubredditDataListener.onFetchSubredditDataFail(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", "message " + t.getMessage()); fetchSubredditDataListener.onFetchSubredditDataFail(); } }); @@ -74,19 +71,16 @@ class FetchSubredditData { @Override public void onParseSubredditListingDataFail() { - Log.i("parse failed", "true"); fetchSubredditListingDataListener.onFetchSubredditListingDataFail(); } }); } else { - Log.i("call failed", response.message()); fetchSubredditListingDataListener.onFetchSubredditListingDataFail(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", "message " + t.getMessage()); fetchSubredditListingDataListener.onFetchSubredditListingDataFail(); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java index a6376432..4500196a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchSubscribedThing.java @@ -59,14 +59,12 @@ class FetchSubscribedThing { } }); } else { - Log.i("call failed", response.message()); fetchSubscribedThingListener.onFetchSubscribedThingFail(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", t.getMessage()); fetchSubscribedThingListener.onFetchSubscribedThingFail(); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchUserData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchUserData.java index 941137f5..38c76536 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchUserData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchUserData.java @@ -42,14 +42,12 @@ public class FetchUserData { } }); } else { - Log.i("call failed", response.message()); fetchUserDataListener.onFetchUserDataFailed(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", "message " + t.getMessage()); fetchUserDataListener.onFetchUserDataFailed(); } }); @@ -76,14 +74,12 @@ public class FetchUserData { } }); } else { - Log.i("call failed", response.message()); fetchUserListingDataListener.onFetchUserListingDataFailed(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", "message " + t.getMessage()); fetchUserListingDataListener.onFetchUserListingDataFailed(); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MessageDataSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MessageDataSource.java index 45bf7737..80f904b1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/MessageDataSource.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MessageDataSource.java @@ -74,7 +74,6 @@ class MessageDataSource extends PageKeyedDataSource<String, Message> { @Override public void fetchFailed() { - Log.i("Messages fetch error", "Error fetch messages"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error fetch messages")); } }); @@ -106,7 +105,6 @@ class MessageDataSource extends PageKeyedDataSource<String, Message> { @Override public void fetchFailed() { - Log.i("Comments fetch error", "Error parsing data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error fetching data")); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseAndSaveAccountInfo.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseAndSaveAccountInfo.java index ae133e2e..2494192b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseAndSaveAccountInfo.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseAndSaveAccountInfo.java @@ -2,7 +2,6 @@ package ml.docilealligator.infinityforreddit; import android.os.AsyncTask; import android.text.Html; -import android.util.Log; import org.json.JSONException; import org.json.JSONObject; @@ -37,7 +36,6 @@ class ParseAndSaveAccountInfo { this.parseAndSaveAccountInfoListener = parseAndSaveAccountInfoListener; parseFailed = false; } catch (JSONException e) { - Log.i("user info json error", "message: " + e.getMessage()); parseAndSaveAccountInfoListener.onParseMyInfoFail(); } } @@ -57,7 +55,6 @@ class ParseAndSaveAccountInfo { redditDataRoomDatabase.accountDao().updateAccountInfo(name, profileImageUrl, bannerImageUrl, karma); } catch (JSONException e) { parseFailed = true; - Log.i("parse comment error", "message: " + e.getMessage()); } return null; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java index 275acb6c..f9770867 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseComment.java @@ -38,9 +38,6 @@ class ParseComment { new ParseCommentAsyncTask(childrenArray, commentData, locale, parentId, 0, parseCommentListener).execute(); } catch (JSONException e) { e.printStackTrace(); - if(e.getMessage() != null) { - Log.i("comment json error", e.getMessage()); - } parseCommentListener.onParseCommentFailed(); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java index 3271b434..1cae9ee3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParsePost.java @@ -2,7 +2,6 @@ package ml.docilealligator.infinityforreddit; import android.os.AsyncTask; import android.text.Html; -import android.util.Log; import org.json.JSONArray; import org.json.JSONException; @@ -100,7 +99,7 @@ class ParsePost { JSONObject data = allData.getJSONObject(0).getJSONObject(JSONUtils.DATA_KEY); post = parseBasicData(data, locale); } catch (JSONException e) { - Log.e("parsing post error", "message: " + e.getMessage()); + e.printStackTrace(); parseFailed = true; } } else { @@ -128,7 +127,7 @@ class ParsePost { } } } catch (JSONException e) { - Log.e("parsing post error", "message: " + e.getMessage()); + e.printStackTrace(); } } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java index 56d35248..ccded2ec 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubredditData.java @@ -1,7 +1,6 @@ package ml.docilealligator.infinityforreddit; import android.os.AsyncTask; -import android.util.Log; import org.json.JSONArray; import org.json.JSONException; @@ -43,7 +42,7 @@ class ParseSubredditData { jsonResponse = new JSONObject(response); parseFailed = false; } catch (JSONException e) { - Log.i("subreddit json error", "message: " + e.getMessage()); + e.printStackTrace(); parseSubredditDataListener.onParseSubredditDataFail(); } } @@ -56,7 +55,7 @@ class ParseSubredditData { subredditData = parseSubredditData(data); } catch (JSONException e) { parseFailed = true; - Log.i("parse", "SubredditData error"); + e.printStackTrace(); } return null; } @@ -85,7 +84,7 @@ class ParseSubredditData { parseFailed = false; subredditListingData = new ArrayList<>(); } catch (JSONException e) { - Log.i("subreddit json error", "message: " + e.getMessage()); + e.printStackTrace(); parseFailed = true; } } @@ -104,8 +103,8 @@ class ParseSubredditData { after = jsonResponse.getJSONObject(JSONUtils.DATA_KEY).getString(JSONUtils.AFTER_KEY); } } catch (JSONException e) { + e.printStackTrace(); parseFailed = true; - Log.i("parse", "SubredditDataListing error"); parseSubredditListingDataListener.onParseSubredditListingDataFail(); } return null; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java index 5121fc3b..b02b646a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseSubscribedThing.java @@ -1,7 +1,6 @@ package ml.docilealligator.infinityforreddit; import android.os.AsyncTask; -import android.util.Log; import org.json.JSONArray; import org.json.JSONException; @@ -60,7 +59,7 @@ class ParseSubscribedThing { newSubredditData = new ArrayList<>(); this.parseSubscribedSubredditsListener = parseSubscribedSubredditsListener; } catch (JSONException e) { - Log.i("user info json error", e.getMessage()); + e.printStackTrace(); parseSubscribedSubredditsListener.onParseSubscribedSubredditsFail(); } } @@ -109,7 +108,7 @@ class ParseSubscribedThing { lastItem = jsonResponse.getJSONObject(JSONUtils.DATA_KEY).getString(JSONUtils.AFTER_KEY); } catch (JSONException e) { parseFailed = true; - Log.i("parse subscribed error", e.getMessage()); + e.printStackTrace(); } return null; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java index b332f90a..8b9e225b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ParseUserData.java @@ -1,7 +1,6 @@ package ml.docilealligator.infinityforreddit; import android.os.AsyncTask; -import android.util.Log; import org.json.JSONArray; import org.json.JSONException; @@ -43,7 +42,7 @@ public class ParseUserData { this.parseUserDataListener = parseUserDataListener; parseFailed = false; } catch (JSONException e) { - Log.i("userdata json error", "error: " + e.getMessage()); + e.printStackTrace(); parseUserDataListener.onParseUserDataFailed(); } } @@ -54,7 +53,7 @@ public class ParseUserData { userData = parseUserDataBase(jsonResponse); } catch (JSONException e) { parseFailed = true; - Log.i("parse user data error", "error: " + e.getMessage()); + e.printStackTrace(); } return null; } @@ -86,7 +85,7 @@ public class ParseUserData { parseFailed = false; userDataArrayList = new ArrayList<>(); } catch (JSONException e) { - Log.i("userdata json error", "error: " + e.getMessage()); + e.printStackTrace(); parseFailed = true; } } @@ -103,7 +102,7 @@ public class ParseUserData { } } catch (JSONException e) { parseFailed = true; - Log.i("parse user data error", "error: " + e.getMessage()); + e.printStackTrace(); } return null; } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java index e1cf8f22..970e902a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostDataSource.java @@ -201,7 +201,6 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostFail() { - Log.i("Post fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); @@ -232,13 +231,11 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("Post fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } } else { - Log.i("Post fetch error", response.message()); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } @@ -275,12 +272,10 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("Best post", "Error parsing data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } else { - Log.i("best post", response.message()); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } @@ -319,7 +314,6 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostFail() { - Log.i("Post fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); @@ -350,13 +344,11 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("Post fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } } else { - Log.i("Post fetch error", response.message()); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } @@ -399,12 +391,10 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("Best post", "Error parsing data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } else { - Log.i("Best post", response.message()); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } @@ -457,12 +447,10 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("Post fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } else { - Log.i("Post fetch error", response.message()); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } @@ -505,12 +493,10 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("User posts", "Error parsing data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } else { - Log.i("User posts", response.message()); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } @@ -572,12 +558,10 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("Post fetch error", "Error parsing data"); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } else { - Log.i("Post fetch error", response.message()); initialLoadStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } @@ -629,12 +613,10 @@ class PostDataSource extends PageKeyedDataSource<String, Post> { @Override public void onParsePostsListingFail() { - Log.i("Search post", "Error parsing data"); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, "Error parsing data")); } }); } else { - Log.i("Search post", response.message()); paginationNetworkStateLiveData.postValue(new NetworkState(NetworkState.Status.FAILED, response.message())); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java index 52de6548..164b21a1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java @@ -5,7 +5,6 @@ import android.content.Intent; import android.graphics.ColorFilter; import android.graphics.drawable.Drawable; import android.net.Uri; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -132,9 +131,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) { if(holder instanceof DataViewHolder) { Post post = getItem(position); - if(post == null) { - Log.i("is null", Integer.toString(holder.getAdapterPosition())); - } else { + if(post != null) { final String id = post.getFullName(); final String subredditNamePrefixed = post.getSubredditNamePrefixed(); String subredditName = subredditNamePrefixed.substring(2); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java index bb03c8e7..ed7d104a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PullNotificationWorker.java @@ -4,7 +4,6 @@ import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.net.Uri; -import android.util.Log; import androidx.annotation.NonNull; import androidx.core.app.NotificationCompat; @@ -54,10 +53,7 @@ public class PullNotificationWorker extends Worker { @NonNull @Override public Result doWork() { - Log.i("workmanager", "do"); try { - Log.i("workmanager", "before response"); - List<Account> accounts = redditDataRoomDatabase.accountDao().getAllAccounts(); for(int accountIndex = 0; accountIndex < accounts.size(); accountIndex++) { Account account = accounts.get(accountIndex); @@ -67,7 +63,6 @@ public class PullNotificationWorker extends Worker { Response<String> response = fetchMessages(account, 1); if(response != null && response.isSuccessful()) { - Log.i("workmanager", "has response"); String responseBody = response.body(); ArrayList<Message> messages = FetchMessages.parseMessage(responseBody, context.getResources().getConfiguration().locale); @@ -165,30 +160,20 @@ public class PullNotificationWorker extends Worker { summaryBuilder.setContentIntent(summaryPendingIntent); notificationManager.notify(NotificationUtils.getSummaryIdUnreadMessage(accountIndex), summaryBuilder.build()); - - Log.i("workmanager", "message size " + messages.size()); } else { - Log.i("workmanager", "no message"); return Result.success(); } } else { - if(response != null) { - Log.i("workmanager", "retry1 " + response.code()); - } return Result.retry(); } } } catch (IOException e) { e.printStackTrace(); - Log.i("workmanager", "retry2"); return Result.retry(); } catch (JSONException e) { e.printStackTrace(); - Log.i("workmanager", "json failure"); return Result.failure(); } - - Log.i("workmanager", "success"); return Result.success(); } @@ -234,8 +219,6 @@ public class PullNotificationWorker extends Worker { JSONObject jsonObject = new JSONObject(response.body().toString()); String newAccessToken = jsonObject.getString(RedditUtils.ACCESS_TOKEN_KEY); redditDataRoomDatabase.accountDao().changeAccessToken(account.getUsername(), newAccessToken); - - Log.i("access token", newAccessToken); return newAccessToken; } return ""; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubmitPost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubmitPost.java index fe8c1e79..98374317 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubmitPost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubmitPost.java @@ -204,7 +204,6 @@ class SubmitPost { @Override public void onResponse(@NonNull Call<String> call, @NonNull retrofit2.Response<String> response) { if(response.isSuccessful()) { - Log.i("afasdfadsfasdfasdfasdf", "a " + response.body()); try { getSubmittedPost(response.body(), kind, oauthRetrofit, accessToken, locale, submitPostListener); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java index cd7c4893..99337362 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/UserFollowing.java @@ -68,14 +68,12 @@ class UserFollowing { } userFollowingListener.onUserFollowingSuccess(); } else { - Log.i("call failed", Integer.toString(response.code())); userFollowingListener.onUserFollowingFail(); } } @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", t.getMessage()); userFollowingListener.onUserFollowingFail(); } }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/VoteThing.java b/app/src/main/java/ml/docilealligator/infinityforreddit/VoteThing.java index 4bd39936..8c2d2f01 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/VoteThing.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/VoteThing.java @@ -50,7 +50,6 @@ class VoteThing { @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", t.getMessage()); voteThingListener.onVoteThingFail(position); } }); @@ -79,7 +78,6 @@ class VoteThing { @Override public void onFailure(@NonNull Call<String> call, @NonNull Throwable t) { - Log.i("call failed", t.getMessage()); voteThingWithoutPositionListener.onVoteThingFail(); } }); |