diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 39139a6..261ec28 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -6,7 +6,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 5d19981..1a3eaff 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,7 +37,7 @@ - + diff --git a/app/src/main/NoImage-web.png b/app/src/main/NoImage-web.png deleted file mode 100644 index 10778a2..0000000 Binary files a/app/src/main/NoImage-web.png and /dev/null differ diff --git a/app/src/main/java/com/example/android/popularmovies/DetailFragment.java b/app/src/main/java/com/example/android/popularmovies/DetailFragment.java index 4e0133f..4ae8f35 100644 --- a/app/src/main/java/com/example/android/popularmovies/DetailFragment.java +++ b/app/src/main/java/com/example/android/popularmovies/DetailFragment.java @@ -1,18 +1,25 @@ package com.example.android.popularmovies; -import android.annotation.SuppressLint; import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.net.Uri; import android.os.Bundle; import android.support.v4.app.Fragment; +import android.support.v4.view.MenuItemCompat; +import android.support.v7.widget.ShareActionProvider; import android.util.Log; +import android.util.TypedValue; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; import com.example.android.popularmovies.data.MovieContract; @@ -26,23 +33,29 @@ import butterknife.ButterKnife; public class DetailFragment extends Fragment implements View.OnClickListener { private static final String LOG_TAG = DetailFragment.class.getSimpleName(); - public DetailFragment() {} + public DetailFragment() { + setHasOptionsMenu(true); + } @Bind(R.id.rating) TextView rating; @Bind(R.id.releaseDate) TextView release; + @Bind(R.id.runtime) TextView runtime; @Bind(R.id.overview) TextView overview; @Bind(R.id.titleView) TextView title; @Bind(R.id.posterImage) ImageView poster; @Bind(R.id.star_icon) ImageView favoriteIcon; @Bind(R.id.favoriteButton) View favoriteButton; + @Bind(R.id.reviewHeader) TextView reviewHeader; + @Bind(R.id.reviewList) LinearLayout reviews; + @Bind(R.id.trailerList) LinearLayout trailerList; + private ShareActionProvider shareActionProvider; private MovieInfo movie; private boolean viewCreated; private boolean displayTitle = false; @Override - public void onAttach(Context context) - { + public void onAttach(Context context) { super.onAttach(context); Log.d(LOG_TAG, "ATTACHED TO ACTIVITY"); } @@ -74,12 +87,21 @@ public class DetailFragment extends Fragment implements View.OnClickListener //Check for MovieID here because, if it returns -1, the fragment was not called in a single //activity, and is likely being displayed along another fragment - if(intent.getIntExtra("MOVIE_ID", -1) == -1) + if(intent.getLongExtra("MOVIE_ID", -1) == -1) { displayTitle = true; } } + @Override + public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) + { + inflater.inflate(R.menu.detail_fragment, menu); + MenuItem menuItem = menu.findItem(R.id.action_share); + shareActionProvider = + (ShareActionProvider)MenuItemCompat.getActionProvider(menuItem); + } + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) @@ -145,7 +167,7 @@ public class DetailFragment extends Fragment implements View.OnClickListener setMovieInfo(MovieUtil.getMovie(getActivity(), id)); } - @SuppressLint("SetTextI18n") + private void setMovieInfo(MovieInfo movie) { this.movie = movie; @@ -154,6 +176,7 @@ public class DetailFragment extends Fragment implements View.OnClickListener overview.setText(movie.getOverview()); release.setText(movie.getReleaseDate()); rating.setText(movie.getRating() + getString(R.string.out_of_ten)); + runtime.setText(movie.getRunTime() + getString(R.string.runtime_unit)); title.setText(movie.getTitle()); if(MovieUtil.isFavorite(getActivity(), movie.getId())) { @@ -163,17 +186,61 @@ public class DetailFragment extends Fragment implements View.OnClickListener favoriteIcon.setImageBitmap(BitmapFactory.decodeResource(getResources(), R.drawable.star_not_favorite)); } + + trailerList.removeAllViews(); + if(movie.getTrailers() != null && movie.getTrailers().length > 0) { + final String[] trailers = movie.getTrailers(); + for(int i = 0; i < trailers.length; i++) { + View view = getLayoutInflater(null).inflate(R.layout.trailer_layout, null); + TextView trailerText = (TextView)view.findViewById(R.id.trailerText); + trailerText.setText("Trailer " + (i+1)); + view.setOnClickListener(new TrailerClickListener(trailers[i])); + trailerList.addView(view); + } + setShareMovieTrailerIntent(trailers[0]); + } + + reviews.removeAllViews(); + if(movie.getReviews() != null && movie.getReviews().length > 0) { + reviewHeader.setVisibility(View.VISIBLE); + for(int i = 0; i < movie.getReviews().length; i++) { + TextView view = + (TextView)getLayoutInflater(null).inflate(R.layout.review_layout, null); + view.setText(movie.getReviews()[i]); + reviews.addView(view); + + View divider = new View(getActivity()); + LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( + LinearLayout.LayoutParams.MATCH_PARENT, 1); + int px = (int) TypedValue.applyDimension( + TypedValue.COMPLEX_UNIT_DIP, 5, getResources().getDisplayMetrics()); + params.setMargins(0, px, 0, px); + divider.setLayoutParams(params); + divider.setBackgroundColor(getResources().getColor(R.color.dividerColor)); + reviews.addView(divider); + } + } } } + private void setShareMovieTrailerIntent(String trailer) { + if(shareActionProvider == null) + return; + Intent shareTrailerIntent = new Intent(Intent.ACTION_SEND); + shareTrailerIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); + shareTrailerIntent.setType("text/plain"); + shareTrailerIntent.putExtra(Intent.EXTRA_TEXT, trailer); + shareActionProvider.setShareIntent(shareTrailerIntent); + } + @Override public void onClick(View v) { if(v == favoriteButton) { - if(movie.id > 0) { - if(MovieUtil.isFavorite(getActivity(), movie.id)) { - setFavorite(movie.id, false); + if(movie.getId() > 0) { + if(MovieUtil.isFavorite(getActivity(), movie.getId())) { + setFavorite(movie.getId(), false); } else { - setFavorite(movie.id, true); + setFavorite(movie.getId(), true); } } } @@ -192,4 +259,19 @@ public class DetailFragment extends Fragment implements View.OnClickListener favorite ? R.drawable.star_favorite : R.drawable.star_not_favorite); favoriteIcon.setImageBitmap(favIcon); } + + private class TrailerClickListener implements View.OnClickListener { + private final String trailer; + + public TrailerClickListener(String trailer) { + this.trailer = trailer; + } + + @Override + public void onClick(View v) { + Log.d(LOG_TAG, "SHOWING TRAILER: " + trailer); + Intent trailerIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(trailer)); + startActivity(trailerIntent); + } + } } diff --git a/app/src/main/java/com/example/android/popularmovies/DiscoverTask.java b/app/src/main/java/com/example/android/popularmovies/DiscoverTask.java index f549478..efc7f95 100644 --- a/app/src/main/java/com/example/android/popularmovies/DiscoverTask.java +++ b/app/src/main/java/com/example/android/popularmovies/DiscoverTask.java @@ -93,7 +93,9 @@ public class DiscoverTask extends AsyncTask for(int i = 0; i < results.length(); i++) { Long id = results.getJSONObject(i).getLong("id"); + //Use the 'FromNet' version of GetMovie so we can update any relevant info as well. + //It'll; also grab the reviews and video links for us. MovieInfo movie = MovieUtil.getMovieFromNet(mContext, id); if(movie == null) { Log.w(LOG_TAG, "NULL MOVIE: " + id); diff --git a/app/src/main/java/com/example/android/popularmovies/MovieInfo.java b/app/src/main/java/com/example/android/popularmovies/MovieInfo.java index c17ce71..5dcbf26 100644 --- a/app/src/main/java/com/example/android/popularmovies/MovieInfo.java +++ b/app/src/main/java/com/example/android/popularmovies/MovieInfo.java @@ -12,21 +12,21 @@ public class MovieInfo implements Comparable @SuppressWarnings("unused") private static final String LOG_TAG = MovieInfo.class.getSimpleName(); - public long id; - public String title; - public String overview; - public Bitmap poster; - public String releaseDate; - public String posterPath; - public int runTime; - public int vote_count; - public double rating; - public double popularity; - public String[] genres; + private long id; + private String title; + private String overview; + private Bitmap poster; + private String releaseDate; + private String posterPath; + private int runTime; + private int vote_count; + private double rating; + private double popularity; + private String[] genres; + private String[] trailers; + private String[] reviews; - private MovieInfo() - { - } + private MovieInfo(){} public static MovieBuilder buildMovie() { return new MovieBuilder(); @@ -47,7 +47,7 @@ public class MovieInfo implements Comparable } public boolean isValid() { - return movie.id >= 0 && !(movie.title == null || movie.title.isEmpty()); + return movie.getId() >= 0 && !(movie.getTitle() == null || movie.getTitle().isEmpty()); } public MovieBuilder withId(Long id) { @@ -110,21 +110,33 @@ public class MovieInfo implements Comparable movie.posterPath = path; return this; } + + public MovieBuilder withTrailers(String[] trailerList) + { + movie.trailers = trailerList; + return this; + } + + public MovieBuilder withReviews(String[] reviews) + { + movie.reviews = reviews; + return this; + } } @Override public int compareTo(@NonNull MovieInfo other) { - if(this.rating < other.rating) { + if(this.getRating() < other.getRating()) { return 1; } - else if(this.rating > other.rating) { + else if(this.getRating() > other.getRating()) { return -1; } else { - if(this.vote_count < other.vote_count) { + if(this.getVoteCount() < other.getVoteCount()) { return 1; - } else if (this.vote_count > other.vote_count) { + } else if (this.getVoteCount() > other.getVoteCount()) { return -1; } else { return 0; @@ -134,7 +146,7 @@ public class MovieInfo implements Comparable public void applyPoster(ImageView view) { - view.setImageBitmap(poster); + view.setImageBitmap(getPoster()); } public Long getId() { return id; } @@ -173,6 +185,10 @@ public class MovieInfo implements Comparable return genres; } + public String[] getReviews() { return reviews; } + + public String[] getTrailers() { return trailers; } + public static class MalformedMovieException extends RuntimeException { public MalformedMovieException(String message) { super(message); diff --git a/app/src/main/java/com/example/android/popularmovies/data/MovieContract.java b/app/src/main/java/com/example/android/popularmovies/data/MovieContract.java index 5437e34..5523385 100644 --- a/app/src/main/java/com/example/android/popularmovies/data/MovieContract.java +++ b/app/src/main/java/com/example/android/popularmovies/data/MovieContract.java @@ -37,6 +37,8 @@ public class MovieContract { public static final String COLUMN_VOTE_CNT = "vote_count"; public static final String COLUMN_RATING = "rating"; public static final String COLUMN_GENRES = "genres"; + public static final String COLUMN_TRAILERS = "trailers"; + public static final String COLUMN_REVIEWS = "reviews"; public static Uri buildMovieUriWithId(long tmdb_id) { return ContentUris.withAppendedId(CONTENT_URI, tmdb_id); diff --git a/app/src/main/java/com/example/android/popularmovies/data/MovieDbHelper.java b/app/src/main/java/com/example/android/popularmovies/data/MovieDbHelper.java index 34387b3..5719b57 100644 --- a/app/src/main/java/com/example/android/popularmovies/data/MovieDbHelper.java +++ b/app/src/main/java/com/example/android/popularmovies/data/MovieDbHelper.java @@ -31,13 +31,29 @@ public class MovieDbHelper extends SQLiteOpenHelper { MovieEntry.COLUMN_FAVORITE + " INTEGER NOT NULL DEFAULT 0," + MovieEntry.COLUMN_VOTE_CNT + " INTEGER NOT NULL," + MovieEntry.COLUMN_RATING + " REAL NOT NULL," + - MovieEntry.COLUMN_GENRES + " TEXT NOT NULL" + + MovieEntry.COLUMN_GENRES + " TEXT NOT NULL," + + MovieEntry.COLUMN_REVIEWS + " TEXT," + + MovieEntry.COLUMN_TRAILERS + " TEXT" + " );"; sqLiteDatabase.execSQL(SQL_CREATE_MOVIES_TABLE); } @Override public void onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) { - //No upgrade because no public version of the app has been released + //No upgrade because no public version of the app has been released, and no updated db + if(oldVersion < 2) { + final String ADD_FAVORITES = "ALTER TABLE " + MovieEntry.TABLE_NAME + " ADD COLUMN " + + MovieEntry.COLUMN_FAVORITE + " INT NOT NULL DEFAULT 0"; + sqLiteDatabase.execSQL(ADD_FAVORITES); + } + if(oldVersion < 3) { + final String ADD_REVIEWS = "ALTER TABLE " + MovieEntry.TABLE_NAME + " ADD COLUMN " + + MovieEntry.COLUMN_REVIEWS + " TEXT"; + sqLiteDatabase.execSQL(ADD_REVIEWS); + + final String ADD_TRAILERS = "ATLER TABLE " + MovieEntry.TABLE_NAME + " ADD COLUMN " + + MovieEntry.COLUMN_TRAILERS + " TEXT"; + sqLiteDatabase.execSQL(ADD_TRAILERS); + } } } \ No newline at end of file diff --git a/app/src/main/java/com/example/android/popularmovies/data/MovieUtil.java b/app/src/main/java/com/example/android/popularmovies/data/MovieUtil.java index c7861b3..d6d841e 100644 --- a/app/src/main/java/com/example/android/popularmovies/data/MovieUtil.java +++ b/app/src/main/java/com/example/android/popularmovies/data/MovieUtil.java @@ -5,6 +5,7 @@ import android.content.Context; import android.database.Cursor; import android.graphics.Bitmap; import android.graphics.BitmapFactory; +import android.net.Uri; import android.os.Looper; import android.support.annotation.NonNull; import android.util.Log; @@ -41,7 +42,9 @@ public final class MovieUtil MovieContract.MovieEntry.COLUMN_POPULARITY, MovieContract.MovieEntry.COLUMN_VOTE_CNT, MovieContract.MovieEntry.COLUMN_GENRES, - MovieContract.MovieEntry.COLUMN_FAVORITE + MovieContract.MovieEntry.COLUMN_FAVORITE, + MovieContract.MovieEntry.COLUMN_TRAILERS, + MovieContract.MovieEntry.COLUMN_REVIEWS }; @SuppressWarnings("all") private static final int TITLE = 0; @@ -54,6 +57,8 @@ public final class MovieUtil @SuppressWarnings("all") private static final int VOTE_COUNT = 7; @SuppressWarnings("all") private static final int GENRES = 8; @SuppressWarnings("all") private static final int FAVORITE = 9; + @SuppressWarnings("all") private static final int TRAILERS = 10; + @SuppressWarnings("all") private static final int REVIEWS = 11; public static MovieInfo getMovie(@NonNull Context context, Long movieID) { @@ -90,7 +95,9 @@ public final class MovieUtil .withPopularity(cursor.getDouble(POPULARITY)) .withRating(cursor.getDouble(RATING)) .withVoteCount(cursor.getInt(VOTE_COUNT)) - .withGenres(parseGenres(cursor.getString(GENRES))).build(); + .withGenres(convertStringToArray(cursor.getString(GENRES))) + .withReviews(convertStringToArray(cursor.getString(REVIEWS))) + .withTrailers(convertStringToArray(cursor.getString(TRAILERS))).build(); cursor.close(); return movie; } @@ -131,14 +138,20 @@ public final class MovieUtil */ public static MovieInfo getMovieFromNet(Context context, Long id) { - String url = TMDB_URL_BASE+"/movie/"+id +"?api_key="+API_KEY; - String movieJSON = NetworkUtil.getURL(url); - if(movieJSON == null || movieJSON.isEmpty()) { - Log.w(LOG_TAG, "Unable to fetch movie from network! TMDB ID: " + id); - return null; - } + Uri movieURI = Uri.parse(TMDB_URL_BASE).buildUpon() + .appendPath("movie") + .appendPath(Long.toString(id)) + .appendQueryParameter("api_key", API_KEY) + .appendQueryParameter("append_to_response", "reviews,videos").build(); + String movieJSON = null; try { + movieJSON = NetworkUtil.getURL(movieURI.toString()); + if(movieJSON == null || movieJSON.isEmpty()) { + Log.w(LOG_TAG, "Unable to fetch movie from network! TMDB ID: " + id); + return null; + } + JSONObject movieObject = new JSONObject(movieJSON); JSONArray genreList = movieObject.getJSONArray("genres"); String[] genres = new String[genreList.length()]; @@ -149,6 +162,8 @@ public final class MovieUtil String posterPath = movieObject.getString("poster_path"); String releaseDate = movieObject.getString("release_date"); + System.out.println("MOVIE JSON: " + movieJSON); + //Individual Tries for Malformed Movies int runTime = 0; int votes = 0; @@ -176,6 +191,41 @@ public final class MovieUtil Log.e(LOG_TAG, "Unable To Get MovieInfo Poster: " + ex.getMessage(), ex); } + //GetReviews + String[] reviews = null; + JSONObject reviewObject = movieObject.getJSONObject("reviews"); + try { + JSONArray reviewList = reviewObject.getJSONArray("results"); + if (reviewList.length() > 0) { + reviews = new String[reviewList.length() > 3 ? 3 : reviewList.length()]; + for (int i = 0; i < reviewList.length() && i < 3; i++) { + reviews[i] = reviewList.getJSONObject(i).getString("content"); + } + } + } catch (JSONException ex) { + Log.e(LOG_TAG, "Error Retrieving Reviews: " + ex.getMessage(), ex); + Log.e(LOG_TAG, "REVIEW JSON: " + reviewObject.toString()); + } + + //Get Trailers + final String YOUTUBE_BASE_VIDEO_URL = "https://www.youtube.com/watch?v="; + String[] trailers = null; + JSONObject trailerObject = movieObject.getJSONObject("videos"); + try { + JSONArray trailerList = trailerObject.getJSONArray("results"); + if (trailerList.length() > 0) { + trailers = new String[trailerList.length() > 3 ? 3 : trailerList.length()]; + for (int i = 0; i < trailerList.length() && i < 3; i++) { + trailers[i] = + YOUTUBE_BASE_VIDEO_URL + trailerList.getJSONObject(i).getString("key"); + } + } + } catch (JSONException ex) { + Log.e(LOG_TAG, "ERROR GETTING TRAILERS: " + ex.getMessage(), ex); + Log.e(LOG_TAG, "TRAILER JSON: " + trailerObject.toString()); + } + + MovieInfo info = MovieInfo.buildMovie().withId(id) .withTitle(title) .withGenres(genres) @@ -186,7 +236,9 @@ public final class MovieUtil .withRating(vote) .withVoteCount(votes) .withPopularity(popularity) - .withPosterPath(imgPath).build(); + .withPosterPath(imgPath) + .withReviews(reviews) + .withTrailers(trailers).build(); upsertMovie(context, info); //For caching purposes return info; } catch (JSONException ex) { @@ -196,25 +248,27 @@ public final class MovieUtil } } - private static final Character GENRE_DELIMITER = '_'; + public static final String STR_SEPARATOR = "__,__"; - private static String[] parseGenres(String genres) - { - return genres.split(Character.toString(GENRE_DELIMITER)); - } - - private static String encodeGenres(String[] genres) - { + public static String convertArrayToString(String[] array){ + if(array == null) + return null; StringBuilder builder = new StringBuilder(); - for(int i = 0; i < genres.length; i++) - { - builder.append(genres[i]); - if(i != genres.length-1) - builder.append(GENRE_DELIMITER); + for (int i = 0;i requestTimes = new ArrayList<>(); - private static final ArrayList imgRequestTimes = new ArrayList<>(); public static String getURL(String urlString) { - long nano = System.nanoTime(); - String res = getUrlImpl(urlString); - - //Statistics - long time = (System.nanoTime()-nano)/1000000; - requestTimes.add(time); - long avg = 0; - long min = 10000; - long max = -1; - Log.d(LOG_TAG, "REQUEST: " + time + "ms"); - for(Long num : requestTimes) - { - if(num < min) min = num; - if(num > max) max = num; - avg += num; - } - Log.d(LOG_TAG, "AVERAGE TIME: " + ((double)avg/requestTimes.size()) + "ms"); - Log.d(LOG_TAG, "MAX TIME: " + max + "ms"); - Log.d(LOG_TAG, "MIN TIME: " + min + "ms"); - return res; + return getUrlImpl(urlString); } public static Bitmap getImage(String url, Context context, Bitmap defImg) { - long nano = System.nanoTime(); - - //Tests on target device show that the straight HTTPUrlConnection version actually performs - //faster on average than Picasso, and images being stored as an ImageView later means we - //don't quite benefit as much from the image cache to make it worth using. - Bitmap bm = defImageImpl(url, context, defImg); - - long time = (System.nanoTime()-nano)/1000000; - imgRequestTimes.add(time); - long avg = 0; - long min = 10000; - long max = -1; - Log.d(LOG_TAG, "IMAGE REQUEST: " + time + "ms"); - for(Long num : imgRequestTimes) - { - if(num < min) min = num; - if(num > max) max = num; - avg += num; - } - Log.d(LOG_TAG, "AVERAGE TIME: " + ((double)avg/imgRequestTimes.size()) + "ms"); - Log.d(LOG_TAG, "MAX TIME: " + max + "ms"); - Log.d(LOG_TAG, "MIN TIME: " + min + "ms"); - return bm; + return defImageImpl(url, context, defImg); } private static Bitmap defImageImpl(String url, Context context, Bitmap defImg) diff --git a/app/src/main/noimage-web.png b/app/src/main/noimage-web.png deleted file mode 100644 index f27f049..0000000 Binary files a/app/src/main/noimage-web.png and /dev/null differ diff --git a/app/src/main/res/drawable/star_favorite.png b/app/src/main/res/drawable/star_favorite.png new file mode 100644 index 0000000..281598c Binary files /dev/null and b/app/src/main/res/drawable/star_favorite.png differ diff --git a/app/src/main/res/drawable/star_not_favorite.png b/app/src/main/res/drawable/star_not_favorite.png new file mode 100644 index 0000000..a90e770 Binary files /dev/null and b/app/src/main/res/drawable/star_not_favorite.png differ diff --git a/app/src/main/res/drawable/trailer_icon.png b/app/src/main/res/drawable/trailer_icon.png new file mode 100644 index 0000000..a2f86ec Binary files /dev/null and b/app/src/main/res/drawable/trailer_icon.png differ diff --git a/app/src/main/res/layout-land/fragment_detail.xml b/app/src/main/res/layout-land/fragment_detail.xml index 3ce021f..96c2e18 100644 --- a/app/src/main/res/layout-land/fragment_detail.xml +++ b/app/src/main/res/layout-land/fragment_detail.xml @@ -25,50 +25,78 @@ android:layout_height="match_parent" android:background="@color/white" android:clipToPadding="false"> - + - - - - + + + + + - + android:orientation="vertical" /> + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-sw600dp-land/fragment_detail.xml b/app/src/main/res/layout-sw600dp-land/fragment_detail.xml index 2000454..a4fefc8 100644 --- a/app/src/main/res/layout-sw600dp-land/fragment_detail.xml +++ b/app/src/main/res/layout-sw600dp-land/fragment_detail.xml @@ -25,50 +25,79 @@ android:layout_height="match_parent" android:background="@color/white" android:clipToPadding="false"> - - - + - - - - + + + + + + + + - + android:orientation="vertical" /> + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-sw600dp-port/fragment_detail.xml b/app/src/main/res/layout-sw600dp-port/fragment_detail.xml index 0edb105..d3518f3 100644 --- a/app/src/main/res/layout-sw600dp-port/fragment_detail.xml +++ b/app/src/main/res/layout-sw600dp-port/fragment_detail.xml @@ -25,50 +25,77 @@ android:layout_height="match_parent" android:background="@color/white" android:clipToPadding="false"> - - - - - + + + + + + + - + android:orientation="vertical" /> + + + + diff --git a/app/src/main/res/layout-sw600dp/activity_main.xml b/app/src/main/res/layout-sw600dp/activity_main.xml index da11baa..34c729c 100644 --- a/app/src/main/res/layout-sw600dp/activity_main.xml +++ b/app/src/main/res/layout-sw600dp/activity_main.xml @@ -16,6 +16,6 @@ android:background="@color/black" android:layout_width="match_parent" android:layout_height="0dp" - android:layout_weight="2" + android:layout_weight="1" android:elevation="8dp"/> \ No newline at end of file diff --git a/app/src/main/res/layout/detail_text_fields.xml b/app/src/main/res/layout/detail_text_fields.xml index e81f7af..2ccdfbf 100644 --- a/app/src/main/res/layout/detail_text_fields.xml +++ b/app/src/main/res/layout/detail_text_fields.xml @@ -4,45 +4,41 @@ android:layout_width="wrap_content" android:layout_height="wrap_content"> + android:layout_alignParentLeft="true"/> + android:layout_toEndOf="@id/releaseHeader"/> + android:layout_alignLeft="@id/releaseHeader"/> + android:layout_alignTop="@id/ratingHeader"/> + android:layout_alignLeft="@id/ratingHeader"/> + android:layout_alignTop="@id/runtimeHeader"/> \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_detail.xml b/app/src/main/res/layout/fragment_detail.xml index 462f9cd..cdd31f4 100644 --- a/app/src/main/res/layout/fragment_detail.xml +++ b/app/src/main/res/layout/fragment_detail.xml @@ -25,51 +25,80 @@ android:layout_height="match_parent" android:background="@color/white" android:clipToPadding="false"> - - + - - - - - + + + + + + + + - + android:orientation="vertical" /> + + + + diff --git a/app/src/main/res/layout/review_layout.xml b/app/src/main/res/layout/review_layout.xml new file mode 100644 index 0000000..4179024 --- /dev/null +++ b/app/src/main/res/layout/review_layout.xml @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/trailer_layout.xml b/app/src/main/res/layout/trailer_layout.xml new file mode 100644 index 0000000..7a6249e --- /dev/null +++ b/app/src/main/res/layout/trailer_layout.xml @@ -0,0 +1,24 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4108b83..e5996d6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,6 +2,7 @@ Popular Movies Settings Settings + Share Sort_By @@ -14,6 +15,8 @@ Favorites Get More Movies /10 + Reviews + " minutes" Popularity