lint warnings & hardcoded text
This commit is contained in:
@@ -34,9 +34,10 @@ public class FavoriteProviderHelper {
|
||||
String selection = FavoriteColumns.TITLE + "=?";
|
||||
String[] selectionArgs = new String[]{movie.getTitle()};
|
||||
Cursor cursor = mResolver.query(FavoriteProvider.Favorites.FAVORITES_URI, projection, selection, selectionArgs, null);
|
||||
if (cursor != null && cursor.getCount() > 0)
|
||||
return true;
|
||||
return false;
|
||||
boolean isFavourite = (cursor != null && cursor.getCount() > 0)
|
||||
if(cursor != null)
|
||||
cursor.close();
|
||||
return isFavourite;
|
||||
}
|
||||
|
||||
public void addFavorite(Movie movie) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
tools:ignore="InconsistentLayout"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
@@ -13,7 +14,8 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:baselineAligned="false">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_weight="1"
|
||||
@@ -31,7 +33,7 @@
|
||||
android:id="@+id/main_details_placeHolderText"
|
||||
android:layout_gravity="center"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:text="Please select a movie"
|
||||
android:text="@string/details_frag_placeholder_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:text="No videos found."
|
||||
android:text="@string/movie_details_no_movies_found"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<item android:icon="@drawable/ic_action_share" android:id="@+id/action_share" android:title="Share" app:showAsAction="ifRoom" />
|
||||
<item android:id="@+id/action_favorite" android:title="Add/Remove Favorite" app:showAsAction="ifRoom" />
|
||||
<item android:icon="@drawable/ic_action_share" android:id="@+id/action_share" android:title="@string/details_action_share" app:showAsAction="ifRoom" />
|
||||
<item android:id="@+id/action_favorite" android:title="@string/details_action_favorite" app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
@@ -1,7 +1,7 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity">
|
||||
<item android:id="@+id/action_sort_popularity" android:title="Popular movies" app:showAsAction="never" />
|
||||
<item android:id="@+id/action_sort_rating" android:title="Highest av. rating" app:showAsAction="never" />
|
||||
<item android:id="@+id/action_sort_favorites" android:title="Favorites" app:showAsAction="never" />
|
||||
<item android:id="@+id/action_sort_popularity" android:title="@string/list_action_popular" app:showAsAction="never" />
|
||||
<item android:id="@+id/action_sort_rating" android:title="@string/list_action_rating" app:showAsAction="never" />
|
||||
<item android:id="@+id/action_sort_favorites" android:title="@string/list_action_favorites" app:showAsAction="never" />
|
||||
</menu>
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<resources>
|
||||
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<bool name="master_detail">false</bool>
|
||||
</resources>
|
||||
|
||||
@@ -3,4 +3,11 @@
|
||||
<string name="action_settings">Settings</string>
|
||||
<string name="movie_release_date">Release: %1$s</string>
|
||||
<string name="movie_rating">Rating: %1$s/10.0</string>
|
||||
<string name="details_action_share">Share</string>
|
||||
<string name="details_action_favorite">Add/Remove Favorite</string>
|
||||
<string name="list_action_popular">Popular movies</string>
|
||||
<string name="list_action_rating">Highest av. rating</string>
|
||||
<string name="list_action_favorites">Favorites</string>
|
||||
<string name="movie_details_no_movies_found">No videos found.</string>
|
||||
<string name="details_frag_placeholder_text">Please select a movie</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user