Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit c298b26

Browse files
Merge pull request #324 from fossasia/stable
version 0.8.1 (shipping)
2 parents 51edd4f + d3f949c commit c298b26

File tree

70 files changed

+920
-662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+920
-662
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog for Open Event Android
2+
Being maintained since 0.8.x
3+
4+
#### 0.8.1 - next
5+
6+
#### 0.8.0 - 0.8.1
7+
- add missing track details in sessions view
8+
- material look to speaker details
9+
- using retrofit 2.0 now
10+
- fix nav drawer menu layout

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
## The Open Event Android Client
77

88
The Android client is a generic app that has two parts:
9+
910
a) A standard configuration file, that sets the details of the app (e.g. color scheme, logo of event, link to JSON app data)
10-
b) The Android app itself
11-
This app uses the json api provided by a server maintained [here](https://github.com/fossasia/open-event-orga-server).
11+
12+
b) This app uses the json api provided by a server maintained [here](https://github.com/fossasia/open-event-orga-server).
1213

1314
## Development Setup
1415
Before you begin, you should already have the Android Studio SDK downloaded and set up correctly. You can find a guide on how to do this here: [Setting up Android Studio](http://developer.android.com/sdk/installing/index.html?pkg=studio)
@@ -24,6 +25,7 @@ Before you begin, you should already have the Android Studio SDK downloaded and
2425

2526
- *Note:* If you recieve a Gradle sync error titled, "failed to find ...", you should click on the link below the error message (if avaliable) that says *Install missing platform(s) and sync project* and allow Android studio to fetch you what is missing.
2627
- *Note:* If you are trying to build this project on a Windows Machine, you should **Comment** out line number 5 and **Uncomment** line number 6 inside build.gradle(Project: app).
28+
2729
5. Once all build errors have been resolved, you should be all set to build the app and test it.
2830

2931
6. To Build the app, go to *Build>Make Project* (or alternatively press the Make Project icon in the toolbar).
@@ -32,14 +34,18 @@ Before you begin, you should already have the Android Studio SDK downloaded and
3234

3335
### Screenshots
3436
![alt-tag](screenshots/ss2.PNG)
37+
3538
![alt-tag](screenshots/ss1.PNG)
39+
3640
![alt-tag](screenshots/ss3.PNG)
41+
3742
![alt-tag](screenshots/ss4.PNG)
3843

3944
### Configuring the app
4045

4146
**Configuring Server and Web-App Urls**
4247
- Browse the project directories and open (with Android Studio): *app/src/main/java/org/fossasia/openevent/api/Urls.java*
48+
4349
- In this file you will see several constant variables that allow you to set useful properties of the app, these include:
4450
* API_VERSION: Server API version. (Example: "v1")
4551
* EVENT_ID: ID of the event to load from server. (Example: 1)
@@ -53,20 +59,24 @@ Before you begin, you should already have the Android Studio SDK downloaded and
5359

5460
**Configuring App Theme / Localizations**
5561
- The styles.xml files have been configured to allow easy customization of app themes.
62+
5663
- You can configure themes by changing various components found in the styles.xml files, found at:
5764
* */app/src/main/res/values/styles.xml*
5865
* */app/src/main/res/values-v21/styles.xml*
5966

67+
6068
- Using *Theme Editor*:
6169
* You can also configure the theme of the app using Android Studio's *Theme Editor*.
6270
* Go to *Tools>Android>Theme Editor* to open the Theme Editor.
6371
* From there you can configure the colors and styles of in-app elements using a neat UI.
6472

73+
6574
- *Translations Editor*:
6675
* You can configure the string localizaions / translations using Android Studio's *Translations Editor*.
6776
* Find /app/src/main/res/values/strings.xml
6877
* Right click on the file, and select *Open Translations Editor*.
6978

79+
7080
- Editing Manually:
7181
* You can find the configuration files for the app for manual editing here:
7282
* */app/src/main/res/values/*
@@ -80,12 +90,14 @@ Before you begin, you should already have the Android Studio SDK downloaded and
8090
- Also there is a check on the version of data already there in the app's database. If data is stale then only it is downloaded.
8191
- If database is empty then firstly json file in assets is accessed but if internet is available , latest data is downloaded.
8292

83-
## Libraries userd
93+
## Libraries used
8494
- Otto
8595
- Retrofit
8696
- ButterKnife
8797
- Timber
8898
- Google Gson
99+
- LeakCanary
100+
- Picasso
89101

90102
## Branches and Contribution policy
91103
We have the following branches
@@ -104,5 +116,5 @@ We have the following branches
104116
## A note about Codestyle
105117
Please read our [CODESTYLE](CODESTYLE.md) carefully. Pull requests that do not match the style will be rejected.
106118

107-
##License
119+
## License
108120
This project is currently licensed under the GNU General Public License v3. A copy of LICENSE.md should be present along with the source code. To obtain the software under a different license, please contact FOSSASIA.

app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ android {
2323
minSdkVersion 15
2424
targetSdkVersion 23
2525
versionCode 80
26-
versionName "0.8.0"
26+
versionName "0.8.1"
2727

2828
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
2929
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
@@ -63,9 +63,9 @@ dependencies {
6363
compile "com.android.support:support-v4:${SUPPORT_LIB_VERSION}"
6464
compile "com.android.support:cardview-v7:${SUPPORT_LIB_VERSION}"
6565
compile "com.android.support:recyclerview-v7:${SUPPORT_LIB_VERSION}"
66-
compile 'com.google.code.gson:gson:2.5'
67-
compile 'com.squareup.okhttp:okhttp:2.7.2'
68-
compile 'com.squareup.retrofit:retrofit:1.9.0'
66+
compile 'com.squareup.retrofit2:retrofit:2.0.0'
67+
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
68+
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
6969
compile "com.android.support:design:${SUPPORT_LIB_VERSION}"
7070
compile 'com.squareup.picasso:picasso:2.5.2'
7171
compile 'com.squareup:otto:1.3.8'
@@ -83,7 +83,7 @@ dependencies {
8383
// Testing
8484
testCompile 'junit:junit:4.12'
8585
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
86-
androidTestCompile ('com.android.support.test:runner:0.4') {
86+
androidTestCompile('com.android.support.test:runner:0.4') {
8787
exclude group: 'com.android.support', module: 'support-annotations'
8888
}
8989
androidTestCompile "com.android.support:support-annotations:${SUPPORT_LIB_VERSION}"
@@ -92,7 +92,7 @@ dependencies {
9292
exclude group: 'com.android.support', module: 'support-v4'
9393
exclude module: 'recyclerview-v7'
9494
}
95-
androidTestCompile ('com.android.support.test:rules:0.4') {
95+
androidTestCompile('com.android.support.test:rules:0.4') {
9696
exclude group: 'com.android.support', module: 'support-annotations'
9797
}
9898
androidTestCompile "org.mockito:mockito-core:1.10.19"

app/src/androidTest/java/org/fossasia/openevent/APITest.java

Lines changed: 73 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
import java.util.concurrent.CountDownLatch;
1515

16-
import retrofit.Callback;
17-
import retrofit.RetrofitError;
18-
import retrofit.client.Response;
16+
import retrofit2.Call;
17+
import retrofit2.Callback;
18+
import retrofit2.Response;
1919

2020
/**
2121
* User: mohit
@@ -25,38 +25,50 @@ public class APITest extends AndroidTestCase {
2525
public void testSpeakerAPIResponse() throws Exception {
2626
APIClient client = new APIClient();
2727
final CountDownLatch latch = new CountDownLatch(1);
28-
client.getOpenEventAPI().getSpeakers(Urls.EVENT_ID, new Callback<SpeakerResponseList>() {
28+
client.getOpenEventAPI().getSpeakers(Urls.EVENT_ID).enqueue(new Callback<SpeakerResponseList>() {
2929
@Override
30-
public void success(SpeakerResponseList speakerResponseList, Response response) {
31-
assertNotNull(speakerResponseList.speakers);
32-
// Assert that the list size > 0
33-
assertTrue(speakerResponseList.speakers.size() > 0);
34-
latch.countDown();
30+
public void onResponse(Call<SpeakerResponseList> call, Response<SpeakerResponseList> response) {
31+
if (response.isSuccessful()) {
32+
assertNotNull(response.body().speakers);
33+
// Assert that the list size > 0
34+
assertTrue(response.body().speakers.size() > 0);
35+
latch.countDown();
36+
} else {
37+
fail("API Request Failed");
38+
latch.countDown();
39+
}
3540
}
3641

3742
@Override
38-
public void failure(RetrofitError error) {
43+
public void onFailure(Call<SpeakerResponseList> call, Throwable t) {
3944
fail("API Request Failed");
4045
latch.countDown();
4146
}
4247
});
48+
4349
latch.await();
4450
}
4551

4652
public void testSponsorAPIResponse() throws Exception {
4753
APIClient client = new APIClient();
4854
final CountDownLatch latch = new CountDownLatch(1);
49-
client.getOpenEventAPI().getSponsors(Urls.EVENT_ID, new Callback<SponsorResponseList>() {
55+
client.getOpenEventAPI().getSponsors(Urls.EVENT_ID).enqueue(new Callback<SponsorResponseList>() {
5056
@Override
51-
public void success(SponsorResponseList sponsorResponseList, Response response) {
52-
assertNotNull(sponsorResponseList.sponsors);
53-
// Assert that the list size > 0
54-
assertTrue(sponsorResponseList.sponsors.size() > 0);
55-
latch.countDown();
57+
public void onResponse(Call<SponsorResponseList> call, Response<SponsorResponseList> response) {
58+
if (response.isSuccessful()) {
59+
assertNotNull(response.body().sponsors);
60+
// Assert that the list size > 0
61+
assertTrue(response.body().sponsors.size() > 0);
62+
latch.countDown();
63+
64+
} else {
65+
fail("API Request Failed");
66+
latch.countDown();
67+
}
5668
}
5769

5870
@Override
59-
public void failure(RetrofitError error) {
71+
public void onFailure(Call<SponsorResponseList> call, Throwable t) {
6072
fail("API Request Failed");
6173
latch.countDown();
6274
}
@@ -67,16 +79,21 @@ public void failure(RetrofitError error) {
6779
public void testEventAPIResponse() throws Exception {
6880
APIClient client = new APIClient();
6981
final CountDownLatch latch = new CountDownLatch(1);
70-
client.getOpenEventAPI().getEvents(new Callback<EventResponseList>() {
82+
client.getOpenEventAPI().getEvents().enqueue(new Callback<EventResponseList>() {
7183
@Override
72-
public void success(EventResponseList eventResponseList, Response response) {
73-
assertNotNull(eventResponseList.event);
74-
assertTrue(eventResponseList.event.size() > 0);
75-
latch.countDown();
84+
public void onResponse(Call<EventResponseList> call, Response<EventResponseList> response) {
85+
if (response.isSuccessful()) {
86+
assertNotNull(response.body().event);
87+
assertTrue(response.body().event.size() > 0);
88+
latch.countDown();
89+
} else {
90+
fail("API Request Failed");
91+
latch.countDown();
92+
}
7693
}
7794

7895
@Override
79-
public void failure(RetrofitError error) {
96+
public void onFailure(Call<EventResponseList> call, Throwable t) {
8097
fail("API Request Failed");
8198
latch.countDown();
8299
}
@@ -87,16 +104,21 @@ public void failure(RetrofitError error) {
87104
public void testSessionAPIResponse() throws Exception {
88105
APIClient client = new APIClient();
89106
final CountDownLatch latch = new CountDownLatch(1);
90-
client.getOpenEventAPI().getSessions(Urls.EVENT_ID, new Callback<SessionResponseList>() {
107+
client.getOpenEventAPI().getSessions(Urls.EVENT_ID).enqueue(new Callback<SessionResponseList>() {
91108
@Override
92-
public void success(SessionResponseList sessionResponseList, Response response) {
93-
assertNotNull(sessionResponseList.sessions);
94-
assertTrue(sessionResponseList.sessions.size() > 0);
95-
latch.countDown();
109+
public void onResponse(Call<SessionResponseList> call, Response<SessionResponseList> response) {
110+
if (response.isSuccessful()) {
111+
assertNotNull(response.body().sessions);
112+
assertTrue(response.body().sessions.size() > 0);
113+
latch.countDown();
114+
} else {
115+
fail("API Request Failed");
116+
latch.countDown();
117+
}
96118
}
97119

98120
@Override
99-
public void failure(RetrofitError error) {
121+
public void onFailure(Call<SessionResponseList> call, Throwable t) {
100122
fail("API Request Failed");
101123
latch.countDown();
102124
}
@@ -107,16 +129,21 @@ public void failure(RetrofitError error) {
107129
public void testTrackAPIResponse() throws Exception {
108130
APIClient client = new APIClient();
109131
final CountDownLatch latch = new CountDownLatch(1);
110-
client.getOpenEventAPI().getTracks(Urls.EVENT_ID, new Callback<TrackResponseList>() {
132+
client.getOpenEventAPI().getTracks(Urls.EVENT_ID).enqueue(new Callback<TrackResponseList>() {
111133
@Override
112-
public void success(TrackResponseList trackResponseList, Response response) {
113-
assertNotNull(trackResponseList.tracks);
114-
assertTrue(trackResponseList.tracks.size() > 0);
115-
latch.countDown();
134+
public void onResponse(Call<TrackResponseList> call, Response<TrackResponseList> response) {
135+
if (response.isSuccessful()) {
136+
assertNotNull(response.body().tracks);
137+
assertTrue(response.body().tracks.size() > 0);
138+
latch.countDown();
139+
} else {
140+
fail("API Request Failed");
141+
latch.countDown();
142+
}
116143
}
117144

118145
@Override
119-
public void failure(RetrofitError error) {
146+
public void onFailure(Call<TrackResponseList> call, Throwable t) {
120147
fail("API Request Failed");
121148
latch.countDown();
122149
}
@@ -127,16 +154,21 @@ public void failure(RetrofitError error) {
127154
public void testMicrolocationAPIResponse() throws Exception {
128155
APIClient client = new APIClient();
129156
final CountDownLatch latch = new CountDownLatch(1);
130-
client.getOpenEventAPI().getMicrolocations(Urls.EVENT_ID, new Callback<MicrolocationResponseList>() {
157+
client.getOpenEventAPI().getMicrolocations(Urls.EVENT_ID).enqueue(new Callback<MicrolocationResponseList>() {
131158
@Override
132-
public void success(MicrolocationResponseList microlocationResponseList, Response response) {
133-
assertNotNull(microlocationResponseList.microlocations);
134-
assertTrue(microlocationResponseList.microlocations.size() > 0);
135-
latch.countDown();
159+
public void onResponse(Call<MicrolocationResponseList> call, Response<MicrolocationResponseList> response) {
160+
if (response.isSuccessful()) {
161+
assertNotNull(response.body().microlocations);
162+
assertTrue(response.body().microlocations.size() > 0);
163+
latch.countDown();
164+
} else {
165+
fail("API Request Failed");
166+
latch.countDown();
167+
}
136168
}
137169

138170
@Override
139-
public void failure(RetrofitError error) {
171+
public void onFailure(Call<MicrolocationResponseList> call, Throwable t) {
140172
fail("API Request Failed");
141173
latch.countDown();
142174
}

0 commit comments

Comments
 (0)