Added Interactive (nonfunctional) notification, deleted unused classes and images, fixed toolbar bug, optimized many things, sped up scrolling (BUG: selecting song from tracks crashes the app)

master
Aurailus 2017-05-17 14:31:06 -07:00
parent 17665e259e
commit 715237135b
43 changed files with 444 additions and 193 deletions

View File

@ -3,8 +3,6 @@
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/CanineMusic.iml" filepath="$PROJECT_DIR$/CanineMusic.iml" />
<module fileurl="file://$PROJECT_DIR$/CanineMusic.iml" filepath="$PROJECT_DIR$/CanineMusic.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>

View File

@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.aurailus.caninemusic"
minSdkVersion 21

View File

@ -10,7 +10,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity

View File

@ -12,7 +12,7 @@ import android.support.v4.graphics.drawable.RoundedBitmapDrawableFactory;
import java.io.File;
public class Album {
class Album {
private String id, title, artist;
private RoundedBitmapDrawable albumArt;
private boolean empty = false;
@ -30,7 +30,7 @@ public class Album {
getAlbumArt(context);
}
public void getAlbumArt(Context context) {
private void getAlbumArt(Context context) {
ContentResolver albumResolver = context.getContentResolver();
Cursor albumCursor = albumResolver.query(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI, //Location to grab from
new String[] {MediaStore.Audio.Albums._ID, MediaStore.Audio.Albums.ALBUM_ART}, //Columns to grab
@ -38,7 +38,7 @@ public class Album {
new String[] {String.valueOf(id)}, //Args for filter
null);
if (albumCursor.moveToFirst()) {
if (albumCursor != null && albumCursor.moveToFirst()) {
String albumString = albumCursor.getString(albumCursor.getColumnIndex(android.provider.MediaStore.Audio.Albums.ALBUM_ART));
if (albumString != null) {
@ -52,10 +52,12 @@ public class Album {
albumArt.setCornerRadius(1000.0f);
albumArt.setAntiAlias(true);
} else empty = true;
}
else empty = true;
}
else empty = true;
} else empty = true;
albumCursor.close();
} else empty = true;
}
/*Getters and setters*/

View File

@ -12,11 +12,10 @@ import android.widget.TextView;
import java.util.ArrayList;
public class AlbumAdapter extends BaseAdapter {
class AlbumAdapter extends BaseAdapter {
private ArrayList<Album> albums;
private LayoutInflater albumInf;
private boolean moredetails;
private ConstraintLayout albumLay;
@Override
public int getCount() {
@ -36,6 +35,7 @@ public class AlbumAdapter extends BaseAdapter {
@Override
public View getView(int ind, View convertView, ViewGroup parent) {
ConstraintLayout albumLay;
if (!moredetails) albumLay = (ConstraintLayout)albumInf.inflate(R.layout.album_grid, parent, false);
else albumLay = (ConstraintLayout)albumInf.inflate(R.layout.album_list, parent, false);
@ -52,10 +52,13 @@ public class AlbumAdapter extends BaseAdapter {
if (moredetails) {
TextView playsView = (TextView) albumLay.findViewById(R.id.album_plays);
TextView lengthView = (TextView) albumLay.findViewById(R.id.album_length);
//TODO: Set up lengthview on album list view
//TextView lengthView = (TextView) albumLay.findViewById(R.id.album_length);
artistView.setText(curAlbum.getArtist());
playsView.setText(" Plays");
//TODO: Set up album plays count
playsView.setText(R.string.plays);
//lengthView.setText(curAlbum.getLength());
}

View File

@ -6,7 +6,7 @@ import android.view.ViewGroup;
import android.widget.GridView;
public class ExpandableHeightGridView extends GridView {
boolean expanded = false;
private boolean expanded = false;
public ExpandableHeightGridView(Context context) {
super(context);
@ -20,7 +20,7 @@ public class ExpandableHeightGridView extends GridView {
super(context, attrs, defStyle);
}
public boolean isExpanded() {
private boolean isExpanded() {
return expanded;
}
@ -38,7 +38,7 @@ public class ExpandableHeightGridView extends GridView {
}
}
public void setExpanded(boolean expanded) {
this.expanded = expanded;
public void expand() {
expanded = true;
}
}

View File

@ -11,7 +11,7 @@ import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.Image;
import android.graphics.Canvas;
import android.os.Build;
import android.os.IBinder;
import android.provider.MediaStore;
@ -29,7 +29,6 @@ import android.os.Bundle;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ListView;
import android.net.Uri;
@ -104,7 +103,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
albumGridView = (ExpandableHeightGridView)findViewById(R.id.album_grid);
AlbumAdapter albumAdt = new AlbumAdapter(this, albumList, false);
albumGridView.setAdapter(albumAdt);
albumGridView.setExpanded(true);
albumGridView.expand();
albumListView = (ListView)findViewById(R.id.album_list);
albumAdt = new AlbumAdapter(this, albumList, true);
@ -129,7 +128,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
LocalBroadcastManager.getInstance(this).registerReceiver(mMessageReceiver, new IntentFilter("musicPrepared"));
}
void selectSection(MenuItem item) {
private void selectSection(MenuItem item) {
ViewFlipper flipper = (ViewFlipper)findViewById(R.id.flipper);
switch (item.getItemId()) {
case (R.id.nav_album):
@ -156,8 +155,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
TextView appTitle = (TextView)findViewById(R.id.app_title);
ConstraintLayout songDetails = (ConstraintLayout)findViewById(R.id.playing_details);
appTitle.setVisibility(View.INVISIBLE);
songDetails.setVisibility(View.VISIBLE);
//Hide the app title and start displaying song info
if (appTitle.getVisibility() == View.VISIBLE) {
appTitle.setVisibility(View.INVISIBLE);
songDetails.setVisibility(View.VISIBLE);
}
TextView mainTitle = (TextView)findViewById(R.id.current_title);
TextView mainArtist = (TextView)findViewById(R.id.current_artist);
@ -170,27 +172,42 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
ContentResolver albumResolver = getContentResolver();
Cursor albumCursor = albumResolver.query(MediaStore.Audio.Albums.EXTERNAL_CONTENT_URI, //Location to grab from
new String[] {MediaStore.Audio.Albums._ID, MediaStore.Audio.Albums.ALBUM_ART}, //Columns to grab
MediaStore.Audio.Albums._ID + "=?", //Selection filter... question marks substitute 4th row args
MediaStore.Audio.Albums._ID + "=?", //Selection filter... question marks substitute 4th row args
new String[] {String.valueOf(albumId)}, //Args for filter
null);
if (albumCursor.moveToFirst()) {
String albumString = albumCursor.getString(albumCursor.getColumnIndex(android.provider.MediaStore.Audio.Albums.ALBUM_ART));
if (albumCursor != null) {
if (albumCursor.moveToFirst()) {
String albumString = albumCursor.getString(albumCursor.getColumnIndex(MediaStore.Audio.Albums.ALBUM_ART));
if (albumString != null) {
File file = new File(albumString);
if (albumString != null) {
File file = new File(albumString);
if (file.exists()) {
if (file.exists()) {
Bitmap albumBmp = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(albumString), 128, 128, false);
RoundedBitmapDrawable albumArt = RoundedBitmapDrawableFactory.create(null, albumBmp);
Bitmap albumBmp = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(albumString), 128, 128, false);
RoundedBitmapDrawable albumArt = RoundedBitmapDrawableFactory.create(null, albumBmp);
albumArt.setCornerRadius(1000.0f);
albumArt.setAntiAlias(true);
albumArt.setCornerRadius(1000.0f);
albumArt.setAntiAlias(true);
albumView.setImageDrawable(albumArt);
albumView.setImageDrawable(albumArt);
//Rounded Bitmap for Notification
Bitmap roundedBmp = Bitmap.createBitmap(128, 128, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(roundedBmp);
albumArt.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
albumArt.draw(canvas);
musicSrv.updateNotification(roundedBmp);
}
else musicSrv.updateNotification(null);
}
else musicSrv.updateNotification(null);
}
else musicSrv.updateNotification(null);
albumCursor.close();
}
}
};
@ -231,7 +248,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
super.onDestroy();
}
public void getSongs() {
private void getSongs() {
ContentResolver musicResolver = getContentResolver();
Uri musicUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
Cursor musicCursor = musicResolver.query(musicUri, null, null, null, null);
@ -258,7 +275,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
}
public void getAlbums() {
private void getAlbums() {
ContentResolver albumResolver = getContentResolver();
Uri albumUri = android.provider.MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
String[]columns = {android.provider.MediaStore.Audio.Albums._ID, android.provider.MediaStore.Audio.Albums.ALBUM_ID,
@ -334,6 +351,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch(item.getItemId()) {
case (R.id.add_pin):
//TODO: Repurpose for adding stuff to nav list
/*NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
MenuItem it = navigationView.getMenu().findItem(R.id.pinned_items);
it.getSubMenu().add(0, 0, 0, "C418").setIcon(R.drawable.ic_jumble);*/
@ -398,21 +416,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
}
public void shuffleAll() {
if (musicBound) {
musicSrv.setShuffle(true);
playList.addAll(songList);
musicSrv.setList(playList);
musicSrv.setSong((int) Math.floor(Math.random() * playList.size()));
musicSrv.playSong();
if (playbackPaused) {
playbackPaused = false;
}
openPlayer();
}
}
public void openPlayer() {
private void openPlayer() {
Intent intent = new Intent(MainActivity.this, PlayerActivity.class);
startActivity(intent);
}

View File

@ -1,15 +0,0 @@
package com.aurailus.caninemusic;
import android.content.Context;
import android.view.View;
import android.widget.MediaController;
public class MusicController extends MediaController {
public MusicController(Context c) {
super(c);
}
public void hide() {
//prevent popup from hiding
}
}

View File

@ -5,15 +5,18 @@ import android.app.PendingIntent;
import android.app.Service;
import android.content.ContentUris;
import android.content.Intent;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.PowerManager;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import android.widget.RemoteViews;
import java.util.ArrayList;
import java.util.Random;
@ -32,6 +35,7 @@ public class MusicService extends Service implements
private Runnable playerStart;
private Handler h;
private boolean prepared = false;
private Intent notIntent;
@Override
public void onCreate() {
@ -47,8 +51,12 @@ public class MusicService extends Service implements
public void run(){
System.out.println("Playback started");
player.start();
prepared = true;
}
};
notIntent = new Intent(this, MainActivity.class);
notIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
}
@Override
@ -81,25 +89,9 @@ public class MusicService extends Service implements
@Override
public void onPrepared(MediaPlayer player) {
prepared = true;
h.removeCallbacks(playerStart);
int delay = 250;
h.postDelayed(playerStart, delay);
Intent notIntent = new Intent(this, MainActivity.class);
notIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendInt = PendingIntent.getActivity(this, 0, notIntent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification.Builder builder = new Notification.Builder(this);
builder.setContentIntent(pendInt)
.setSmallIcon(R.drawable.play)
.setTicker(songTitle)
.setOngoing(true)
.setContentTitle("Playing")
.setContentText(songTitle);
Notification not = builder.build();
startForeground(NOTIFY_ID, not);
Intent intent = new Intent("musicPrepared");
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
}
@ -108,7 +100,7 @@ public class MusicService extends Service implements
this.songs = songs;
}
public void initMusicPlayer() {
private void initMusicPlayer() {
player.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK);
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setOnPreparedListener(this);
@ -127,6 +119,50 @@ public class MusicService extends Service implements
}
}
public void updateNotification(Bitmap albumArt) {
PendingIntent pendInt = PendingIntent.getActivity(this, 0, notIntent, PendingIntent.FLAG_UPDATE_CURRENT);
Notification.Builder builder = new Notification.Builder(this);
RemoteViews view = new RemoteViews(this.getPackageName(), R.layout.notification_view);
RemoteViews bigView = new RemoteViews(this.getPackageName(), R.layout.notification_big_view);
view.setImageViewResource(R.id.noti_prev_button, R.drawable.ic_noti_prev); //Previous button
view.setImageViewResource(R.id.noti_pause_button, R.drawable.ic_noti_pause); //Pause button
view.setImageViewResource(R.id.noti_next_button, R.drawable.ic_noti_next); //Next button
view.setImageViewBitmap(R.id.noti_album_art, albumArt); //Album art
view.setTextViewText(R.id.noti_title, songTitle); //Title
view.setTextViewText(R.id.noti_artist, songArtist); //Artist
bigView.setImageViewResource(R.id.noti_prev_button, R.drawable.ic_noti_prev); //Previous button
bigView.setImageViewResource(R.id.noti_pause_button, R.drawable.ic_noti_pause); //Pause button
bigView.setImageViewResource(R.id.noti_next_button, R.drawable.ic_noti_next); //Next button
bigView.setImageViewBitmap(R.id.noti_album_art, albumArt); //Album art
bigView.setTextViewText(R.id.noti_title, songTitle); //Title
bigView.setTextViewText(R.id.noti_artist, songArtist); //Artist
builder.setContentIntent(pendInt)
.setContentText(songTitle)
.setPriority(Notification.PRIORITY_MAX)
.setWhen(0)
.setSmallIcon(R.drawable.ic_play)
.setTicker(songTitle)
.setContentTitle("Playing " + songTitle);
if (Build.VERSION.SDK_INT < 24) {
//noinspection deprecation
builder.setContent(view);
}
else {
builder.setCustomContentView(view);
builder.setCustomBigContentView(bigView);
}
Notification not = builder.build();
startForeground(NOTIFY_ID, not);
}
public void playSong(){
player.reset();
prepared = false;
@ -142,6 +178,7 @@ public class MusicService extends Service implements
catch(Exception e) {
Log.e("MUSIC SERVICE", "Error setting data source", e);
}
h.removeCallbacks(playerStart);
player.prepareAsync();
}

View File

@ -32,7 +32,6 @@ public class PlayerActivity extends AppCompatActivity implements SeekBar.OnSeekB
private TextView artistView;
private TextView lengthView;
private TextView timeView;
private Bitmap albumArt;
private ImageView albumView;
private ImageButton playPauseButton;
private boolean seekInteracting = false;
@ -147,17 +146,19 @@ public class PlayerActivity extends AppCompatActivity implements SeekBar.OnSeekB
new String[] {String.valueOf(albumId)}, //Args for filter
null);
if (albumCursor.moveToFirst()) {
if (albumCursor != null && albumCursor.moveToFirst()) {
String albumString = albumCursor.getString(albumCursor.getColumnIndex(android.provider.MediaStore.Audio.Albums.ALBUM_ART));
if (albumString != null) {
File file = new File(albumString);
if (file.exists()) {
albumArt = Bitmap.createBitmap(BitmapFactory.decodeFile(albumString));
Bitmap albumArt = Bitmap.createBitmap(BitmapFactory.decodeFile(albumString));
albumView.setImageBitmap(albumArt);
}
}
albumCursor.close();
}
}
private void updatePlayer() {

View File

@ -2,7 +2,7 @@ package com.aurailus.caninemusic;
import java.util.Locale;
public class Song {
class Song {
private long id, duration;
private String title, artist, albumId, humanLength;

View File

@ -9,13 +9,21 @@ import java.util.ArrayList;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
public class SongAdapter extends BaseAdapter {
class SongAdapter extends BaseAdapter {
private ArrayList<Song> songs;
private ArrayList<Album> albumart;
private LayoutInflater songInf;
static class ViewHolder {
TextView songView;
TextView artistView;
TextView songDuration;
ImageView albumArtView;
}
@Override
public int getCount() {
return songs.size();
@ -34,29 +42,41 @@ public class SongAdapter extends BaseAdapter {
@Override
public View getView(int ind, View convertView, ViewGroup parent) {
ConstraintLayout songLay = (ConstraintLayout)songInf.inflate(R.layout.song, parent, false);
TextView songView = (TextView)songLay.findViewById(R.id.song_title);
TextView artistView = (TextView)songLay.findViewById(R.id.song_artist);
ImageView albumArtView = (ImageView)songLay.findViewById(R.id.album_art);
TextView songDuration = (TextView)songLay.findViewById(R.id.song_duration);
ViewHolder holder;
if (convertView == null) {
convertView = songInf.inflate(R.layout.song, parent, false);
holder = new ViewHolder();
holder.songView = (TextView)convertView.findViewById(R.id.song_title);
holder.artistView = (TextView)convertView.findViewById(R.id.song_artist);
holder.albumArtView = (ImageView)convertView.findViewById(R.id.album_art);
holder.songDuration = (TextView)convertView.findViewById(R.id.song_duration);
convertView.setTag(holder);
}
else {
holder = (ViewHolder) convertView.getTag();
}
Song curSong = songs.get(ind);
songView.setText(curSong.getTitle());
artistView.setText(curSong.getArtist());
songDuration.setText(curSong.getHumanLength());
holder.songView.setText(curSong.getTitle());
holder.artistView.setText(curSong.getArtist());
holder.songDuration.setText(curSong.getHumanLength());
for(Album curAlbum : albumart) {
if (curAlbum.getId().equals(curSong.getAlbumId())) {
if (!curAlbum.getEmpty()) {
Drawable img = curAlbum.getImage();
albumArtView.setImageDrawable(img);
holder.albumArtView.setImageDrawable(img);
break;
}
}
}
songLay.setTag(ind);
return songLay;
//TODO: Fix tag issue its breaking tapping the song to play
//songLay.setTag(ind);
return convertView;
}
public SongAdapter(Context c, ArrayList<Song> songs) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,9 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/>
</vector>

View File

@ -0,0 +1,12 @@
<vector android:height="24dp" android:viewportHeight="150.0"
android:viewportWidth="150.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#b9b9b9"
android:pathData="M75,75m-75,0a75,75 0,1 1,150 0a75,75 0,1 1,-150 0" android:strokeWidth="0.26852155"/>
<path android:fillAlpha="1" android:fillColor="?android:attr/colorBackground"
android:pathData="M28.28,55.53l64.9,0l0,64.9l-64.9,0z"
android:strokeAlpha="0" android:strokeColor="#00000000" android:strokeWidth="0"/>
<path android:fillAlpha="0" android:fillColor="?android:attr/colorBackground"
android:pathData="M113.6,60.01A23.37,22.98 90,0 1,90.62 83.38,23.37 22.98,90 0,1 67.64,60.01 23.37,22.98 90,0 1,90.62 36.64,23.37 22.98,90 0,1 113.6,60.01Z"
android:strokeAlpha="1" android:strokeColor="?android:attr/colorBackground"
android:strokeLineJoin="round" android:strokeWidth="27.97900009"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector android:height="24dp" android:viewportHeight="150.0"
android:viewportWidth="150.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M41.88,108.56 L94.25,75.05C76.8,63.89 59.35,52.72 41.89,41.56Z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="0.21653356"/>
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M95.16,41.56h14.53v67h-14.53z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="5.24107981"/>
</vector>

View File

@ -0,0 +1,11 @@
<vector android:height="24dp" android:viewportHeight="150.0"
android:viewportWidth="150.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M46.1,39.38h20.85v71.6h-20.85z"
android:strokeAlpha="0" android:strokeColor="#000000"
android:strokeLineJoin="miter" android:strokeWidth="0"/>
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M84.22,39.38h20.85v71.6h-20.85z"
android:strokeAlpha="0" android:strokeColor="#000000"
android:strokeLineJoin="miter" android:strokeWidth="0"/>
</vector>

View File

@ -0,0 +1,10 @@
<vector android:height="24dp" android:viewportHeight="150.0"
android:viewportWidth="150.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#fefefe"
android:pathData="M108.52,109.15 L56.15,75.65C73.6,64.48 91.06,53.32 108.51,42.15Z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="butt" android:strokeLineJoin="miter" android:strokeWidth="0.43306711"/>
<path android:fillAlpha="1" android:fillColor="#fefefe"
android:pathData="M55.24,42.15l-14.53,0l0,67l14.53,0z"
android:strokeAlpha="1" android:strokeColor="#00000000" android:strokeWidth="10.48215961"/>
</vector>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,12 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
android:layout_height="match_parent">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
@ -82,7 +79,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:clickable="true"
app:elevation="4dp"
app:fabSize="normal"

View File

@ -61,7 +61,7 @@
android:layout_height="50dp"
android:layout_marginBottom="20dp"
android:layout_marginEnd="12dp"
android:background="@drawable/ripple_oval_dark"
android:background="@drawable/ripple_oval"
android:contentDescription="@string/shuffle_state"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"
@ -84,7 +84,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"
app:layout_constraintRight_toLeftOf="@+id/button_playpause"
app:srcCompat="@drawable/ripple_oval_dark"/>
app:srcCompat="@drawable/ripple_oval"/>
<ImageButton
android:id="@+id/button_playpause"
@ -121,7 +121,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"
app:layout_constraintLeft_toRightOf="@+id/button_playpause"
app:srcCompat="@drawable/ripple_oval_dark"/>
app:srcCompat="@drawable/ripple_oval"/>
<ImageButton
android:id="@+id/button_repeat"
@ -129,7 +129,7 @@
android:layout_height="50dp"
android:layout_marginBottom="20dp"
android:layout_marginStart="12dp"
android:background="@drawable/ripple_oval_dark"
android:background="@drawable/ripple_oval"
android:contentDescription="@string/repeat_state"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="w,1:1"

View File

@ -1,15 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_rectangle"
android:clickable="true"
android:clipChildren="false"
android:onClick="chooseAlbum"
android:orientation="vertical"
android:weightSum="1">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_rectangle"
android:clickable="true"
android:clipChildren="false"
android:onClick="chooseAlbum"
android:orientation="vertical"
android:weightSum="1">
<android.support.constraint.ConstraintLayout
android:layout_width="0dp"
@ -35,7 +34,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_album"/>
app:srcCompat="@drawable/ic_album_unknown"/>
<!--<ImageButton
android:id="@+id/overflow"
@ -48,7 +47,7 @@
android:elevation="0dp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ripple_oval_dark"
app:srcCompat="@drawable/ripple_oval"
/>-->
</android.support.constraint.ConstraintLayout>

View File

@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_rectangle"
android:clickable="true"
android:onClick="chooseAlbum"
android:orientation="vertical"
android:weightSum="1">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_rectangle"
android:clickable="true"
android:onClick="chooseAlbum"
android:orientation="vertical"
android:weightSum="1">
<ImageView
android:id="@+id/album_art"
@ -24,7 +23,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ic_album" />
app:srcCompat="@drawable/ic_album_unknown" />
<TextView
android:id="@+id/album_title"
@ -50,7 +49,6 @@
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginStart="8dp"
android:ellipsize="end"
android:maxLines="1"
android:minLines="1"
android:scrollHorizontally="true"
@ -62,7 +60,6 @@
app:layout_constraintLeft_toRightOf="@+id/album_art"
app:layout_constraintTop_toBottomOf="@+id/album_title"
app:layout_constraintVertical_bias="0.0"
android:layout_marginLeft="8dp"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintHorizontal_chainStyle="packed"/>
@ -120,6 +117,6 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5"
app:srcCompat="@drawable/ripple_oval_dark" />
app:srcCompat="@drawable/ripple_oval" />
</android.support.constraint.ConstraintLayout>

View File

@ -1,7 +1,5 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -13,7 +11,7 @@
<android.support.constraint.ConstraintLayout
android:id="@+id/main_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@drawable/ripple_rectangle_light"
android:clickable="true"
@ -23,6 +21,7 @@
<ImageButton
android:id="@+id/open_drawer"
android:contentDescription="@string/drawer"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
@ -41,6 +40,7 @@
<ImageView
android:id="@+id/current_albumart"
android:contentDescription="@string/album_art"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="4dp"

View File

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="120dp"
android:background="@color/notificationDark"
android:orientation="horizontal"
android:weightSum="1">
<ImageView
android:id="@+id/noti_album_art"
android:contentDescription="@string/album_art"
android:layout_width="104dp"
android:layout_height="104dp"
android:layout_gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
app:srcCompat="@drawable/ic_album_unknown" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="top"
android:layout_marginTop="16dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/noti_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="12dp"
android:lines="1"
android:textSize="18sp"
android:text="@string/unknown_data"
android:textColor="#ffffff"
tools:text="Song Title" />
<TextView
android:id="@+id/noti_artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="12dp"
android:lines="1"
android:text="@string/unknown_data"
android:textColor="#ffffff"
tools:text="Song Artist" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="4dp"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageButton
android:id="@+id/noti_prev_button"
android:contentDescription="@string/previous_song"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:background="@drawable/ripple_rectangle_light"
android:scaleType="fitCenter"
android:layout_weight="1"
app:srcCompat="@drawable/ic_play_prev" />
<ImageButton
android:id="@+id/noti_pause_button"
android:contentDescription="@string/play_pause"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:background="@drawable/ripple_rectangle_light"
android:scaleType="fitCenter"
android:layout_weight="1"
app:srcCompat="@drawable/ic_pause" />
<ImageButton
android:id="@+id/noti_next_button"
android:contentDescription="@string/next_song"
android:layout_weight="1"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:background="@drawable/ripple_rectangle_light"
android:scaleType="fitCenter"
app:srcCompat="@drawable/ic_play_next" />
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="64dp"
android:background="@color/notificationDark"
android:orientation="horizontal"
android:weightSum="1">
<ImageView
android:id="@+id/noti_album_art"
android:contentDescription="@string/album_art"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginBottom="8dp"
android:layout_marginStart="4dp"
android:layout_marginTop="8dp"
app:srcCompat="@drawable/ic_album_unknown" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/noti_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="12dp"
android:lines="1"
android:text="@string/unknown_data"
android:textColor="#ffffff"
tools:text="Song Title" />
<TextView
android:id="@+id/noti_artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:layout_marginStart="12dp"
android:lines="1"
android:text="@string/unknown_data"
android:textColor="#ffffff"
tools:text="Song Artist" />
</LinearLayout>
<ImageButton
android:id="@+id/noti_prev_button"
android:contentDescription="@string/previous_song"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:background="@drawable/ripple_oval_light"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_play_prev" />
<ImageButton
android:id="@+id/noti_pause_button"
android:contentDescription="@string/play_pause"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:background="@drawable/ripple_oval_light"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_pause" />
<ImageButton
android:id="@+id/noti_next_button"
android:contentDescription="@string/next_song"
android:layout_width="46dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:background="@drawable/ripple_oval_light"
android:scaleType="fitXY"
app:srcCompat="@drawable/ic_play_next" />
</LinearLayout>

View File

@ -1,12 +1,10 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:elevation="5dp"
android:id="@+id/layout" >
android:id="@+id/layout">
<android.support.constraint.ConstraintLayout
android:id="@+id/player_toolbar"

View File

@ -1,12 +1,10 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:elevation="5dp"
android:id="@+id/layout" >
android:id="@+id/layout">
<android.support.constraint.ConstraintLayout
android:id="@+id/player_toolbar"

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/ripple_rectangle"
@ -24,7 +23,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/ic_album" />
app:srcCompat="@drawable/ic_album_unknown" />
<TextView
android:id="@+id/song_title"
@ -98,6 +97,6 @@
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.5"
app:srcCompat="@drawable/ripple_oval_dark" />
app:srcCompat="@drawable/ripple_oval" />
</android.support.constraint.ConstraintLayout>

View File

@ -42,7 +42,6 @@
android:layout_height="wrap_content"
android:text="@string/albums"
android:textAppearance="@style/TextAppearance.AppCompat.Large"
android:layout_marginLeft="16dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginBottom="8dp"
@ -65,12 +64,13 @@
<ImageButton
android:id="@+id/albumViewSwitch"
android:contentDescription="@string/switch_views"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginBottom="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/ripple_oval_dark"
android:background="@drawable/ripple_oval"
android:elevation="0dp"
android:onClick="switchAlbumView"
android:scaleType="fitXY"

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"

View File

@ -1,19 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/song_list"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:layout_marginTop="0dp"
android:clipChildren="true"
android:dividerHeight="1sp"
app:layout_constraintBottom_toBottomOf="parent"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

View File

@ -4,4 +4,5 @@
<color name="colorPrimaryDark">#118888</color>
<color name="colorAccent">#FF4081</color>
<color name="categoryColor">#777777</color>
<color name="notificationDark">#333333</color>
</resources>

View File

@ -1,8 +0,0 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="nav_header_vertical_spacing">16dp</dimen>
<dimen name="nav_header_height">160dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>

View File

@ -2,6 +2,7 @@
<string name="app_name">Canine</string>
<string name="title_activity_main">Canine Music</string>
<string name="back">Back</string>
<string name="drawer">Drawer</string>
<string name="playing">Currently Playing</string>
<string name="title_activity_player">Player</string>
@ -14,6 +15,7 @@
<string name="shuffle_state">Shuffle</string>
<string name="repeat_state">Repeat</string>
<string name="overflow">Overflow</string>
<string name="plays">Plays</string>
<string name="nav_id3">ID3 Tagger</string>
<string name="nav_settings">Settings</string>
@ -34,6 +36,7 @@
<string name="grid_mode">Grid View</string>
<string name="list_mode">List View</string>
<string name="switch_views">Switch Views</string>
<string name="action_settings">Settings</string>
<string name="title_activity_queue">Queue</string>