Skip to content

Commit

Permalink
Publish (#50)
Browse files Browse the repository at this point in the history
* Shows it

* Location working

* Reactive permissions

* Change some internals of trendings

* Mega commit with Play visuals

* Change tint color for fanciness

* Gradle 3.4

* Service

* Add time lapse to current play

* "works"

* Changes

* Changes

* Tunea2

* More fixes and improvements

* Doing playlistcreations/adding

* Changes in presenter internals

* Add a playlist finished + changed some resources

* Imports optimized

* Add dead code minifier for debug to avoid multidex

* This closes #33

* Release streamer when we are done (never)

* Ratings synced with backend

* Crashlytics

* Uploald obfuscation mappings to crashlytics

* Crashtracker working

* optimized imports

* Login view changes

* Cool changes

* Fix chat modifier

* Custom dialog images

* Change brand name

* Native login implemented ??

* Native login ended ?

* Missing ui fixes and its ok

* Location not asked in profile

* Utils gradle

* qt ui

* native login finished

* Fix gradle and proguard issues

* Sugars for dialog controller 💣

* Cool validations :neckbeard:

* Get only country

* Fixes and improvements

* Update README.md

* Fix possible NPE in service

* Fix service stops when task killed

* Add facebook permissions per request

* Contacts (#45)

* Add facebook permissions per request

* Add error handling to location

* More error handling

* Changes for portability

* Create supplier

* Create controller to use

* Add some more dinamism in data flows

* Contacts feature

* Done contacts view

* Change of ui a bit

* Back compacts music player

* Release 2.0.0

* Fix token endpoint url

* Remove unused classes

* Align login endpoints v1

* Move to main thread the toast

* Login fixed

* Update README.md

* Update README.md

* Update README.md

* Add javadoc 🙉

* Update readme 💥

* Bump version

* Add html preview

* Fix merge
  • Loading branch information
saantiaguilera authored Jun 1, 2017
1 parent 66c06e3 commit 77bdca4
Show file tree
Hide file tree
Showing 426 changed files with 92,634 additions and 214 deletions.
17 changes: 5 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
### Changelog

#### v2.0.0
- Contactos. El usuario ahora puede buscar y seguir usuarios
- Login nativo. UX para login nativo y creacion de cuenta
- Play streaming
- Notificacion del play status con botones
- Se puede agregar canciones a una playlist
- Se puede crear playlists
- Crash reporting
- Minor bugfixes
- UX changes
#### v3.0.0
- Javadoc
- Align with backend

Para ver los issues/pull request asociados a este release, buscar por [milestone 2.0.0]
Para ver los issues/pull request asociados a este release, buscar por [milestone 3.0.0]

[milestone 2.0.0]: https://github.com/tallerify/fiuba-taller-II-tallerify-android/milestone/2?closed=1
[milestone 3.0.0]: https://github.com/tallerify/fiuba-taller-II-tallerify-android/milestone/3?closed=1
144 changes: 49 additions & 95 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,118 +4,72 @@ Tallerify is a "Spotify" Android client, for academic uses (its a work for the s

[![Coverage Status](https://coveralls.io/repos/github/saantiaguilera/fiuba-taller-II-tallerify-android/badge.svg?branch=develop)](https://coveralls.io/github/saantiaguilera/fiuba-taller-II-tallerify-android?branch=develop)

[![Build Status](https://travis-ci.org/saantiaguilera/fiuba-taller-II-tallerify-android.svg?branch=develop)](https://travis-ci.org/saantiaguilera/fiuba-taller-II-tallerify-android)
[![Build Status](https://travis-ci.org/tallerify/fiuba-taller-II-tallerify-android.svg?branch=master)](https://travis-ci.org/tallerify/fiuba-taller-II-tallerify-android)

## Honour the JVM
## Application

How to dance correctly:
<img src="http://i.imgur.com/gYYaFDJ.png" height="320"> <img src="http://i.imgur.com/cJN7kZj.png" height="320"> <img src="http://i.imgur.com/QoRc3QX.png" height="320"> <img src="http://i.imgur.com/JbPkJ8u.png" height="320">

1. Swing left : 〜( ̄▽ ̄〜)
## Documentation

2. Swing right : (〜 ̄▽ ̄)〜
For a full documentation of all the clases, you can see the [javadoc documentation](http://htmlpreview.github.io/?https://github.com/tallerify/fiuba-taller-II-tallerify-android/blob/develop/javadoc/index.html)

3. Repeat until song finishes.
## Structure

## Example
FMP is a monolythic single-activity native android app. It uses a lot of state-of-art dependencies (eg RxJava) and has some architecture and design patterns applied to. FMP supports any phone with at least api level 16 and with internet and gps access.

〜( ̄▽ ̄〜)
Currently it lacks of loading views (while a request is processing) and retries (in case it fails). This will be available for future iterations outside of the assigned scope.

(〜 ̄▽ ̄)〜
### Dependencies

〜( ̄▽ ̄〜)
Dependencies can be divided between project and application.

(〜 ̄▽ ̄)〜
#### Project

〜( ̄▽ ̄〜)
1. **Travis**: We are using Travis as tool for our CI.
2. **Coveralls / Jacoco**: We are using coveralls for test coverage and jacoco as a tool for packaging and uploading the hits/misses
3. **Gradle**: Gradle 3.5 was picked as DSL and buildtool system for the project because of its simplicity in android environments and overall
4. **Proguard**: Proguard is being used at release for reducing the dex count and avoid the multidex. For debug we are using the built-in shrinker android provides
5. **LeakCanary**: Leak Canary is available for debug builds to notify about possible leaks while developing
6. **Stetho**: Stetho is also available for debug builds as a interceptor
7. **Junit / Robolectric**: For testing we are using Junit as framework and robolectric for mimicking the android system

(〜 ̄▽ ̄)〜
#### Application

〜( ̄▽ ̄〜)
1. **SupportLibrary**: We have included design and cardview for UI purposses. CustomTabs was also added since latest facebook versions have it as a provided dependency (they might use it if the phone is able)
2. **Rx**: RxJava and RxAndroid are core for the functionality of the application. Both features are in every corner of the app making easier the flow and movements of data. Also RxBindings was added for view bidings, RxLocation for gms locations, RxPermissions for simple permission requests to the system and RxPaparazzo for interactions with the phone gallery.
3. **Retrofit**: For networking requests, retrofit was used.
4. **Conductor**: For architectural structuring, we have decided to work with Conductor, to avoid the complex and depth lifecycles android has.
5. **Coordinators**: For design structuring, we have decided to create a MVP/MVI with Coordinators.
6. **Toasty**: Toasty its just added for notifying errors when they appear. If error handling appears in a future scope, this library will most likely dissappear
7. **Facebook**: Facebook dependency for login in
8. **Firebase**: Firebase authentication and chat dependencies are incorporated
9. **Fresco**: For image loading

(〜 ̄▽ ̄)〜
### Packages

〜( ̄▽ ̄〜)
For understand a bit easier the packages of the application, we will list them and minimally provide information about what they contain.

(〜 ̄▽ ̄)〜
- **com.u.tallerify**: Contains root project classes, that are agnostic to every other classes and the application itself. For example, the application class
- **com.u.tallerify.annotations**: Annotations useful for proguard or compile time
- **com.u.tallerify.change_handler**: Animations for views/controllers
- **com.u.tallerify.contract**: Contracts that presenters and views implements, to limit the scope and visibility they can interact with
- **com.u.tallerify.controller**: Where all the controllers are. You can think of the controllers as the "activities" or "fragments".
- **com.u.tallerify.entry_points**: The app entry points, this are the activities/services/broadcast_receivers the application has and can be interacted with as entry points
- **com.u.tallerify.model**: Models/Dtos of the application.
- **com.u.tallerify.model.entity**: Model entities. The difference between the `model` ones is that entities must have a unique identifier attached to each instance.
- **com.u.tallerify.networking**: Classes used for networking purposes, eg the RestClient or a Deserializer
- **com.u.tallerify.networking.interactors**: Interactors are middlewares between the external abstractions (eg. services) and the front-end application. When a class wants to interact with the outside, they have to do it with an Interactor. This doesnt apply only for backend, but also for example for a Facebook login or a location request to the system.
- **com.u.tallerify.networking.services**: Services are sets of abstractions of the backend endpoints, you can think of as containers or repositories of request contracts someone can perform
- **com.u.tallerify.presenter**: The presenters. Presenters are used to decouple the bussiness logic from the views.
- **com.u.tallerify.supplier**: Suppliers are classes that supply on demand presenters or views for a given model in a particular context (lets say in a horizontal list where songs/artists/albums/playlists are displayed)
- **com.u.tallerify.utils**: Random magic bag of utility static classes
- **com.u.tallerify.view**: The views of the application

〜( ̄▽ ̄〜)
## Contributing

(〜 ̄▽ ̄)〜
Please fork and create a PR, we will review it as soon as we can

〜( ̄▽ ̄〜)
Dependencies should download automatically. Please ensure you are running with the latest android and google repository versions and you have gradle 3.5 / android 2.3

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

〜( ̄▽ ̄〜)

(〜 ̄▽ ̄)〜

## Run

Dependencies should download automatically. Please ensure you are running with the latest android and google repository versions and you have gradle 3.4 / android 2.3

For building a release apk please run `./gradlew assembleRelease -PFirebaseServiceAccountFilePath=path`
For building a release apk please run `./gradlew app:assembleRelease -PFirebaseServiceAccountFilePath=path`
9 changes: 8 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ android {
}
}

task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
destinationDir = file("../javadoc/")
failOnError false
}

dependencies {
compile support.design
compile support.cardView
Expand Down Expand Up @@ -80,4 +87,4 @@ dependencies {
testCompile misc.leakCanaryStub
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.gms.google-services'
2 changes: 1 addition & 1 deletion app/src/debug/java/com/u/tallerify/mocks/Song.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ public class Song {
"]";

public static final String RESPONSE_RESOLVED_URI = "{" +
"\"songId\": 1,\n" +
"\"trackId\": 1,\n" +
"\"url\": \"https://drive.google.com/uc?export=download&id=0B9zXdKK-F_EKTW13YmpjUUo1MGM\"" +
"}";

Expand Down
64 changes: 33 additions & 31 deletions app/src/debug/java/com/u/tallerify/utils/MockInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,43 +18,45 @@
*/
public class MockInterceptor implements Interceptor {

private static final boolean ENABLED = true;

@Override
public Response intercept(Chain chain) throws IOException {
Response response;
String responseString = null;

final String url = chain.request().url().uri().toString();
if (ENABLED) {
final String url = chain.request().url().uri().toString();

if (url.contains("token")) {
responseString = Login.RESPONSE_LOGIN;
} else if (url.contains("popularity")) {
responseString = Song.RESPONSE_RATING;
} else if (url.contains("resolve/")) {
responseString = Song.RESPONSE_RESOLVED_URI;
} else if (url.contains("tracks/trending") || url.contains("me/tracks/favorites")
|| url.contains("tracks/search") || url.contains("/activity") ||
(url.contains("/tracks") && (!url.contains("playlists/") && !url.contains("/tracks/")))) {
responseString = Song.RESPONSE_TRENDING_SONGS;
} else if (url.contains("track")) {
responseString = Song.RESPONSE_SONG;
} else if (url.contains("artists/trending") || url.contains("me/artists/favorites")
|| url.contains("artists/search")
|| url.contains("user/artist/favorite")) {
responseString = Artist.RESPONSE_ARTISTS_TRENDING;
} else if (url.contains("artist")) {
responseString = Artist.RESPONSE_ARTIST;
} else if (url.contains("me/playlists")) {
responseString = Playlist.RESPONSE_USER_PLAYLISTS;
} else if (url.contains("playlist")) {
responseString = Playlist.RESPONSE_USER_PLAYLIST;
} else if (url.contains("users/search")) {
responseString = User.RESPONSE_USERS;
} else if (url.contains("users/")) {
responseString = User.RESPONSE_USER;
}else if (url.contains("albums/search")) {
responseString = Album.RESPONSE_ALBUMS;
} else if (url.contains("albums")) {
responseString = Album.RESPONSE_ALBUM;
if (url.contains("popularity")) {
responseString = Song.RESPONSE_RATING;
} else if (url.contains("resolve/")) {
responseString = Song.RESPONSE_RESOLVED_URI;
} else if (url.contains("tracks/recommended") || url.contains("me/tracks/favorites")
|| url.contains("tracks/search") || url.contains("/activity") ||
(url.contains("/tracks") && (!url.contains("playlists/") && !url.contains("/tracks/")))) {
responseString = Song.RESPONSE_TRENDING_SONGS;
} else if (url.contains("track")) {
responseString = Song.RESPONSE_SONG;
} else if (url.contains("artists/recommended") || url.contains("me/artists/favorites")
|| url.contains("artists/search")
|| url.contains("user/artist/favorite")) {
responseString = Artist.RESPONSE_ARTISTS_TRENDING;
} else if (url.contains("artist")) {
responseString = Artist.RESPONSE_ARTIST;
} else if (url.contains("me/playlists")) {
responseString = Playlist.RESPONSE_USER_PLAYLISTS;
} else if (url.contains("playlist")) {
responseString = Playlist.RESPONSE_USER_PLAYLIST;
} else if (url.contains("users/search")) {
responseString = User.RESPONSE_USERS;
} else if (url.contains("users/")) {
responseString = User.RESPONSE_USER;
} else if (url.contains("albums/search")) {
responseString = Album.RESPONSE_ALBUMS;
} else if (url.contains("albums")) {
responseString = Album.RESPONSE_ALBUM;
}
}

if (responseString != null) {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.u.tallerify.controller.profile.ProfileController;
import com.u.tallerify.controller.search.SearchController;
import com.u.tallerify.model.AccessToken;
import com.u.tallerify.networking.AccessTokenManager;
import com.u.tallerify.networking.ReactiveModel;
import com.u.tallerify.networking.interactor.credentials.CredentialsInteractor;
import com.u.tallerify.presenter.home.HomePresenter;
Expand Down Expand Up @@ -46,7 +47,9 @@ protected View onCreateView(@NonNull final LayoutInflater inflater, @NonNull fin
protected void onAttach(@NonNull final View view) {
super.onAttach(view);

BussinessUtils.requestTrendings(getApplicationContext());
if (AccessTokenManager.instance().snapshot() != null) {
BussinessUtils.requestRecommendations(getApplicationContext());
}

CredentialsInteractor.instance().observeToken()
.observeOn(Schedulers.computation())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ void facebookLogin(@NonNull LoginResult result) {
CredentialsInteractor.instance().createWithProvider(getApplicationContext(),
new CredentialsService.CreateCredentialForm(
result.getAccessToken().getToken(),
result.getAccessToken().getUserId(),

AccessToken.Provider.FACEBOOK))
.observeOn(Schedulers.io())
.subscribeOn(Schedulers.io())
Expand All @@ -78,7 +80,7 @@ void facebookLogin(@NonNull LoginResult result) {
public void call(final AccessToken accessToken) {
if (accessToken != null) {
BussinessUtils.requestBasicInfo(getApplicationContext());
BussinessUtils.requestTrendings(getApplicationContext());
BussinessUtils.requestRecommendations(getApplicationContext());
}
}
}, Interactors.ACTION_ERROR);
Expand Down
Loading

0 comments on commit 77bdca4

Please sign in to comment.