use of se.zinokader.spotiq.util.di.Injector in project SpotiQ by ZinoKader.
the class SpotifyAuthenticationActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_authentication);
((Injector) getApplication()).inject(this);
overridePendingTransition(R.anim.short_fade_in, R.anim.short_fade_out);
AuthenticationRequest authRequest = new AuthenticationRequest.Builder(BuildConfig.SPOTIFY_CLIENT_ID, AuthenticationResponse.Type.TOKEN, SpotifyConstants.REDIRECT_URI).setScopes(SpotifyConstants.DEFAULT_USER_SCOPES).build();
AuthenticationClient.openLoginActivity(this, ApplicationConstants.LOGIN_INTENT_REQUEST_CODE, authRequest);
}
use of se.zinokader.spotiq.util.di.Injector in project SpotiQ by ZinoKader.
the class TracklistFragment method onCreate.
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
((Injector) getContext().getApplicationContext()).inject(this);
super.onCreate(savedInstanceState);
String partyTitle = getArguments().getString(ApplicationConstants.PARTY_NAME_EXTRA);
itemAnimator.setInterpolator(new DecelerateInterpolator());
itemAnimator.setAddDuration(ApplicationConstants.DEFAULT_ITEM_ADD_DURATION_MS);
itemAnimator.setRemoveDuration(ApplicationConstants.DEFAULT_ITEM_REMOVE_DURATION_MS);
itemAnimator.setMoveDuration(ApplicationConstants.DEFAULT_ITEM_MOVE_DURATION_MS);
subscriptions.add(tracklistRepository.listenToTracklistChanges(partyTitle).delay(ApplicationConstants.DEFAULT_NEW_ITEM_DELAY_MS, TimeUnit.MILLISECONDS).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(childEvent -> {
Song song = childEvent.getDataSnapshot().getValue(Song.class);
switch(childEvent.getChangeType()) {
case ADDED:
addSong(song);
break;
case REMOVED:
removeSong(song);
break;
}
}));
}
Aggregations