0% found this document useful (0 votes)
3 views4 pages

Update Naugat 7.0: Gradle 34 to 35

The document provides XML code for a layout using ConstraintLayout, which includes a ProgressBar and a Button. It also contains Kotlin code for MainActivity that manages the visibility of the ProgressBar when the Button is clicked. The Gradle version is to be updated from 34 to 35, and the project is set to use Naugat version 7.0.

Uploaded by

ABCUSER1
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)
3 views4 pages

Update Naugat 7.0: Gradle 34 to 35

The document provides XML code for a layout using ConstraintLayout, which includes a ProgressBar and a Button. It also contains Kotlin code for MainActivity that manages the visibility of the ProgressBar when the Button is clicked. The Gradle version is to be updated from 34 to 35, and the project is set to use Naugat version 7.0.

Uploaded by

ABCUSER1
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

Use naugat version 7.

0 and change gradle 34 to 35

1) Xml code

<?xml version="1.0" encoding="utf-8"?>

<[Link]

xmlns:android="[Link]

xmlns:app="[Link]

xmlns:tools="[Link]

android:id="@+id/main"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:background="@color/white"

tools:context=".MainActivity">

<!--on below line we are creating a progress bar-->

<ProgressBar

android:id="@+id/progressBar"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

app:layout_constraintBottom_toTopOf="@+id/button"

app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

app:layout_constraintVertical_chainStyle="packed"/>

<!--on below line we are creating a button-->

<Button

android:id="@+id/button"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_marginTop="32dp"

android:text="Show/Hide"

app:layout_constraintBottom_toBottomOf="parent"

app:layout_constraintEnd_toEndOf="parent"

app:layout_constraintStart_toStartOf="parent"

app:layout_constraintTop_toBottomOf="@+id/progressBar" />

</[Link]>

2) [Link]

package [Link]

import [Link]

import [Link]

import [Link]

import [Link]
import [Link]

class MainActivity : AppCompatActivity()

private lateinit var showProgressBtn: Button

private lateinit var loadingPB: ProgressBar

private var isProgressVisible = false

override fun onCreate(savedInstanceState: Bundle?) {

[Link](savedInstanceState)

setContentView([Link].activity_main)

// initializing our variables.

showProgressBtn = findViewById([Link])

loadingPB = findViewById([Link])

// set visibility off by default

[Link] = [Link]

[Link] {

// checking if progress bar is already visible.

if (isProgressVisible) {

[Link] = [Link]

isProgressVisible = false

}
else {

[Link] = [Link]

isProgressVisible = true

You might also like