Skip to content

Instantly share code, notes, and snippets.

Daniel Malone danielmalone

Block or report user

Report or block danielmalone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View shopping_products.json
[
{
"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",
View shopping.json
[
{
"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",
View data.json
[
{
"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
}
]
View friend_row.xml
<?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"
View friend_row.xml
<?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"
View FriendsAdapter.kt
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 {
}
View content_main.xml
<?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">
View MainActivity.kt
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)
View Friend.kt
package com.example.recyclerviewpart1
data class Friend(
val firstName: String,
val lastName: String,
val website: String
)
View MainActivity.kt
package com.example.findviewbyid
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.content_main.*
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
You can’t perform that action at this time.