Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
Laith Nurie committed Dec 13, 2015
1 parent 83eb521 commit ba0c98d
Show file tree
Hide file tree
Showing 19 changed files with 41 additions and 230 deletions.
6 changes: 3 additions & 3 deletions core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
<service
android:name=".service.MediaPlayerService"
android:enabled="true"
android:exported="true"
android:stopWithTask="true"></service>
android:stopWithTask="true" />

<service android:name=".service.WearMessageService">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>

<activity android:name=".activity.SearchActivity"></activity>
<activity android:name=".activity.SearchActivity" />
</application>

</manifest>
23 changes: 11 additions & 12 deletions core/src/main/java/com/laithlab/core/RhythmCoreApp.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
package com.laithlab.core;

import android.app.Application;
import android.content.Context;
import android.content.res.Resources;

import com.facebook.stetho.Stetho;
import com.squareup.leakcanary.LeakCanary;

public class RhythmCoreApp extends Application {

public RhythmCoreApp() {
super();
}
public RhythmCoreApp() {
super();
}

public void onCreate() {
super.onCreate();
LeakCanary.install(this);
Stetho.initializeWithDefaults(this);
}
public void onCreate() {
super.onCreate();
LeakCanary.install(this);
Stetho.initializeWithDefaults(this);
}

public Resources resources() {
return getResources();
}
public Resources resources() {
return getResources();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.laithlab.core.activity;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.PorterDuff;
Expand Down Expand Up @@ -85,11 +84,6 @@ protected void onStart() {
updateDb(this);
}

@Override
protected void onResume() {
super.onResume();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_browse, menu);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected FilterResults performFiltering(CharSequence constraint) {
filterResults.values = originalSearchResults;
filterResults.count = originalSearchResults.size();
} else {
ArrayList<SearchResult> filteredSongList = new ArrayList<SearchResult>();
ArrayList<SearchResult> filteredSongList = new ArrayList<>();
for (SearchResult result : originalSearchResults) {
if (result.getMainTitle().toLowerCase().contains(constraint.toString().toLowerCase())
|| result.getResultType() == SearchResult.ResultType.HEADER) {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/laithlab/core/dto/AlbumDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public AlbumDTO() {
protected AlbumDTO(Parcel in) {
this.albumTitle = in.readString();
this.albumImageUrl = in.readString();
this.songs = new ArrayList<SongDTO>();
this.songs = new ArrayList<>();
in.readTypedList(this.songs, SongDTO.CREATOR);
this.id = in.readString();
this.artistId = in.readString();
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/laithlab/core/dto/ArtistDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public ArtistDTO() {
protected ArtistDTO(Parcel in) {
this.id = in.readString();
this.artistName = in.readString();
this.albumDTOList = new ArrayList<AlbumDTO>();
this.albumDTOList = new ArrayList<>();
in.readTypedList(this.albumDTOList, AlbumDTO.CREATOR);
this.coverPath = in.readString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ private void updatePlayerUI() {
mListener.changePlayerStyle(vibrantColor, songPosition);
} else {
vibrantColor = getResources().getColor(R.color.color_primary);
changePlayerStyle(vibrantSwatch.getRgb());
mListener.changePlayerStyle(vibrantColor, songPosition);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
import android.os.IBinder;
import android.os.RemoteException;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.media.RatingCompat;
import android.support.v4.media.session.MediaControllerCompat;
import android.support.v4.media.session.MediaSessionCompat;
import android.support.v7.app.NotificationCompat;
import android.util.Log;

import com.laithlab.core.R;
import com.laithlab.core.activity.SwipePlayerActivity;
Expand Down Expand Up @@ -197,16 +195,6 @@ public void onSkipToPrevious() {
LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(previousIntent);
}

@Override
public void onFastForward() {
super.onFastForward();
}

@Override
public void onRewind() {
super.onRewind();
}

@Override
public void onStop() {
super.onStop();
Expand All @@ -215,16 +203,6 @@ public void onStop() {
Intent intent = new Intent(getApplicationContext(), MediaPlayerService.class);
stopService(intent);
}

@Override
public void onSeekTo(long pos) {
super.onSeekTo(pos);
}

@Override
public void onSetRating(RatingCompat rating) {
super.onSetRating(rating);
}
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class MusicDataUtility {

private static ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, String>>();
private static ArrayList<HashMap<String, String>> songsList = new ArrayList<>();
private static final Pattern DIR_SEPORATOR = Pattern.compile("/");
private static String mp3Pattern = ".mp3";

Expand Down Expand Up @@ -126,7 +126,7 @@ private static void scanDirectory(File directory) {

private static void addSongToList(File song) {
if (song.getName().endsWith(mp3Pattern)) {
HashMap<String, String> songMap = new HashMap<String, String>();
HashMap<String, String> songMap = new HashMap<>();
songMap.put("songTitle",
song.getName().substring(0, (song.getName().length() - 4)));
songMap.put("songPath", song.getPath());
Expand Down Expand Up @@ -293,7 +293,7 @@ public static Artist getArtistById(String id, Context context) {

public static String[] getStorageDirectories() {
// Final set of paths
final Set<String> rv = new HashSet<String>();
final Set<String> rv = new HashSet<>();
// Primary physical SD-CARD (not emulated)
final String rawExternalStorage = System.getenv("EXTERNAL_STORAGE");
// All Secondary SD-CARDs (all exclude primary) separated by ":"
Expand Down
155 changes: 0 additions & 155 deletions core/src/main/java/com/laithlab/core/utils/SearchViewUtil.java

This file was deleted.

Loading

0 comments on commit ba0c98d

Please sign in to comment.