Skip to content

Commit

Permalink
List row view and TV show Dao file is created
Browse files Browse the repository at this point in the history
  • Loading branch information
sghadge1 committed Jun 24, 2019
1 parent 01de783 commit 466e6f8
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .idea/render.experimental.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.volley:volley:1.1.1'
}
5 changes: 5 additions & 0 deletions app/src/main/java/com/example/awarex/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.os.Bundle;

import com.example.awarex.Model.TvShow;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.google.android.material.snackbar.Snackbar;

Expand All @@ -12,8 +13,12 @@
import android.view.Menu;
import android.view.MenuItem;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

private ArrayList<TvShow> tvShows = new ArrayList<>();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down
29 changes: 29 additions & 0 deletions app/src/main/java/com/example/awarex/Model/TvShow.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.example.awarex.Model;

public class TvShow {
public String name, img, air;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getImg() {
return img;
}

public void setImg(String img) {
this.img = img;
}

public String getAir() {
return air;
}

public void setAir(String air) {
this.air = air;
}
}
13 changes: 5 additions & 8 deletions app/src/main/res/layout/content_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
tools:context=".MainActivity"
tools:showIn="@layout/activity_main">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ListView
android:id="@+id/tvShowList"
android:layout_width="match_parent"
android:layout_height="match_parent">
</ListView>

</androidx.constraintlayout.widget.ConstraintLayout>
53 changes: 53 additions & 0 deletions app/src/main/res/layout/tv_show_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView
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"
android:layout_width="match_parent"
android:layout_height="100dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">

<com.android.volley.toolbox.NetworkImageView
android:id="@+id/tvShowImage"
android:layout_width="106dp"
android:layout_height="65dp"
android:layout_marginStart="16dp"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.37" />

<TextView
android:id="@+id/showName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="28dp"
android:layout_marginTop="20dp"
android:text="Messi is best"
android:textSize="22sp"
app:layout_constraintStart_toEndOf="@+id/tvShowImage"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/airingOn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="8dp"
android:text="Argentina"
android:textSize="15sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/showName"
app:layout_constraintTop_toBottomOf="@+id/showName"
app:layout_constraintVertical_bias="0.0" />


</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.cardview.widget.CardView>

0 comments on commit 466e6f8

Please sign in to comment.