Finding the type of number entered by the user
Your code has several areas where it can be improved.
The first is that you should separate the parsing code from the platform code (Toast). Kotlin has a great testing framework, in which it is easy to write &quot;parsing &quot;1 2/3&quot; should return listOf(1, 2, 3)&quot;. This testing code works best if you run it directly on your developing machine, and without any Toast or Activity.
The next thing is that you should not use List&lt;Int&gt; in places where you originally wanted to say Fraction or maybe, to be more specific, MixedFraction. The point is that listOf(1, 2, 3, 4, 5) is a valid list but not a valid fraction. By using a specifically constrained type you force the Kotlin compiler to check your code for you.
class Fraction(
    val int: Int,
    val num: Int,
    val den: Int
)

To make your parser extensible to expressions that are more complicated, you must not use contains. Instead, the best-practice way is to split the input into tokens first (often using regular expressions) and then to combine these tokens to expression trees (using a parser that only looks at the very next token to decide what to do next). The details of all of this are covered in any good book on compiler construction.
In your case, the tokens would be:

unsigned integer
fraction slash
unary minus sign

Note that there is no &quot;space&quot; token, as that is usually left out when defining an expression language.