Make many views do the work of one

I’m continuing to work on a flashcard app with a view I call “D to W” (definition to word). “D to W” appears to the viewer as one primary view (that is, a view on the bottom menu) but, depending on the circumstances, takes the user to one of the following three views:

  1. A deck view of vocabulary cards to study. This is a slice, the contents of which vary from day to day and decrease as the user continues to study. It can empty for one of two reasons – hence the need for the other two views.

  2. A detail view that is displayed after all of the cards in the deck view have been completed.

  3. A detail view that is displayed when the deck is empty from the outset because the user has not added enough cards.

To the user, the app seems to function as follows:

2X_e_eaf7cae02a86b8d952d107d680436de1c0056976.png

Though it looks to the user like the contents of one view change depending on the situation, what is really happening is that one of the following three views is appearing in the same position on the bottom menu:

You can’t actually give different views the same name (they need to have unique names within the editor) but you can use the “Display name” to make it appear that each view has the same name.

Then the expression in the “Show if” slot governs when each view will be shown.

2X_8_8f06eb871a1338ef4684a7a7cca2e62051c29c6c.png

If there is no overlap between the conditions, the effect is that the menu appears to be stable while the contents change.

Sometimes things aren’t quite what they seem to be.

2X_c_cd9bc09230288e6b06687accb22ba80cac0b41cc.gif

12 0 688
0 REPLIES 0
Top Labels in this Space