0% found this document useful (0 votes)
4 views2 pages

Fa21-Bcs-097 (Lab # 01)

The document is an assignment from Muneeb Ahmad Bhatti, a student in the Computer Science department at COMSATS University Islamabad. It includes a Java code snippet for an Android application that utilizes window insets for proper layout adjustments. Additionally, there is a screenshot included, though its content is not specified in the text.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Fa21-Bcs-097 (Lab # 01)

The document is an assignment from Muneeb Ahmad Bhatti, a student in the Computer Science department at COMSATS University Islamabad. It includes a Java code snippet for an Android application that utilizes window insets for proper layout adjustments. Additionally, there is a screenshot included, though its content is not specified in the text.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

COMSATS UNIVERSITY ISLAMABAD

ASSIGNMENT # A1

 NAME Muneeb Ahmad Bhatti

 CLASS BCS 6B

 REGISTRATON NUMBER FA21-BCS-097

 DEPARTMENT COMPUTER SCIENCE

 COURSE MAD
Code:
package com.example.myapplication;
import android.os.Bundle;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

public class MainActivity extends AppCompatActivity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EdgeToEdge.enable(this);
setContentView(R.layout.activity_main);
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main),
(v, insets) -> {
Insets systemBars =
insets.getInsets(WindowInsetsCompat.Type.systemBars());
v.setPadding(systemBars.left, systemBars.top, systemBars.right,
systemBars.bottom);
return insets;
});
}
}

Screenshot:

You might also like