Skip to content

Instantly share code, notes, and snippets.

@robillo
Created September 30, 2017 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robillo/71afef65923138ed9d6011e3bd216249 to your computer and use it in GitHub Desktop.
Save robillo/71afef65923138ed9d6011e3bd216249 to your computer and use it in GitHub Desktop.
activity_flash.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/tools"
android:id="@+id/activity_camera"
android:fitsSystemWindows="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
app:popupTheme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:gravity="center"
android:text="Sense It All!"
android:textColor="#FFF"
android:fontFamily="sans-serif-smallcaps"
android:textSize="20sp"
android:layout_weight="1"
android:textStyle="normal|bold" />
</android.support.v7.widget.Toolbar>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"/>
<TextView
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:text="Flash"
android:textColor="@color/colorWhiteShade"
android:background="@color/colorPrimaryDark"
android:textStyle="bold"
android:fontFamily="cursive"
android:gravity="center"
android:textSize="20sp"
android:layout_marginTop="20sp"
android:layout_marginStart="15sp"
android:layout_marginEnd="15sp">
</TextView>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:layout_margin="5sp"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardElevation="@dimen/app_bar_elevation"
app:cardCornerRadius="10sp"
android:layout_margin="10sp"
android:layout_below="@+id/ll"
android:id="@+id/card">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="0sp"
android:layout_weight="2"
android:layout_gravity="center"
android:src="@drawable/flashlight"
android:padding="15sp"
android:onClick="onClick"
android:id="@+id/flashlight"
android:background="@color/colorBlackShade"/>
<TextView
android:layout_width="match_parent"
android:layout_height="0sp"
android:layout_weight="1"
android:padding="10sp"
android:fontFamily="sans-serif-smallcaps"
android:text="Click The Button To Turn ON/OFF The Flash"
android:textSize="15sp"
android:textColor="@color/colorPrimaryDark"
android:gravity="center"/>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment