Advertisement
Guest User

Untitled

a guest
Apr 17th, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. // Create the widget
  2. let w = new ListWidget()
  3. w.backgroundColor = new Color("#1A1A1C")
  4. mainStack = w.addStack()
  5. leftStack = mainStack.addStack()
  6. mainStack.addSpacer()
  7. rightStack= mainStack.addStack()
  8. mainStack.layoutHorizontally()
  9. leftStack.layoutVertically()
  10. rightStack.layoutVertically()
  11.  
  12. // Add the start balance title to the widget
  13. t = leftStack.addText("StartBalanceTitle")
  14. t.textColor = Color.white()
  15. t.font = new Font("San-Fransisco",15)
  16.  
  17. // Add the start balance to the widget
  18. t = leftStack.addText("StartBalance")
  19. t.textColor = new Color("#FF3A30")
  20. t.font = new Font("San-Fransisco",12)
  21.  
  22. // Add the current balance title to the widget
  23. t = leftStack.addText("CurrentBalanceTitle")
  24. t.textColor = Color.white()
  25. t.font = new Font("San-Fransisco",15)
  26.  
  27. // Add the current balance to the widget
  28. t = leftStack.addText("CurrentBalance")
  29. t.textColor = new Color("#4CD964")
  30. t.font = new Font("San-Fransisco",12)
  31.  
  32. // Add the current savings perecent title to the widget
  33. t = rightStack.addText("SavingsPercentTitle")
  34. t.rightAlignText()
  35. t.textColor = Color.white()
  36. t.font = new Font("San-Fransisco",15)
  37.  
  38. rightStack.addSpacer(5)
  39.  
  40. // Add the current savings percent to the widget
  41. t = rightStack.addText("SavingsPercent")
  42. t.rightAlignText()
  43. t.textColor = Color.white()
  44. t.font = new Font("San-Fransisco",12)
  45.  
  46. rightStack.addSpacer(20)
  47.  
  48. // Add the current savings title to the widget
  49. t = rightStack.addText("SavingsAmountTitle")
  50. t.rightAlignText()
  51. t.textColor = Color.white()
  52. t.font = new Font("San-Fransisco",15)
  53.  
  54. rightStack.addSpacer(5)
  55.  
  56.  
  57. // Add the current savings to the widget
  58. t = rightStack.addText("SavingsAmount")
  59. t.rightAlignText()
  60. t.textColor = Color.white()
  61. t.font = new Font("San-Fransisco",12)
  62.  
  63. //moves everything to the top
  64. w.addSpacer()
  65.  
  66. w.presentMedium()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement