Gitlab@Informatics

Skip to content
Snippets Groups Projects
Select Git revision
  • eba1a2de3e0ece8cc278886d2fe19ff11c6fc365
  • master default protected
2 results

fragment_start.xml

Blame
  • fragment_start.xml 3.75 KiB
    <?xml version="1.0" encoding="utf-8"?>
    <!--
         Copyright (C) 2020 The Android Open Source Project
    
         Licensed under the Apache License, Version 2.0 (the "License");
         you may not use this file except in compliance with the License.
         You may obtain a copy of the License at
    
              http://www.apache.org/licenses/LICENSE-2.0
    
         Unless required by applicable law or agreed to in writing, software
         distributed under the License is distributed on an "AS IS" BASIS,
         WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
         See the License for the specific language governing permissions and
         limitations under the License.
    -->
    <!-- Layout for starting a new order -->
    <layout 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"
        tools:context=".StartFragment">
    
        <data>
            <variable
                name="startFragment"
                type="com.example.cupcake.StartFragment" />
        </data>
    
        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
    
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:padding="@dimen/side_margin">
    
                <ImageView
                    android:layout_width="@dimen/image_size"
                    android:layout_height="@dimen/image_size"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="@dimen/margin_between_elements"
                    android:importantForAccessibility="no"
                    android:scaleType="center"
                    app:srcCompat="@drawable/cupcake" />
    
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginBottom="@dimen/side_margin"
                    android:text="@string/order_cupcakes"
                    android:textAppearance="?attr/textAppearanceHeadline4"
                    android:textColor="@color/material_on_background_emphasis_medium" />
    
                <Button
                    android:id="@+id/order_one_cupcake"
                    android:onClick="@{() -> startFragment.orderCupcake(1)}"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="@dimen/margin_between_elements"
                    android:minWidth="@dimen/order_cupcake_button_width"
                    android:text="@string/one_cupcake" />
    
                <Button
                    android:id="@+id/order_six_cupcakes"
                    android:onClick="@{() -> startFragment.orderCupcake(6)}"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="@dimen/margin_between_elements"
                    android:minWidth="@dimen/order_cupcake_button_width"
                    android:text="@string/six_cupcakes" />
    
                <Button
                    android:id="@+id/order_twelve_cupcakes"
                    android:onClick="@{() -> startFragment.orderCupcake(12)}"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_marginTop="@dimen/margin_between_elements"
                    android:minWidth="@dimen/order_cupcake_button_width"
                    android:text="@string/twelve_cupcakes" />
            </LinearLayout>
        </ScrollView>
    </layout>