Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-zinnatullin committed Jan 20, 2015
2 parents 783565e + 3036fb6 commit 9b1ef9b
Show file tree
Hide file tree
Showing 170 changed files with 3,895 additions and 1,875 deletions.
18 changes: 9 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ before_install:
# Install required components
- echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
- echo yes | android update sdk --all --filter build-tools-20.0.0 --no-ui --force > /dev/null
- echo yes | android update sdk --filter android-20 --no-ui --force > /dev/null
- echo yes | android update sdk --filter android-19 --no-ui --force > /dev/null
- echo yes | android update sdk --filter android-21 --no-ui --force > /dev/null
- echo yes | android update sdk --all --filter sys-img-armeabi-v7a-android-19 --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null

install:
- ./gradlew assembleRelease --info

before_script:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
- emulator -avd test -no-skin -no-audio -no-window &
- adb wait-for-device
- adb shell input keyevent 82 &
# before_script:
# - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
# - emulator -avd test -no-skin -no-audio -no-window &
# - adb wait-for-device
# - adb shell input keyevent 82 &

script:
- ./gradlew connectedAndroidTest --info
# TODO: make tests work on Travis CI
# script:
# - ./gradlew connectedAndroidTest --info
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,25 @@

*Main* ***develop*** branch build status [on Travis CI](https://travis-ci.org/artem-zinnatullin/android-wail-app): [![Build Status](https://travis-ci.org/artem-zinnatullin/android-wail-app.svg?branch=develop)](https://travis-ci.org/artem-zinnatullin/android-wail-app)

***Also, here is tasks dashboard on Waffie.io*** -> [Tasks Dashboard](https://waffle.io/artem-zinnatullin/android-wail-app): [![Tasks ready to work on](https://badge.waffle.io/artem-zinnatullin/android-wail-app.png?label=ready&title=Ready)](https://waffle.io/artem-zinnatullin/android-wail-app)

**How it looks:**

<img src="screenshots/screenshot_1.png" alt="Main screen" height="500px"/>
&nbsp;<img src="screenshots/screenshot_2.png" alt="Captured tracks list" height="500px"/>
<img src="screenshots/dark_main.png" alt="Main screen" height="400px"/>
&nbsp;<img src="screenshots/dark_tracks.png" alt="Captured tracks list" height="400px"/>
&nbsp;<img src="screenshots/dark_settings.png" alt="Settings screen" height="400px"/>

<img src="screenshots/screenshot_3.png" alt="Settings screen" height="500px"/>
&nbsp;<img src="screenshots/screenshot_4.png" alt="Sound notifications" height="500px"/>
<img src="screenshots/light_main.png" alt="Main screen" height="400px"/>
&nbsp;<img src="screenshots/light_tracks.png" alt="Captured tracks list" height="400px"/>
&nbsp;<img src="screenshots/light_settings.png" alt="Settings screen" height="400px"/>

##Main features:
* Scrobbling tracks to the last.fm (even if you are offline, WAIL will send them later)
* Updating #nowplaying
* Sound notifications
* Status bar notifications
* "Love" track
* Option to ignore any player
* Light and dark theme
* English, German and Russian languages

-------------------
###BEFORE CONTRIBUTING TO THE WAIL APP!
Expand All @@ -31,6 +36,6 @@ Please read small wiki about commits style guides, git work flow and sources sty
-------------------
Questions and answers:

* Why repo has small amount of commits? — Because original repo has my personal data, which I decided to remove before making WAIL Open Source. I decided to not use git filter-branch or bfg to delete these files, so I just created new repo with source code. Sorry guys, about ~250 commits losted...
* Why repo has small amount of commits? — Because original repo has my personal data, which I decided to remove before making WAIL Open Source. I decided to not use git filter-branch or bfg to delete these files, so I just created new repo with source code. Sorry guys, about ~250 commits were lost...
* Why you have last.fm secret api keys in Open Source project? — Just because it's very easy to decompile the apk and get them from it, so, please do not use them for evil purposes :)
* Will WAIL be released to Google Play with your fixes? — YES, of course! This is the main purpose of making WAIL Open Source project, I have no time to work on it, so I hope you will help WAIL!
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:0.12.0'
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jul 11 02:03:02 MSK 2014
#Fri Dec 19 21:34:30 MSK 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
Binary file added screenshots/dark_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/dark_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/dark_tracks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/light_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/light_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/light_tracks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed screenshots/screenshot_1.png
Binary file not shown.
Binary file removed screenshots/screenshot_2.png
Binary file not shown.
Binary file removed screenshots/screenshot_3.png
Binary file not shown.
Binary file removed screenshots/screenshot_4.png
Binary file not shown.
1 change: 1 addition & 0 deletions wail-app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
build/
custom_env.gradle
52 changes: 36 additions & 16 deletions wail-app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,45 +1,60 @@
// for applying custom environment properties
if (new File('wail-app/custom_env.gradle').exists()) {
apply from: 'custom_env.gradle'
}

apply plugin: 'com.android.application'

repositories {
mavenCentral()
}

android {
compileSdkVersion 20
compileSdkVersion 21
buildToolsVersion '20.0.0'

defaultConfig {
minSdkVersion 14
targetSdkVersion 20
versionCode 22
versionName '0.6.4 beta'
targetSdkVersion 21
versionCode 24
versionName '0.7.0 beta'
}

packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
lintOptions {
disable 'InvalidPackage'
}

signingConfigs {
release
googlePlay
}

buildTypes {
debug {
versionNameSuffix ' debug ' + getDateForVersionName()
signingConfig signingConfigs.googlePlay
}

release {
signingConfig signingConfigs.release
signingConfig signingConfigs.googlePlay
}
}

if (project.hasProperty('signingConfig.storeFile')
&& project.hasProperty('signingConfig.storePassword')
&& project.hasProperty('signingConfig.keyAlias')
&& project.hasProperty('signingConfig.keyPassword')
if (project.hasProperty('signingConfigStoreFile')
&& project.hasProperty('signingConfigStorePassword')
&& project.hasProperty('signingConfigKeyAlias')
&& project.hasProperty('signingConfigKeyPassword')
) {
android.signingConfigs.release.storeFile = file(project.getProperty('signingConfig.storeFile'))
android.signingConfigs.release.storePassword = project.getProperty('signingConfig.storePassword')
android.signingConfigs.release.keyAlias = project.getProperty('signingConfig.keyAlias')
android.signingConfigs.release.keyPassword = project.getProperty('signingConfig.keyPassword')
android.signingConfigs.googlePlay.storeFile = file(project.ext['signingConfigStoreFile'])
android.signingConfigs.googlePlay.storePassword = project.ext['signingConfigStorePassword']
android.signingConfigs.googlePlay.keyAlias = project.ext['signingConfigKeyAlias']
android.signingConfigs.googlePlay.keyPassword = project.ext['signingConfigKeyPassword']
} else {
buildTypes.release.signingConfig = null
buildTypes.all { bt ->
bt.signingConfig = null
}
}
}

Expand All @@ -48,7 +63,12 @@ dependencies {
// because gradle can automatically load newer version which can add bugs and have to be tested

compile 'com.android.support:support-v13:20.0.0'
compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.9.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.melnykov:floatingactionbutton:1.1.0'
compile 'com.rengwuxian.materialedittext:library:1.7.1'
compile 'com.jakewharton:butterknife:5.1.2'

compile fileTree(dir: 'libs', include: '*.jar')
}
Expand Down
6 changes: 6 additions & 0 deletions wail-app/custom_env.gradle.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// sample file for setting custom environment params
// rename it to custom_env.gradle and our build.gradle will apply it

project.ext {
customProperty = 'customValue'
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,11 @@ public void testGetIntentAsStringNoExtras() {
}

public void testGetIntentAsString() {
assertEquals("Intent action: null, extras: (1, value1), (3, 4), ", IntentUtil.getIntentAsString(new Intent()
String intentAsString = IntentUtil.getIntentAsString(new Intent()
.putExtra("1", "value1")
.putExtra("3", 4))
);
.putExtra("3", 4));
assertTrue(intentAsString.contains("Intent action: null, extras: "));
assertTrue(intentAsString.contains("(1, value1)"));
assertTrue(intentAsString.contains("(3, 4)"));
}
}
27 changes: 22 additions & 5 deletions wail-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.artemzin.android.wail"
android:versionCode="21"
android:versionName="0.6.3 beta">
package="com.artemzin.android.wail">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand All @@ -12,8 +10,7 @@
android:name=".WAILApp"
android:allowBackup="true"
android:icon="@drawable/wail_launcher_icon"
android:label="@string/app_name"
android:theme="@style/AppTheme.Dark">
android:label="@string/app_name">

<activity
android:name=".ui.activity.MainActivity"
Expand All @@ -33,11 +30,26 @@
android:windowSoftInputMode="stateHidden|adjustResize"
android:label="@string/lastfm_login_activity_label" />

<activity
android:name=".ui.activity.settings.SettingsSelectLanguageActivity"
android:windowSoftInputMode="stateHidden"
android:label="@string/settings_select_language_activity_label" />

<activity
android:name=".ui.activity.settings.SettingsIgnoredPlayersActivity"
android:windowSoftInputMode="stateHidden"
android:label="@string/settings_ignored_players_activity_label" />

<activity
android:name=".ui.activity.settings.SettingsSoundNotificationsActivity"
android:windowSoftInputMode="stateHidden"
android:label="@string/settings_sound_notifications_activity_label" />

<activity
android:name=".ui.activity.settings.SettingsStatusBarNotificationsActivity"
android:windowSoftInputMode="stateHidden"
android:label="@string/settings_status_bar_notifications_activity_label" />

<service
android:name=".service.WAILService"
android:enabled="true"
Expand Down Expand Up @@ -74,6 +86,11 @@
</intent-filter>
</receiver>

<receiver
android:name=".receiver.NotificationActionsReceiver"
android:enabled="true"
android:exported="false"/>

<!-- music apps receivers -->

<receiver
Expand Down
14 changes: 9 additions & 5 deletions wail-app/src/main/java/com/artemzin/android/wail/WAILApp.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
package com.artemzin.android.wail;

import android.app.Application;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.AsyncTask;
import android.os.SystemClock;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.TaskStackBuilder;

import com.artemzin.android.wail.service.WAILService;
import com.artemzin.android.wail.storage.WAILSettings;
import com.artemzin.android.wail.storage.db.PlayersDBHelper;
import com.artemzin.android.wail.ui.activity.MainActivity;
import com.artemzin.android.wail.util.AsyncTaskExecutor;
import com.artemzin.android.wail.util.LocaleUtil;
import com.artemzin.android.wail.util.Loggi;
import com.google.analytics.tracking.android.EasyTracker;
import com.google.analytics.tracking.android.MapBuilder;
Expand All @@ -23,11 +20,18 @@ public class WAILApp extends Application {

@Override
public void onCreate() {
LocaleUtil.updateLanguage(this, null);
super.onCreate();
Loggi.w("WAILApp onCreate()");
updateSupportedPlayersDB();
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
LocaleUtil.updateLanguage(this, WAILSettings.getLanguage(this));
}

private void updateSupportedPlayersDB() {
AsyncTaskExecutor.executeConcurrently(new AsyncTask<Void, Void, Void>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,20 @@ public static String updateNowPlaying(String sessionKey, String apiKey, String s
requestParams.generateRequestParamsAsStringWithSign()
).getResponse();
}

public static String love(String sessionKey, String apiKey, String secret, LFTrackRequestModel track)
throws NetworkException {
LFRequestParamContainer requestParams = new LFRequestParamContainer("track.love", secret);

requestParams.addParam("artist", track.getArtist());
requestParams.addParam("track", track.getTrack());

requestParams.addParam(LFApiCommon.PARAM_API_KEY, apiKey);
requestParams.addParam(LFApiCommon.PARAM_SK, sessionKey);

return NetworkRequest.newPostRequestInstance(
LFApiCommon.API_ROOT_URL,
requestParams.generateRequestParamsAsStringWithSign()
).getResponse();
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.artemzin.android.wail.sound;
package com.artemzin.android.wail.notifications;

import android.content.Context;
import android.media.MediaPlayer;
Expand Down
Loading

0 comments on commit 9b1ef9b

Please sign in to comment.