pocmo / Yaaic

Yaaic (Yet Another Android IRC Client) is as the name already says an Internet Relay Chat (IRC) client for Android devices.
http://www.yaaic.org
GNU General Public License v3.0
331 stars 120 forks source link

Change switch by if #214

Open Chrysweel opened 8 years ago

Chrysweel commented 8 years ago

If you are in a library you have to change all the switch/case statements to if/else blocks from ADT version 14.

Chrysweel commented 8 years ago

Here explain in issue stackoverflow.

http://stackoverflow.com/questions/9092712/switch-case-statement-error-case-expressions-must-be-constant-expression

pocmo commented 8 years ago

Yeah, this is annoying if you are using a library. Are you using Yaaic as a library? What app are you building with Yaaic as a library?

Regarding the code: This should be a long list of if-else statements not nested, like:

final int id = v.getId()
if (id == R.id.foo) {
    ...
} else if (id = R.id.bar) {
    ...
} else if (id == R.id.foobar) {
    ...
}

Do you want to update the pull request? I'd be happy to accept it after that. :)

Chrysweel commented 8 years ago

I Solved.

My app is a MVP, using yaaic into my app, with my features login, register ... I want learn about use yaaic as library, and can programing without modify code of yaaic.