Skip to content

Commit

Permalink
Added cardview and movies class
Browse files Browse the repository at this point in the history
  • Loading branch information
RohanBh committed Jan 31, 2017
1 parent e49f164 commit 3005cb4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ dependencies {
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:cardview-v7:25.1.1'
}
13 changes: 13 additions & 0 deletions app/src/main/java/com/sdsmdg/hareshkh/lectureassignment/Utils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sdsmdg.hareshkh.lectureassignment;

import android.graphics.Bitmap;

public class Utils {

public static Bitmap scaleToFitWidth(Bitmap b, int width)
{
float factor = width / (float) b.getWidth();
return Bitmap.createScaledBitmap(b, width, (int) (b.getHeight() * factor), true);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.sdsmdg.hareshkh.lectureassignment;

public class movies {

String title;
String year;
String imageResId;

public movies(String title, String year, String imageResId) {
this.title = title;
this.year = year;
this.imageResId = imageResId;
}

public String getYear() {
return year;
}

public void setYear(String year) {
this.year = year;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getImageResId() {
return imageResId;
}

public void setImageResId(String imageResId) {
this.imageResId = imageResId;
}
}
12 changes: 4 additions & 8 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.sdsmdg.hareshkh.lectureassignment.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Good luck with your assignments" />
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
9 changes: 9 additions & 0 deletions app/src/main/res/layout/row_layout.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

0 comments on commit 3005cb4

Please sign in to comment.