AhiruSoftwareCompany / coldmirrorapp

A soundboard app with quotes and effects from coldmirror (German YouTuber)
MIT License
9 stars 6 forks source link

Optimize quote list #7

Closed dieechtenilente closed 7 years ago

dieechtenilente commented 7 years ago

~Put all quotes in enum~ or add them programmatically from /res/raw/* and sort them

Current code:

Quote[] quoteArray = {
  new Quote("ahahahalustig", "Ahahaha Lustig!"),
  new Quote("boahistdaslustig", "Boah ist das lustig"),
[...]
  new Quote("volldumm", "Ah, voll dumm"),
  new Quote("wasistdeinlieblingstrinken", "Was ist dein Lieblingsgetränk")};
okitec commented 7 years ago

How exactly would enums improve your code? Does your current solution not work reliably? Your code looks fine, so using an enum would not improve readability either.

dieechtenilente commented 7 years ago

@okitec It works, but now I have to add all my hand

okitec commented 7 years ago

You have to type it out once anyway. Consider generating Java code automagically by using Awk (heh) and shell scripting. Code generation is fun.

dieechtenilente commented 7 years ago

I thought about something like that. I only have to figure out a smooth and nice way to add buttons programmatically and not creating a new one for each quote :)