Page 300 - MDP2020-1
P. 300
| 인천전자마이스터고등학교 ·············································································································
294
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0' //recyclerview 사용
implementation 'androidx.cardview:cardview:1.0.0' //cardview 사용
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
(옷데이터 정렬)
package com.example.smartstyler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
public class ClothesAdapter extends RecyclerView.Adapter<ClothesAdapter.ViewHolder>{
private final ArrayList<ClothesData> adapterData;
public ClothesAdapter(ArrayList<ClothesData> getName) {
adapterData = getName;
}
static class ViewHolder extends RecyclerView.ViewHolder {
ImageView imageView;
TextView textView_name;
TextView textView_explaination;
public ViewHolder(@NonNull View itemView) {
super(itemView);
imageView = itemView.findViewById(R.id.imageView);
textView_name = itemView.findViewById(R.id.textView_name);