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

Commit

Permalink
Merge pull request #468 from a93-39a/master
Browse files Browse the repository at this point in the history
Themes and Bug Fixes
  • Loading branch information
Austin H authored Aug 9, 2019
2 parents a5b85d1 + 61d9984 commit 1f9d29e
Show file tree
Hide file tree
Showing 68 changed files with 1,216 additions and 268 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,28 @@ Before the release of a new version of SLS, it will be available here to test fo
* [Enable/Disable Individual Music App Scrobbles](https://github.com/tgwizard/sls/issues/200) [Similar Issue](https://github.com/tgwizard/sls/issues/367)
* [Blocking Podcast Scrobbles](https://github.com/tgwizard/sls/issues/127)
* Read Notifications to Scrobble Music Also
* Slow overhaul of the app to keep simplicity and allow for dynamic feature addition.
* Slow overhaul of the app to keep simplicity and allow for dynamic feature/functionality addition.

3. #### Core Feature Requests

* [True Material Design Upgrade](https://github.com/tgwizard/sls/issues/227)
* [Better Unit Tests](https://github.com/tgwizard/sls/issues/12)
* [Notification Level](https://github.com/tgwizard/sls/issues/346)
* Unsecured http:// support for custom servers

* ListenBrainz API for Total Listen Count
* Multiple Account Login
* Sequential storage of all tracks, scrobbled, skipped, hearted, and failed with explanations
* markers in scrobble cache for logged in accounts
* Store scrobbles before user is logged in

## Features

* Scrobbling
* Now playing notifications
* Power-saving settings
* Caching scrobbles (while offline or through settings)
* Editing scrobble cache
* Auto-correct scrobbles
* More

### Supported languages
Expand Down
38 changes: 3 additions & 35 deletions TroubleShooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TroubleShooting (SLS = simple last.fm scrobbler)

Solutions To Common problems.
-----------------------------

1. Clear credentials and log in again.
2. Check if you have other scrobbling apps open. (this can sometimes be the problem)
3. Check your phone's time is automatic.
Expand All @@ -30,6 +30,7 @@ Can't Connect?
2. Check if you can login to last.fm from your phone.
3. Check if Last.fm is up http://status.last.fm/
4. Check if Libre.fm is up https://twitter.com/librefm
5. Check if ListenBrainz is up https://listenbrainz.org/current-status


Losing Scrobbles?
Expand All @@ -54,38 +55,5 @@ Losing Scrobbles?
--------------------------------------------------------------------------------------------


Know Issue: Compatibility vs. Structure
[Know Issues & Core Tasks](https://github.com/a93-39a/sls#core-tasks)
---------------------------------------

##Two major conflicting issues.

SLS tries to provide support for a person to have many apps downloaded and scrobble from without broadcast clashes.

### Conflict

SLS provides support for a variety of applications.

OR

SLS provides support for single track repeat and more structured scrobbling.


##Reasons for conflict issues

Some of these applications don't share track duration (well).

AND

Some of these applications don't tell SLS when the track is paused or completed, so SLS cannot find out when the track officially started or finished.

AND

Some of these applications have mixed broadcasts for SLS, Android Music Player, and Scrobble Droid.


Developer's Job
---------------

I am manually going through all the applications to see which ones don't work with a more compatible and structured scrobbling service.

The current Queue method works for now.
7 changes: 5 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ android {
applicationId "com.adam.aslfms"
minSdkVersion 9
targetSdkVersion 25
versionCode=49
versionName="1.5.8"

testApplicationId "com.adam.aslfms.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
Expand All @@ -25,8 +27,9 @@ android {

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Expand Down
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-dontobfuscate
2 changes: 1 addition & 1 deletion app/src/androidTest/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="en">
<string name="hello">Hello World!</string>
<string name="app_name">SLS Tests</string>
</resources>
31 changes: 10 additions & 21 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.adam.aslfms"
android:versionCode="49"
android:versionName="1.5.8">

<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
package="com.adam.aslfms">

<uses-feature
android:name="android.hardware.touchscreen"
Expand All @@ -26,12 +16,12 @@
android:description="@string/about_text"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat">
android:theme="@style/AppTheme">

<!-- the start/launch activity -->
<activity
android:name=".SettingsActivity"
android:icon="@mipmap/ic_launcher"
android:icon="@drawable/ic_icon_full"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -99,6 +89,13 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".SettingsActivity" />
</activity>

<activity android:name=".ChangeThemeActivity"
android:parentActivityName=".SettingsActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".SettingsActivity" />
</activity>

<!-- the services -->
<service
Expand Down Expand Up @@ -325,14 +322,6 @@
<action android:name="com.android.mediacenter.metachanged" />
</intent-filter>
</receiver>

<!--
- will probably interfere badly with Winamp <receiver android:name="com.adam.aslfms.receiver.LastFmAPIReceiver"
android:exported="true" android:enabled="true"> <intent-filter> <action android:name="fm.last.android.metachanged"
/> <action android:name="fm.last.android.playbackpaused" /> <action android:name="fm.last.android.playbackcomplete"
/> </intent-filter> </receiver>
-->

</application>

</manifest>
15 changes: 15 additions & 0 deletions app/src/main/java/com/adam/aslfms/AppleMusicOptionsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.provider.Settings;
import android.support.v4.app.NavUtils;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.MenuItem;

import com.adam.aslfms.service.applemusic.NotificationService;
Expand All @@ -22,10 +24,22 @@

public class AppleMusicOptionsActivity extends AppCompatPreferenceActivity {

private static final String TAG = "AppleMusicActivity";

CheckBoxPreference notificationListeningCbp;
CheckBoxPreference repeatsCbp;
AppSettings settings;

@Override
public Resources.Theme getTheme() {
settings = new AppSettings(this);
Resources.Theme theme = super.getTheme();
theme.applyStyle(settings.getAppTheme(), true);
Log.e(TAG, getResources().getResourceName(settings.getAppTheme()));
// you could also use a switch if you have many themes that could apply
return theme;
}

@Override
@SuppressWarnings("deprecation")
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -42,6 +56,7 @@ protected void onCreate(Bundle savedInstanceState) {
notificationListeningCbp.setSummary("Unfortunately your current version of android does not support this feature");
}
settings = new AppSettings(this);
setTheme(settings.getAppTheme());
}

@Override
Expand Down
85 changes: 85 additions & 0 deletions app/src/main/java/com/adam/aslfms/ChangeThemeActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
package com.adam.aslfms;

import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

import com.adam.aslfms.util.AppSettings;

public class ChangeThemeActivity extends AppCompatActivity {
private static final String TAG = "ChangeThemeActivity";
private AppSettings settings;

@Override
public Resources.Theme getTheme() {
settings = new AppSettings(this);
Resources.Theme theme = super.getTheme();
theme.applyStyle(settings.getAppTheme(), true);
Log.e(TAG, getResources().getResourceName(settings.getAppTheme()));
// you could also use a switch if you have many themes that could apply
return theme;
}

@Override
@SuppressWarnings("deprecation")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.theme_options);
settings = new AppSettings(this);
setTheme(settings.getAppTheme());
}

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


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

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

public void onRadioButtonClicked(View view){
switch (view.getId()) {
case R.id.default_theme:
settings.setAppTheme(R.style.AppTheme);
break;
case R.id.default_theme_dark:
settings.setAppTheme(R.style.AppTheme_Dark);
break;
case R.id.lastfm_theme:
settings.setAppTheme(R.style.AppThemeLastFm);
break;
case R.id.lastfm_theme_dark:
settings.setAppTheme(R.style.AppThemeLastFmDark);
break;
case R.id.librefm_theme:
settings.setAppTheme(R.style.AppThemeLibreFm);
break;
case R.id.librefm_theme_dark:
settings.setAppTheme(R.style.AppThemeLibreFmDark);
break;
case R.id.listenbrainz_theme:
settings.setAppTheme(R.style.AppThemeListenBrainz);
break;
case R.id.listenbrainz_theme_dark:
settings.setAppTheme(R.style.AppThemeListenBrainzDark);
break;
default:
settings.setAppTheme(R.style.AppTheme);
}
setTheme(settings.getAppTheme());
Log.d(TAG, view.getResources().getResourceName(settings.getAppTheme()));
Intent intent = new Intent(this, SettingsActivity.class);
startActivity(intent);
}
}
Loading

0 comments on commit 1f9d29e

Please sign in to comment.