jguerinet / MyMartlet

Android version of the unofficial McGill app MyMartlet.
Apache License 2.0
10 stars 3 forks source link

Settings Refactor #99

Closed jguerinet closed 5 years ago

jguerinet commented 5 years ago
jguerinet commented 5 years ago

With regards to your note:

AllanWang commented 5 years ago

enum would be something like this:

enum class Person(val aboutRes: Int, val iconRes: Int, ...) {
    JULIEN(R.string.about_julien, R.drawable.about_julien, R.string.about_julien_role,
                R.string.about_julien_email, R.string.about_julien_linkedin),
    XYZ(...)
}

and you would add items through Person.values().map {...}.

If you have subcategories you can add extra values to denote the categories. It isn't too verbose in the sense that every value you write has meaning, and it's safer than getting resources by name.

jguerinet commented 5 years ago

All right all right, I'll add the enums back.