the android code  runs in andrpid studio is like this  MainActivity.jav  mainactivity.java import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import java.util.ArrayList; import java.util.List; public class MainActivity extends AppCompatActivity {     private RecyclerView recyclerView;     private List itemList;     private BoxAdapter adapter;     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);         recyclerView = findViewById(R.id.recycler_view);         itemList = new ArrayList<>();         for (int i = 0; i < 36; i++) {             itemList.add(new Object());         }         adapter = new BoxAdapter(itemList);         recyclerView.setAdapter(adapter);         recyclerView.setLayoutManager(new GridLayoutManager(this, 4));     } } ...................................... BoxAdapter.java import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; import java.util.List; public class BoxAdapter extends RecyclerView.Adapter {     private List itemList;     public BoxAdapter(List itemList) {         this.itemList = itemList;     }     @NonNull     @Override     public BoxViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {         View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_box, parent, false);         return new BoxViewHolder(view);     }     @Override     public void onBindViewHolder(@NonNull BoxViewHolder holder, int position) {         // Do nothing     }     @Override     public int getItemCount() {         return itemList.size();     }     static class BoxViewHolder extends RecyclerView.ViewHolder {         public BoxViewHolder(@NonNull View itemView) {             super(itemView);         }     } } ................................ activity_main.xml     ......................................... and it runs like picture 1  how can i change the code ,to make it shows 80*80 square like this

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 the android code  runs in andrpid studio is like this 

MainActivity.jav

 mainactivity.java
import android.os.Bundle;

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

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private RecyclerView recyclerView;
    private List<Object> itemList;
    private BoxAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        recyclerView = findViewById(R.id.recycler_view);

        itemList = new ArrayList<>();
        for (int i = 0; i < 36; i++) {
            itemList.add(new Object());
        }

        adapter = new BoxAdapter(itemList);
        recyclerView.setAdapter(adapter);
        recyclerView.setLayoutManager(new GridLayoutManager(this, 4));
    }
}
......................................
BoxAdapter.java
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import java.util.List;

public class BoxAdapter extends RecyclerView.Adapter<BoxAdapter.BoxViewHolder> {

    private List<Object> itemList;

    public BoxAdapter(List<Object> itemList) {
        this.itemList = itemList;
    }

    @NonNull
    @Override
    public BoxViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_box, parent, false);
        return new BoxViewHolder(view);
    }

    @Override
    public void onBindViewHolder(@NonNull BoxViewHolder holder, int position) {
        // Do nothing
    }

    @Override
    public int getItemCount() {
        return itemList.size();
    }

    static class BoxViewHolder extends RecyclerView.ViewHolder {

        public BoxViewHolder(@NonNull View itemView) {
            super(itemView);
        }
    }
}
................................

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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="match_parent">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
        app:spanCount="4" />

</androidx.constraintlayout.widget.ConstraintLayout>
.........................................
<?xml version="1.0" encoding="utf-8"?>
<View xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:background="@color/purple" />

and it runs like picture 1 

how can i change the code ,to make it shows 80*80 square like this 

 

 

-

 

 

<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/ant
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="10dp"
android:background Tint="@android:color/holo_purple">
<ImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</androidx.cardview.widget. CardView>
androidx.cardview.widget.CardView
9:22
boxapp1
Transcribed Image Text:<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/ant android:layout_width="80dp" android:layout_height="80dp" android:padding="10dp" android:background Tint="@android:color/holo_purple"> <ImageView android:id="@+id/img" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </androidx.cardview.widget. CardView> androidx.cardview.widget.CardView 9:22 boxapp1
車
Transcribed Image Text:
Expert Solution
steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Java
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education