Giter Site home page Giter Site logo

coloractivity_assignment_3's Introduction

Color Activity Assignment 3

Notes

Implements a lot of what we learned in class but makes some small changes mostly in relation to functions implemented in a spinner view that isn't in a list view. List view typically uses things like onClickListener instead of onItemSelected.

Docstring - MainActivity

@fun onItemSelected(): Changes the background of the view upon selecting an item from the spinner. See comments on ItemsAdapter to see how the custom adapter accepts colors.

@fun onNothingSelected(): setOnItemSelectedListener requires that you implement this or it breaks similarly to how when you extend base adapter you must add and override 4 items requested even though you don't actually ever use getItemID.

@param ((TextView) spinnerView.getSelectedView()): When the item is actually selected, we want to make sure the font is the color the background changes to.

Docstring - ColorAdapter

@fun ColorAdapter(): It takes in three things

  1. context - Context represents (provides a handle to) the application environment. Can be obtained from several sources, but capabilities vary.
  2. colors - Is what will be used to determine the color of the layout in the MainClass and also the font color of the item inside of the TextView
  3. items - The actual string that will be represented in the spinner/textview.

@import Color: Color allows you to pass colors in a variety of ways. In my implementation I use its parseColor function to pass a string that represents a color in hex format.

coloractivity_assignment_3's People

Contributors

flantig avatar

Watchers

James Cloos avatar  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.