Advertisement
yo2man

XML stuff design weather app UI

Jul 9th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.66 KB | None | 0 0
  1. // Implementing the UI for Weather App
  2. // We are successfully requesting data from the Web and
  3. // parsing it into a custom data model.
  4. // Well done.
  5. // Now we just need to create our layout and feed it data from our custom class.
  6.  
  7.  
  8. // oh noes the degree image doesn't line up at all!?
  9. // actually it does, it just doesn't look at it in the preview.
  10. // important lesson: always run the emulator and don't depend on the image preview
  11.  
  12. // to insert image >insert ImageView in design mode. Go to "src" the properties sidebar> click the [...] thingy > scroll down and proceed to find the right image under drawable folder in project tab. simple.
  13.  
  14. https://teamtreehouse.com/library/build-a-weather-app/building-the-weather-ui/starting-at-the-center
  15.  
  16.  
  17.  
  18.  
  19. //-----------------------------------------------------------------------------------
  20.  
  21. Styles.xml
  22.  
  23. <resources>
  24.  
  25.     <!-- Base application theme. -->
  26.     <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> // Choose an theme (real) for your app that will appear on phone
  27.         <!-- Customize your theme here. -->
  28.     </style>
  29.  
  30. </resources>
  31.  
  32. // https://teamtreehouse.com/library/build-a-weather-app/building-the-weather-ui/adding-the-upper-half
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. // Now, before we make any changes, I just want to let you know about an important
  41. // point that we always need to remember when working with layout weight.
  42. // For the items that we want to balance using layout weight we need to
  43. // set the layout width of them to either wrap content or
  44. // even zero to let Android calculate the appropriate widths.
  45. // If we forget to do this we can run into annoying issues that are hard
  46. // to troubleshoot.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement