diff options
author | Nils Griebner <nils@nils-griebner.de> | 2018-06-19 20:24:17 +0300 |
---|---|---|
committer | Nils Griebner <nils@nils-griebner.de> | 2018-06-19 20:24:17 +0300 |
commit | 3f0756ec65980cfa9f7aa5f1dc8dd0857420c076 (patch) | |
tree | 734a5ead99fb8bb860e7deca7f539af4215e5704 /News-Android-App | |
parent | e065288987876ef5e0b552cc3e1524eeba214ef2 (diff) |
Add changes which @AndyScherzinger pointed out in his review
Diffstat (limited to 'News-Android-App')
3 files changed, 10 insertions, 19 deletions
diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderDetailFragment.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderDetailFragment.java index 3d27d5c6..13232c60 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderDetailFragment.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderDetailFragment.java @@ -108,6 +108,8 @@ public class NewsReaderDetailFragment extends Fragment { private int onResumeCount = 0; private static final String LAYOUT_MANAGER_STATE = "LAYOUT_MANAGER_STATE"; + private static final String SEARCH_IN_TITLE = "0"; + private static final String SEARCH_IN_BODY = "1"; private boolean mMarkAsReadWhileScrollingEnabled; @BindView(R.id.pb_loading) ProgressBar pbLoading; @@ -247,7 +249,7 @@ public class NewsReaderDetailFragment extends Fragment { * @param context Context * @param searchString The string to search for */ - public void SearchInCurrentRssView(final Context context, final String searchString) { + public void searchInCurrentRssView(final Context context, final String searchString) { Log.v(TAG, "SearchInCurrentRssView"); AsyncTaskHelper.StartAsyncTask(new SearchInCurrentRssViewTask(context, searchString)); } @@ -361,8 +363,7 @@ public class NewsReaderDetailFragment extends Fragment { * @param context Context * @param searchString String to search for */ - public SearchInCurrentRssViewTask(final Context context, final String searchString) - { + public SearchInCurrentRssViewTask(final Context context, final String searchString) { super(context); this.searchString=searchString; } @@ -404,9 +405,9 @@ public class NewsReaderDetailFragment extends Fragment { { String sql=""; String searchIn = mPrefs.getString(SettingsActivity.SP_SEARCH_IN,"0"); - if(searchIn.equals("0")) { + if(searchIn.equals(SEARCH_IN_TITLE)) { sql = dbConn.getAllItemsIdsForFeedSQLFilteredByTitle(idFeed, onlyUnreadItems, onlyStarredItems, sortDirection, searchString); - } else if(searchIn.equals("1")) { + } else if(searchIn.equals(SEARCH_IN_BODY)) { sql = dbConn.getAllItemsIdsForFeedSQLFilteredByBodySQL(idFeed, onlyUnreadItems, onlyStarredItems, sortDirection, searchString); } return sql; @@ -421,9 +422,9 @@ public class NewsReaderDetailFragment extends Fragment { { String sql=""; String searchIn = mPrefs.getString(SettingsActivity.SP_SEARCH_IN,"0"); - if(searchIn.equals("0")) { + if(searchIn.equals(SEARCH_IN_TITLE)) { sql = dbConn.getAllItemsIdsForFolderSQLFilteredByTitle(ID_FOLDER, onlyUnreadItems, sortDirection, searchString); - } else if(searchIn.equals("1")) { + } else if(searchIn.equals(SEARCH_IN_BODY)) { sql = dbConn.getAllItemsIdsForFolderSQLFilteredByBody(ID_FOLDER, onlyUnreadItems, sortDirection, searchString); } diff --git a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java index 99782d2e..c7b8c77c 100644 --- a/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java +++ b/News-Android-App/src/main/java/de/luhmer/owncloudnewsreader/NewsReaderListActivity.java @@ -772,8 +772,7 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements case R.id.menu_markAllAsRead: NewsReaderDetailFragment ndf = getNewsReaderDetailFragment(); - if(ndf != null) - { + if(ndf != null) { DatabaseConnectionOrm dbConn2 = new DatabaseConnectionOrm(this); dbConn2.markAllItemsAsReadForCurrentView(); @@ -800,7 +799,7 @@ public class NewsReaderListActivity extends PodcastFragmentActivity implements NewsReaderDetailFragment ndf = getNewsReaderDetailFragment(); if(ndf != null) { - ndf.SearchInCurrentRssView(this,searchString); + ndf.searchInCurrentRssView(this,searchString); } } diff --git a/News-Android-App/src/main/res/drawable/ic_search_black_24dp.xml b/News-Android-App/src/main/res/drawable/ic_search_black_24dp.xml deleted file mode 100644 index affc7ba2..00000000 --- a/News-Android-App/src/main/res/drawable/ic_search_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ -<vector xmlns:android="http://schemas.android.com/apk/res/android" - android:width="24dp" - android:height="24dp" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> - <path - android:fillColor="#FF000000" - android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> -</vector> |