Giter Site home page Giter Site logo

android_layouts's Introduction

Android_Layouts

This project will help you practice the skills and concepts you learned related to layouts in Android. For this project you'll build a single page app that will display static content (content that is hard coded and doesn't change). This content will consist of an image and a dozen or so components. Use a combination of all the Viewgroups that we discussed to layout the page in a way that you see fit.

You can use a personal bio for your source of data or use an entry from a publicly available dataset.
Some examples include:

Create an Android Studio Project

  1. Create a new Android project
  2. Name the project "Layouts"

Add UI Elements to activity_main.xml

  1. Select half a dozen pieces of data from your entry.
  2. Save an image from your entry to your app's app\src\main\res\drawable directory.
  3. Decide how you want your data to be arranged and what will go in your scrollview.

Keep in mind the aspect ratio of your image and other images from your dataset when deciding

  1. Open the app's activity_main.xml file.
  2. Add components for each of the pieces of data you have selected. As well as components for labels as necessary
  3. Fill in the data from your entry.

Hints

  • A scroll view can only have one child, but that child can have as many children as you want.
    • You can nest view groups to make multiple components behave as one to the parent group.
  • Image Views can be tricky be sure to include the following attributes to make things easier for you.
    • android:src="@drawable/FILENAME_WITHOUTEXTENSION" - use this to add your image, if the image is in the right place, intellisense will suggest the name to you.
    • android:scaleType="fit" - use this to set how your image should scale, play with the suggested options.
    • android:adjustViewBounds="true" - this will prevent white space around your image.

Build, Run, and Test Your App

  1. Build and run your app using your preferred testing environment.
  2. Enter various words, including those you know are in your synonyms directory, and others that aren't into the text field and make sure the synonym listing works.

Bonus

If you finish and want another challenge, add the data from your entry programatically.

Hints

  • be sure to add ids to all the components you wish to change programatically
  • use the code COMPONENT.setImageBitmap(BitmapFactory.decodeResource(context.getResources(),R.drawable.FILENAME_WITHOUTEXTENSION));
    • This will pull an image file from your drawables directory, decode it to a bitmap image and display it in your GUI where your imageview component is.

android_layouts's People

Contributors

chancepayne avatar

Watchers

 avatar

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.