Giter Club home page Giter Club logo

survey_app_tutorial's Introduction

Jetsurvey sample

Jetsurvey is a sample survey app, built with Jetpack Compose. The goal of the sample is to showcase text input, validation and state capabilities of Compose.

To try out this sample app, use the latest stable version of Android Studio. You can clone this repository or import the project from Android Studio following the steps here.

Screenshots

Features

This sample contains several screens: a welcome screen, where the user can enter their email, sign in and sign up screens and a survey screen. The app has light and dark themes.

App scaffolding

Package com.example.compose.jetsurvey

MainActivity is the application's entry point. Each screen is implemented inside a Fragment and MainActivity is the host Activity for all of the Fragments. The navigation between them uses the Navigation library. The screens and the navigation are defined in Navigation.kt

Sign in/sign up

Package com.example.compose.jetsurvey.signinsignup

This package contains 3 screens:

  • Welcome
  • Sign in
  • Sign up

To get to the sign up screen, enter an email that contains "signup". These screens show how to create different custom composable functions, reused them across multiple screens and handle UI state.

See how to:

  • Use TextFields
  • Implement TextField validation across one TextField (e.g. email validation) and across multiple TextFields (e.g. password confirmation)
  • Use a Snackbar
  • Use different types of Buttons: TextButton, OutlinedButton and Button

Complete a survey

Package com.example.compose.jetsurvey.survey

This screen allows the user to fill out a survey, showing how to handle complex state. UI state is kept and restored on recompositions triggered by different reasons like a configuration change or a new question being displayed on the screen.

See how to:

  • Use RadioButtons - for single item selection
  • Use Checkboxes - for multi-item selection
  • Use Slider - for picking a value from a range
  • Use Scaffold - for screens with top bar, bottom bar and body
  • Display a DialogFragment when requested from compose

Data

The data in the sample is static, held in the *Repository classes.

Setup

The main README has instructions on how to setup this sample, and many others.

License

Copyright 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

    https://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.

survey_app_tutorial's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.