<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 The Android Open Source Project. ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <com.google.android.material.card.MaterialCardView xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="8dp" app:cardElevation="4dp" app:cardCornerRadius="4dp">
<!-- TODO: 為下列各項建立一個 TextView: The dog's name The dog's age The dog's hobbies --> <TextView android:id="@+id/dog_name" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="Tzeitel" android:textAppearance="?attr/textAppearanceHeadline6" app:layout_constraintTop_toBottomOf="@+id/dog_image" app:layout_constraintStart_toStartOf="parent" android:paddingTop="8dp" android:paddingStart="8dp" />
<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2021 The Android Open Source Project. ~ ~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may not use this file except in compliance with the License. ~ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ ~ Unless required by applicable law or agreed to in writing, software ~ distributed under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for the specific language governing permissions and ~ limitations under the License. --> <com.google.android.material.card.MaterialCardViewxmlns: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:layout_margin="8dp" app:cardCornerRadius="4dp" app:cardElevation="4dp">
<!-- TODO: 為下列各項建立一個 TextView: The dog's name The dog's age The dog's hobbies --> <TextView android:id="@+id/dog_name" android:layout_width="wrap_content" android:layout_height="wrap_content" tools:text="Tzeitel" android:textAppearance="?attr/textAppearanceHeadline6" app:layout_constraintTop_toBottomOf="@+id/dog_image" app:layout_constraintStart_toStartOf="parent" android:paddingTop="8dp" android:paddingStart="8dp" />
/* * Copyright (C) 2021 The Android Open Source Project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.dogglers.adapter
/** * Adapter to inflate the appropriate list item layout and populate the view with information * from the appropriate data source */ classDogCardAdapter( privateval context: Context?, privateval layout: Int ): RecyclerView.Adapter<DogCardAdapter.DogCardViewHolder>() {