Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Floating Action Button and Image View Lab Sheet for B.Tech Students at VIT-AP University, Schemes and Mind Maps of Mobile Computing

The code for implementing floating action buttons and image views in an Android app developed by VIT-AP University students. XML layout files for the main activity and the floating action buttons, as well as Java code for handling button clicks and controlling their visibility. The app allows users to scale one image big and the other small, and vice versa, using animation.

Typology: Schemes and Mind Maps

2019/2020

Uploaded on 11/16/2022

dna-barath
dna-barath 🇮🇳

5 documents

1 / 10

Toggle sidebar

Related documents


Partial preview of the text

Download Floating Action Button and Image View Lab Sheet for B.Tech Students at VIT-AP University and more Schemes and Mind Maps Mobile Computing in PDF only on Docsity! VIT-AP UNIVERSITY, ANDHRA PRADESH Lab Sheet 5 (FLOATING BUTTON & IMAGE VIEW) Date: 08-10-2022 Academic year: 2022-2023 Faculty Name: Dr.Anupama Mam Branch:B.Tech School: SCOPE Semester: Fall NAME:BARATH KUMAR V REGNO: 20BCR7107 ************************************************************************************************ Floating Animation Button : Code : 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" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/fab1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="32dp" android:layout_marginBottom="116dp" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:srcCompat="@android:drawable/ic_input_add" /> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/fab2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="41dp" android:layout_marginEnd="52dp" app:layout_constraintEnd_toStartOf="@+id/fab1" app:layout_constraintTop_toBottomOf="@+id/fab3" app:srcCompat="@drawable/ic_launcher_background" /> <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/fab3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="16dp" android:layout_marginBottom="24dp" app:layout_constraintBottom_toTopOf="@+id/fab1" After clicking the floating button . It will open the hidden floating buttons and Toast the message After clicking the (+) Button it will be restored Design an app to scale one image big and one image small and vice versa Code : 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" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="254dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/ic_launcher_foreground" tools:srcCompat="@tools:sample/avatars" /> <ImageView android:id="@+id/imageView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="85dp" android:layout_marginEnd="1dp" app:layout_constraintEnd_toEndOf="@+id/imageView" app:layout_constraintTop_toBottomOf="@+id/imageView" app:srcCompat="@android:drawable/btn_dialog" tools:srcCompat="@tools:sample/avatars" /> </androidx.constraintlayout.widget.ConstraintLayout> Scale.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <scale xmlns:android="http://schemas.android.com/apk/res/android" android:fromXScale="0.5" android:toXScale= "3.0" android:fromYScale="0.5" android:toYScale="3.0" android:duration="5000" android:pivotX="50%" android:pivotY="50%" android:repeatCount="10"> </scale> </set>
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved