package com.example.myapp2.List1; public class Product { private String name; private…
- User
package com.example.myapp_2.List_1;
public class Product { private String name; private String description; private int imageResource; private float rating; private double price;
codepublic Product(String name, String description, int imageResource, float rating, double price) { this.name = name; this.description = description; this.imageResource = imageResource; this.rating = rating; this.price = price; } public Product(String name, String description, int imageResource, double price) { this.name = name; this.description = description; this.imageResource = imageResource; this.rating = 0.0f; this.price = price; } public String getName() { return name; } public String getDescription() { return description; } public int getImageResource() { return imageResource; } public float getRating() { return rating; } public void setRating(float rating) { this.rating = rating; } public double getPrice() { return price; } public void setPrice(double price) { this.price = price; }} package com.example.myapp_2.UI.view.fragments;
import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle;
import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import androidx.viewpager.widget.ViewPager;
import android.os.Environment; import android.os.Handler; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.RatingBar; import android.widget.TextView; import android.widget.Toast;
import com.example.myapp_2.List_1.Product; import com.example.myapp_2.List_1.ProductAdapter; import com.example.myapp_2.R; import com.example.myapp_2.UI.view.adapters.SliderAdapter;
import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.List;
- Assistant
- User
как называется мой адаптер?
- Assistant
В коде, который вы предоставили, ваш адаптер называется
ProductAdapter. Это класс, который наследуется отRecyclerView.Adapterи используется для заполнения данных в элементах списка для RecyclerView.