Advertisement
Guest User

Untitled

a guest
Apr 15th, 2021
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 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. // Add the current savings percent to the widget
  39. t = rightStack.addText("SavingsPercent")
  40. t.rightAlignText()
  41. t.textColor = Color.white()
  42. t.font = new Font("San-Fransisco",12)
  43. // w.addSpacer(5)
  44.  
  45. // Add the current savings title to the widget
  46. t = rightStack.addText("SavingsAmountTitle")
  47. t.rightAlignText()
  48. t.textColor = Color.white()
  49. t.font = new Font("San-Fransisco",15)
  50.  
  51. // Add the current savings to the widget
  52. t = rightStack.addText("SavingsAmount")
  53. t.rightAlignText()
  54. t.textColor = Color.white()
  55. t.font = new Font("San-Fransisco",12)
  56.  
  57. //moves everything to the top
  58. w.addSpacer()
  59.  
  60. w.presentMedium()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement