Skip to content

Instantly share code, notes, and snippets.

View danielmalone's full-sized avatar

DJ Malone danielmalone

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/activity_main">
[
{
"name": "Black Dress Shoes",
"photo_url": "https://finepointmobile.com/data/jeans1.jpg",
"description": "This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? ",
"price": 200,
"isOnSale": true
},
{
"name": "Black Shirt",
[
{
"name": "Black Skirt",
"photo_url": "https://finepointmobile.com/data/jeans1.jpg",
"description": "This is a cool pair of jeans.",
"price": 29.49,
"isOnSale": true
},
{
"name": "Black Shirt",
[
{
"name": "Daniel's favorite pair of socks",
"photo_url": "https://finepointmobile.com/data/jeans1.jpg",
"description": "This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? This is a nice description. got it? ",
"price": 29.49,
"isOnSale": true
}
]
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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="wrap_content"
android:padding="32dp">
<TextView
android:id="@+id/firstName"
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/firstName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
package com.example.recyclerviewpart1
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
class FriendsAdapter : RecyclerView.Adapter<FriendsAdapter.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
}
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".MainActivity"
tools:showIn="@layout/activity_main">
package com.example.recyclerviewpart1
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
package com.example.recyclerviewpart1
data class Friend(
val firstName: String,
val lastName: String,
val website: String
)