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

Commit

Permalink
First commit ; version 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vhaudiquet committed May 5, 2018
0 parents commit e45345c
Show file tree
Hide file tree
Showing 192 changed files with 2,746 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
34 changes: 34 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "v.blade"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile project(':libraries:drag-sort-listview:library')
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:design:+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:+'
compile 'com.android.support:recyclerview-v7:+'
testCompile 'junit:junit:4.12'
}
25 changes: 25 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/valentin/Programmes/android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
60 changes: 60 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="v.blade">

<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.MEDIA_CONTENT_CONTROL"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".ui.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@style/AppTheme.NoActionBar">
<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable"/>

<intent-filter>
<action android:name="android.intent.action.SEARCH"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".ui.PlayActivity"
android:label="@string/title_activity_play"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity android:name=".ui.SettingsActivity"
android:label="@string/action_settings"
android:theme="@style/AppTheme.NoActionBar">
</activity>

<service
android:name=".player.PlayerService"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON"/>
</intent-filter>
</service>

<receiver android:name="android.support.v4.media.session.MediaButtonReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON"/>
</intent-filter>
</receiver>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions app/src/main/java/v/blade/library/Album.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Blade - Android music player
* Copyright (C) 2018 Valentin HAUDIQUET
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package v.blade.library;

import android.graphics.Bitmap;

import java.util.ArrayList;

public class Album extends LibraryObject
{
private ArrayList<Song> songs;
private Artist artist;
private long id;

public Album(String name, Artist artist, long id)
{
this.artist = artist;
this.name = name;
this.id = id;
this.songs = new ArrayList<Song>();
}

public ArrayList<Song> getSongs() {return songs;}
public Artist getArtist() {return artist;}
public long getId() {return id;}
public Bitmap getAlbumArt() {return art;}

public void addSong(Song song) {this.songs.add(song);}
public void setAlbumArt(Bitmap b) {this.art = b;}
}
49 changes: 49 additions & 0 deletions app/src/main/java/v/blade/library/Artist.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Blade - Android music player
* Copyright (C) 2018 Valentin HAUDIQUET
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package v.blade.library;

import java.util.ArrayList;

public class Artist extends LibraryObject
{
private ArrayList<Album> albums;
private long id;

public Artist(String name, long id)
{
this.name = name;
this.albums = new ArrayList<Album>();
this.id = id;
}

public ArrayList<Album> getAlbums() {return albums;}

public void addAlbum(Album album) {this.albums.add(album);}

public int getSongCount()
{
int songCount = 0;

for(int i=0;i<albums.size();i++)
{
songCount += albums.get(i).getSongs().size();
}

return songCount;
}
}
29 changes: 29 additions & 0 deletions app/src/main/java/v/blade/library/LibraryObject.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Blade - Android music player
* Copyright (C) 2018 Valentin HAUDIQUET
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package v.blade.library;

import android.graphics.Bitmap;

public class LibraryObject
{
protected String name;
protected Bitmap art;

public String getName() {return this.name;}
@Override public String toString() {return this.name;}
}
35 changes: 35 additions & 0 deletions app/src/main/java/v/blade/library/Playlist.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Blade - Android music player
* Copyright (C) 2018 Valentin HAUDIQUET
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package v.blade.library;

import java.util.ArrayList;

public class Playlist extends LibraryObject
{
private long id;
private ArrayList<Song> content;

public Playlist(long id, String name, ArrayList<Song> content)
{
this.id = id;
this.name = name;
this.content = content;
}

public ArrayList<Song> getContent() {return content;}
}
43 changes: 43 additions & 0 deletions app/src/main/java/v/blade/library/Song.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* Blade - Android music player
* Copyright (C) 2018 Valentin HAUDIQUET
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package v.blade.library;

public class Song extends LibraryObject
{
private long id;
private Artist artist;
private Album album;
private int track;
long duration;

public Song(long id, String title, Artist artist, Album album, int albumTrack, long duration)
{
this.id = id;
this.name = title;
this.artist = artist;
this.album = album;
this.track = albumTrack;
}

public long getId() {return id;}
public String getTitle() {return getName();}
public Artist getArtist() {return artist;}
public Album getAlbum() {return album;}
public int getTrackNumber() {return track;}
public long getDuration() {return duration;}
}

0 comments on commit e45345c

Please sign in to comment.