Added support for Android N and regenerated all the icons.
@ -8,7 +8,7 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</facet>
|
</facet>
|
||||||
</component>
|
</component>
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="true">
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
|
||||||
|
20
app/app.iml
@ -26,7 +26,7 @@
|
|||||||
</configuration>
|
</configuration>
|
||||||
</facet>
|
</facet>
|
||||||
</component>
|
</component>
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6" inherit-compiler-output="false">
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
|
||||||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
|
||||||
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
|
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/androidTest/debug" />
|
||||||
<exclude-output />
|
<exclude-output />
|
||||||
@ -69,7 +69,12 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/ch.acra/acra/4.8.5/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/ch.acra/acra/4.8.5/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.0.0-alpha1/jars" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-compat/24.2.1/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.1/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-utils/24.2.1/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-fragment/24.2.1/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-media-compat/24.2.1/jars" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/24.2.1/jars" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
|
||||||
@ -81,11 +86,16 @@
|
|||||||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Android API 23, N preview Platform" jdkType="Android SDK" />
|
<orderEntry type="jdk" jdkName="Android API 24 Platform" jdkType="Android SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="library" exported="" name="support-annotations-24.2.1" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-v4-24.2.1" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-compat-24.2.1" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-media-compat-24.2.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="acra-4.8.5" level="project" />
|
<orderEntry type="library" exported="" name="acra-4.8.5" level="project" />
|
||||||
<orderEntry type="library" exported="" name="support-v4-24.0.0-alpha1" level="project" />
|
<orderEntry type="library" exported="" name="support-fragment-24.2.1" level="project" />
|
||||||
<orderEntry type="library" exported="" name="support-annotations-24.0.0-alpha1" level="project" />
|
<orderEntry type="library" exported="" name="support-core-ui-24.2.1" level="project" />
|
||||||
|
<orderEntry type="library" exported="" name="support-core-utils-24.2.1" level="project" />
|
||||||
<orderEntry type="module" module-name="colorPicker" exported="" />
|
<orderEntry type="module" module-name="colorPicker" exported="" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
@ -1,12 +1,12 @@
|
|||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 'android-N'
|
compileSdkVersion 24
|
||||||
buildToolsVersion '24.0.0-rc1'
|
buildToolsVersion '24.0.2'
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.mridang.speedo"
|
applicationId "com.mridang.speedo"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 23
|
targetSdkVersion 24
|
||||||
versionCode 2
|
versionCode 2
|
||||||
versionName "1.1"
|
versionName "1.1"
|
||||||
}
|
}
|
||||||
@ -22,7 +22,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
compile 'com.android.support:support-v4:24.0.0-alpha1'
|
compile 'com.android.support:support-v4:24.2.1'
|
||||||
compile project(':colorPicker')
|
compile project(':colorPicker')
|
||||||
compile 'ch.acra:acra:4.8.5'
|
compile 'ch.acra:acra:4.8.5'
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,8 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
@ -100,6 +102,7 @@ public class TrafficService extends Service {
|
|||||||
notBuilder.setOnlyAlertOnce(true);
|
notBuilder.setOnlyAlertOnce(true);
|
||||||
notBuilder.setPriority(Integer.MAX_VALUE);
|
notBuilder.setPriority(Integer.MAX_VALUE);
|
||||||
notBuilder.setCategory(NotificationCompat.CATEGORY_SERVICE);
|
notBuilder.setCategory(NotificationCompat.CATEGORY_SERVICE);
|
||||||
|
notBuilder.setLocalOnly(true);
|
||||||
setColor(settings.getInt("color", Color.TRANSPARENT));
|
setColor(settings.getInt("color", Color.TRANSPARENT));
|
||||||
visibilityPublic(settings.getBoolean("lockscreen", true));
|
visibilityPublic(settings.getBoolean("lockscreen", true));
|
||||||
|
|
||||||
@ -333,20 +336,28 @@ public class TrafficService extends Service {
|
|||||||
|
|
||||||
if (lngSpeed < 1024) {
|
if (lngSpeed < 1024) {
|
||||||
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000);
|
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000);
|
||||||
|
updateIcon(R.drawable.wkb000);
|
||||||
} else if (lngSpeed < 1048576L) {
|
} else if (lngSpeed < 1048576L) {
|
||||||
|
|
||||||
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000 + (int) (lngSpeed / 1024L));
|
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000 + (int) (lngSpeed / 1024L));
|
||||||
|
updateIcon(R.drawable.wkb000 + (int) (lngSpeed / 1024L));
|
||||||
if (lngSpeed > 1022976) {
|
if (lngSpeed > 1022976) {
|
||||||
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000 + 1000);
|
TrafficService.notBuilder.setSmallIcon(R.drawable.wkb000 + 1000);
|
||||||
|
updateIcon(R.drawable.wkb000 + 1000);
|
||||||
}
|
}
|
||||||
} else if (lngSpeed <= 10485760) {
|
} else if (lngSpeed <= 10485760) {
|
||||||
TrafficService.notBuilder.setSmallIcon(990 + R.drawable.wkb000
|
TrafficService.notBuilder.setSmallIcon(990 + R.drawable.wkb000
|
||||||
+ (int) (0.5D + (double) (10F * ((float) lngSpeed / 1048576F))));
|
+ (int) (0.5D + (double) (10F * ((float) lngSpeed / 1048576F))));
|
||||||
|
updateIcon(990 + R.drawable.wkb000
|
||||||
|
+ (int) (0.5D + (double) (10F * ((float) lngSpeed / 1048576F))));
|
||||||
} else if (lngSpeed <= 103809024) {
|
} else if (lngSpeed <= 103809024) {
|
||||||
TrafficService.notBuilder.setSmallIcon(1080 + R.drawable.wkb000
|
TrafficService.notBuilder.setSmallIcon(1080 + R.drawable.wkb000
|
||||||
+ (int) (0.5D + (double) ((float) lngSpeed / 1048576F)));
|
+ (int) (0.5D + (double) ((float) lngSpeed / 1048576F)));
|
||||||
|
updateIcon(1080 + R.drawable.wkb000
|
||||||
|
+ (int) (0.5D + (double) ((float) lngSpeed / 1048576F)));
|
||||||
} else {
|
} else {
|
||||||
TrafficService.notBuilder.setSmallIcon(1180 + R.drawable.wkb000);
|
TrafficService.notBuilder.setSmallIcon(1180 + R.drawable.wkb000);
|
||||||
|
updateIcon(1180 + R.drawable.wkb000);
|
||||||
}
|
}
|
||||||
|
|
||||||
Long lngTotal = TrafficStats.getTotalRxBytes() + TrafficStats.getTotalTxBytes();
|
Long lngTotal = TrafficStats.getTotalRxBytes() + TrafficStats.getTotalTxBytes();
|
||||||
@ -357,6 +368,14 @@ public class TrafficService extends Service {
|
|||||||
Log.e("NotificationHandler", "Error creating notification for speed " + lngSpeed);
|
Log.e("NotificationHandler", "Error creating notification for speed " + lngSpeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateIcon(int value) {
|
||||||
|
if(Build.VERSION.SDK_INT != Build.VERSION_CODES.N) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bitmap bmpIcon = BitmapFactory.decodeResource(this.ctxContext.getResources(), value);
|
||||||
|
TrafficService.notBuilder.setLargeIcon(bmpIcon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 732 B |
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 583 B |
Before Width: | Height: | Size: 714 B After Width: | Height: | Size: 687 B |
Before Width: | Height: | Size: 791 B After Width: | Height: | Size: 766 B |
Before Width: | Height: | Size: 684 B After Width: | Height: | Size: 654 B |
Before Width: | Height: | Size: 740 B After Width: | Height: | Size: 704 B |
Before Width: | Height: | Size: 759 B After Width: | Height: | Size: 738 B |
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 784 B After Width: | Height: | Size: 763 B |
Before Width: | Height: | Size: 748 B After Width: | Height: | Size: 715 B |
Before Width: | Height: | Size: 833 B After Width: | Height: | Size: 806 B |
Before Width: | Height: | Size: 616 B After Width: | Height: | Size: 591 B |
Before Width: | Height: | Size: 831 B After Width: | Height: | Size: 801 B |
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 841 B |
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 756 B |
Before Width: | Height: | Size: 838 B After Width: | Height: | Size: 808 B |
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 775 B After Width: | Height: | Size: 748 B |
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 845 B |
Before Width: | Height: | Size: 863 B After Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 945 B After Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 829 B After Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 732 B After Width: | Height: | Size: 716 B |
Before Width: | Height: | Size: 932 B After Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 857 B After Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 900 B After Width: | Height: | Size: 881 B |
Before Width: | Height: | Size: 939 B After Width: | Height: | Size: 905 B |
Before Width: | Height: | Size: 855 B After Width: | Height: | Size: 840 B |
Before Width: | Height: | Size: 972 B After Width: | Height: | Size: 927 B |
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 969 B After Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 878 B After Width: | Height: | Size: 836 B |
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 810 B After Width: | Height: | Size: 771 B |
Before Width: | Height: | Size: 930 B After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 963 B After Width: | Height: | Size: 928 B |
Before Width: | Height: | Size: 989 B After Width: | Height: | Size: 946 B |
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 880 B |
Before Width: | Height: | Size: 1015 B After Width: | Height: | Size: 970 B |
Before Width: | Height: | Size: 970 B After Width: | Height: | Size: 931 B |
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 781 B After Width: | Height: | Size: 755 B |
Before Width: | Height: | Size: 863 B After Width: | Height: | Size: 840 B |
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 687 B |
Before Width: | Height: | Size: 864 B After Width: | Height: | Size: 851 B |
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 860 B |
Before Width: | Height: | Size: 805 B After Width: | Height: | Size: 785 B |
Before Width: | Height: | Size: 921 B After Width: | Height: | Size: 893 B |
Before Width: | Height: | Size: 885 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 956 B After Width: | Height: | Size: 929 B |
Before Width: | Height: | Size: 843 B After Width: | Height: | Size: 807 B |
Before Width: | Height: | Size: 903 B After Width: | Height: | Size: 886 B |
Before Width: | Height: | Size: 964 B After Width: | Height: | Size: 931 B |
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 848 B |
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 722 B |
Before Width: | Height: | Size: 943 B After Width: | Height: | Size: 907 B |
Before Width: | Height: | Size: 864 B After Width: | Height: | Size: 840 B |
Before Width: | Height: | Size: 958 B After Width: | Height: | Size: 918 B |
Before Width: | Height: | Size: 948 B After Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 950 B After Width: | Height: | Size: 922 B |
Before Width: | Height: | Size: 847 B After Width: | Height: | Size: 827 B |
Before Width: | Height: | Size: 925 B After Width: | Height: | Size: 907 B |
Before Width: | Height: | Size: 976 B After Width: | Height: | Size: 939 B |
Before Width: | Height: | Size: 869 B After Width: | Height: | Size: 854 B |
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 908 B |
Before Width: | Height: | Size: 766 B After Width: | Height: | Size: 746 B |
Before Width: | Height: | Size: 871 B After Width: | Height: | Size: 861 B |
Before Width: | Height: | Size: 970 B After Width: | Height: | Size: 941 B |
Before Width: | Height: | Size: 970 B After Width: | Height: | Size: 926 B |
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 754 B |
Before Width: | Height: | Size: 857 B After Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 872 B |
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 781 B |
Before Width: | Height: | Size: 863 B After Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 871 B After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 912 B After Width: | Height: | Size: 894 B |
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 867 B |
Before Width: | Height: | Size: 994 B After Width: | Height: | Size: 948 B |
Before Width: | Height: | Size: 872 B After Width: | Height: | Size: 833 B |
Before Width: | Height: | Size: 979 B After Width: | Height: | Size: 928 B |
Before Width: | Height: | Size: 1011 B After Width: | Height: | Size: 965 B |
Before Width: | Height: | Size: 916 B After Width: | Height: | Size: 901 B |
Before Width: | Height: | Size: 965 B After Width: | Height: | Size: 920 B |
Before Width: | Height: | Size: 976 B After Width: | Height: | Size: 939 B |
Before Width: | Height: | Size: 936 B After Width: | Height: | Size: 899 B |
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 774 B |
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 943 B |
Before Width: | Height: | Size: 962 B After Width: | Height: | Size: 914 B |
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 938 B After Width: | Height: | Size: 910 B |
Before Width: | Height: | Size: 970 B After Width: | Height: | Size: 933 B |
Before Width: | Height: | Size: 882 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 949 B After Width: | Height: | Size: 911 B |