0% found this document useful (0 votes)
9 views3 pages

Demo5 Layout

The document contains an XML layout for an Android application with a ConstraintLayout that includes buttons for writing and reading from internal and external storage, as well as a placeholder ImageView. It also defines a drawable shape for button backgrounds with rounded corners and a gradient color. Additionally, it includes a resources file defining various color values used in the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

Demo5 Layout

The document contains an XML layout for an Android application with a ConstraintLayout that includes buttons for writing and reading from internal and external storage, as well as a placeholder ImageView. It also defines a drawable shape for button backgrounds with rounded corners and a gradient color. Additionally, it includes a resources file defining various color values used in the application.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Activity_main.

xml
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp"
tools:context=".MainActivity">

<Button
android:id="@+id/btnwriteIS"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:background="@drawable/buttonround"
android:text="write internal storage"
app:backgroundTint="@null"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />

<Button
android:id="@+id/btnreadIS"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="23dp"
android:background="@drawable/buttonround"
android:text="read internal storage"
android:textColor="#FFFFFF"
app:backgroundTint="@null"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnwriteIS" />

<Button
android:id="@+id/btnwriteFC"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="23dp"
android:background="@drawable/buttonround"
android:text="write cache file"
app:backgroundTint="@null"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnreadIS" />

<Button

android:id="@+id/btnreadFC"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="23dp"
android:background="@drawable/buttonround"
app:backgroundTint="@null"
android:text="read cache file"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnwriteFC" />

<ImageView
android:id="@+id/imageView"
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginTop="40dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/images" />

<Button
android:id="@+id/btnwriteES"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:background="@drawable/buttonround"
android:text="write external storage"
app:backgroundTint="@null"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnreadFC" />

<Button
android:id="@+id/btnreadES"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="read external storage"
android:background="@drawable/buttonround"
app:backgroundTint="@null"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnwriteES" />
</androidx.constraintlayout.widget.ConstraintLayout>

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


<shape xmlns:android="http://schemas.android.com/apk/res/android">

<corners android:radius="50dp"/>
<gradient android:startColor="#E91E63"
android:endColor="@color/purple_200"
android:angle="@integer/material_motion_duration_medium_1"
/>
</shape>

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


<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>

You might also like