Commits
Claus Rasmussen authored 9a4002bfb24
1 1 | /* |
2 2 | * The MIT License |
3 3 | * |
4 4 | * Original work sponsored and donated by The Danish Health Data Authority (http://www.sundhedsdatastyrelsen.dk) |
5 5 | * |
6 - | * Copyright (C) 2021 The Danish Health Data Authority (http://www.sundhedsdatastyrelsen.dk) |
6 + | * Copyright (C) 2021-2023 The Danish Health Data Authority (http://www.sundhedsdatastyrelsen.dk) |
7 7 | * |
8 8 | * |
9 9 | * Permission is hereby granted, free of charge, to any person obtaining a copy of |
10 10 | * this software and associated documentation files (the "Software"), to deal in |
11 11 | * the Software without restriction, including without limitation the rights to |
12 12 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies |
13 13 | * of the Software, and to permit persons to whom the Software is furnished to do |
14 14 | * so, subject to the following conditions: |
15 15 | * |
16 16 | * |
132 132 | when (it) { |
133 133 | is OverviewPregnancyState.ActiveAndGaveBirth, |
134 134 | is OverviewPregnancyState.ActiveAndWaitingForBirth, |
135 135 | OverviewPregnancyState.None, |
136 136 | -> { |
137 137 | binding.backgroundLayout.setBackgroundResource(R.drawable.ic_bg_circles_01) |
138 138 | binding.pregnancyStatusWidget.visibility = View.VISIBLE |
139 139 | |
140 140 | binding.pregnancyStatusWidget.updateWith(it) |
141 141 | } |
142 + | |
142 143 | is OverviewPregnancyState.PregnancyEnded -> { |
143 144 | binding.backgroundLayout.background = null |
144 145 | binding.pregnancyStatusWidget.visibility = View.GONE |
145 146 | } |
146 147 | } |
147 148 | } |
148 149 | |
149 150 | vm.updateContentListener.observe(viewLifecycleOwner) { |
150 151 | // This LiveData job updates the state of the pregnancy, but needs to be observed to work. |
151 152 | } |