Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch of crash fixes and tweaks #21

Merged
merged 50 commits into from
Mar 15, 2017
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
dae3a04
Cmd-alt-L on the whole app module, something changed
rock3r Nov 24, 2016
4f0a354
Well apparently some stuff was not reformatted 😡
rock3r Nov 24, 2016
f187b41
Only include TweetUI as dependency
rock3r Nov 24, 2016
ddd6852
Rename themes to Theme.Connfa.*
rock3r Nov 24, 2016
1dbc7cd
Create Social Feed Activity
rock3r Nov 24, 2016
812259b
Update GMS and appcompat versions
rock3r Nov 24, 2016
91b06a5
Add socialQuery to application.properties sample
rock3r Nov 24, 2016
37b185a
Rename toolbar ID to R.id.toolbar
rock3r Nov 24, 2016
a50d405
Rename enum members to be uppercase
rock3r Nov 24, 2016
fa1db4a
Create MVP content for Social Feed activity
rock3r Nov 24, 2016
056f441
Show SocialFeedActivity when navigating from Nav Drawer
rock3r Nov 24, 2016
c1a35f5
Fix toolbar theming in social feed screen
rock3r Nov 24, 2016
3f57e1a
Deprecate SocialMediaFragment
rock3r Nov 24, 2016
800a446
Merge pull request #12 from rock3r/Twitter_feed_again_🐦
danybony Nov 25, 2016
82273e4
Merge remote-tracking branch 'mainline/github-master' into Working_br…
rock3r Dec 3, 2016
cdecf40
Merge pull request #13 from rock3r/Working_branch
frapontillo Dec 3, 2016
43396b4
Create setup docs
rock3r Dec 3, 2016
bdc5d97
Create CONTRIBUTORS.md
rock3r Dec 3, 2016
b6fde54
Update README.md
rock3r Dec 3, 2016
8672762
Add link to setup docs in readme
rock3r Dec 4, 2016
ac88d50
Merge branch 'develop' into add_setup_docs
rock3r Dec 4, 2016
733f064
Merge pull request #14 from rock3r/add_setup_docs
frapontillo Dec 4, 2016
081eaca
Use exclusions for IDE settings ignores
rock3r Dec 12, 2016
a15a73f
Merge pull request #15 from rock3r/gitignore-improvements
frapontillo Dec 12, 2016
188e00d
Update Gradle plugin 2.2.2 -> 2.2.3
rock3r Dec 13, 2016
2b3fcbc
Update build tools 25.0.0 -> 25.0.2
rock3r Dec 13, 2016
dc7d179
Update Play Services 10.0.0 -> 10.0.1
rock3r Dec 13, 2016
46ce8b9
Update travis.yml for build tools 25.0.2
frapontillo Dec 13, 2016
4301b58
Merge pull request #16 from rock3r/Update_Gradle_plugin_and_deps
frapontillo Dec 13, 2016
db4a1ac
Move the apply-from to the root build.gradle
rock3r Dec 13, 2016
55505bf
Merge pull request #17 from rock3r/Improve_build
frapontillo Dec 13, 2016
ea7f050
Update Gradle v3.1 -> v3.2.1
rock3r Dec 28, 2016
9922520
Merge branch 'develop' into Improve_build
rock3r Dec 28, 2016
13ab8d1
Merge pull request #18 from rock3r/Improve_build
danybony Dec 28, 2016
26feddb
Fix crash in EventHolderFragment due to task leak
rock3r Dec 28, 2016
8711686
Remove comments and reorder code
rock3r Dec 28, 2016
849b443
Remove unneeded WeakReference in task
rock3r Dec 28, 2016
7f43708
Merge pull request #19 from rock3r/CA-14_Fix_Events_screen_crash
danybony Dec 29, 2016
0f5e53f
Refactor asynctasks in FloorPlanFragment
rock3r Dec 29, 2016
258ac4b
Reorder methods and alter lifecycle
rock3r Dec 29, 2016
4e84e87
Refactor one of the callbacks
rock3r Dec 29, 2016
06a820d
Make sure we can only run one load plans task at a time
rock3r Dec 29, 2016
66a86eb
Make sure we can only run one load image task at a time
rock3r Dec 29, 2016
3e2b9c4
Rename view fields
rock3r Dec 29, 2016
3f0c88e
Reorder methods in FloorPlanFragment
rock3r Jan 4, 2017
7f92351
Merge pull request #20 from rock3r/CA-16_Fix_floor_plan_crash
danybony Jan 4, 2017
5d0e189
Add place and speakers to notification text
danybony Jan 11, 2017
6616bb5
Extract parametrised string for notification text
danybony Jan 11, 2017
bfa9ccf
Extract speakers names index checks to methods
danybony Jan 11, 2017
f94d494
Merge pull request #21 from rock3r/updated_notification_text
fourlastor Jan 11, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Extract speakers names index checks to methods
For better readability
danybony committed Jan 11, 2017
commit bfa9ccf7ba0cf9e714571c354e3132db05878026
15 changes: 11 additions & 4 deletions app/src/main/java/com/connfa/receiver/NotifyReceiver.java
Original file line number Diff line number Diff line change
@@ -77,18 +77,25 @@ private String createSpeakersNames(List<Speaker> speakerList) {
return "";
}
StringBuilder sb = new StringBuilder("by ");
for (int i = 0; i < speakerList.size() - 1; i++) {
for (int i = 0; i < speakerList.size(); i++) {
sb.append(createSpeakerFullName(speakerList.get(i)));
if (i < speakerList.size() - 2) {
if (isBeforeSecondToLast(speakerList, i)) {
sb.append(", ");
} else if (i == speakerList.size() - 2) {
} else if (isSecondToLast(speakerList, i)) {
sb.append(" and ");
}
}
sb.append(createSpeakerFullName(speakerList.get(speakerList.size() - 1)));
return sb.toString();
}

private boolean isBeforeSecondToLast(List<Speaker> speakerList, int i) {
return i < speakerList.size() - 2;
}

private boolean isSecondToLast(List<Speaker> speakerList, int i) {
return i == speakerList.size() - 2;
}

private String createSpeakerFullName(Speaker speaker) {
return speaker.getFirstName() + " " + speaker.getLastName();
}