package com.prank.app.color.activity;


import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;

import com.prank.app.color.App;
import com.prank.app.color.databinding.ActivityHomeBinding;
import com.prank.app.color.list.AdapterHome;
import com.prank.app.color.utils.Common;
import com.prank.app.color.utils.ItemDecoration;

public class ActivityHome extends AppCompatActivity {

    private ActivityHomeBinding activityMainBinding;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        activityMainBinding = ActivityHomeBinding.inflate(getLayoutInflater());
        setContentView(activityMainBinding.getRoot());
        Common.setStatusBarTextColor(this, true);


        ItemDecoration itemHelper = new ItemDecoration(10, 10, 0);
        activityMainBinding.recyclerView.addItemDecoration(itemHelper);
        activityMainBinding.recyclerView.setLayoutManager(new GridLayoutManager(this, 2));
        activityMainBinding.recyclerView.setAdapter(new AdapterHome(this, App.bean));
        initClick();



    }

    private void initClick(){
        activityMainBinding.rlRecord.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(ActivityHome.this, ActivityImport.class);
                startActivity(intent);
            }
        });
        activityMainBinding.rlLike.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(ActivityHome.this, ActivityLike.class);
                startActivity(intent);
            }
        });
    }

}