diff --git a/.gitignore b/.gitignore
index 39fb081..f6eea60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
/build
/captures
.externalNativeBuild
+/.idea/
\ No newline at end of file
diff --git a/.idea/.name b/.idea/.name
deleted file mode 100644
index 0625abd..0000000
--- a/.idea/.name
+++ /dev/null
@@ -1 +0,0 @@
-ActivityTracker
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
deleted file mode 100644
index 96cc43e..0000000
--- a/.idea/compiler.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
deleted file mode 100644
index e7bedf3..0000000
--- a/.idea/copyright/profiles_settings.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
deleted file mode 100644
index 97626ba..0000000
--- a/.idea/encodings.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
deleted file mode 100644
index 508b3d9..0000000
--- a/.idea/gradle.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 7158618..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.8
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 8e047a7..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
deleted file mode 100644
index 7f68460..0000000
--- a/.idea/runConfigurations.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index ea6ba26..cca5ec2 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'
android {
- compileSdkVersion 24
- buildToolsVersion "24.0.0"
+ compileSdkVersion 28
+ buildToolsVersion "28.0.0"
defaultConfig {
applicationId "com.fashare.activitytracker"
- minSdkVersion 15
- targetSdkVersion 24
+ minSdkVersion 16
+ targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@@ -20,12 +20,12 @@ android {
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 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:24.2.0'
- testCompile 'junit:junit:4.12'
+ implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'junit:junit:4.12'
- compile 'de.greenrobot:eventbus:2.4.0'
+ implementation 'de.greenrobot:eventbus:2.4.0'
}
diff --git a/app/src/main/java/com/fashare/activitytracker/TrackerWindowManager.java b/app/src/main/java/com/fashare/activitytracker/TrackerWindowManager.java
index 9fbcd62..897aa6f 100644
--- a/app/src/main/java/com/fashare/activitytracker/TrackerWindowManager.java
+++ b/app/src/main/java/com/fashare/activitytracker/TrackerWindowManager.java
@@ -2,6 +2,7 @@
import android.content.Context;
import android.graphics.PixelFormat;
+import android.os.Build;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
@@ -15,7 +16,7 @@ public class TrackerWindowManager {
public TrackerWindowManager(Context context) {
mContext = context;
- mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
+ mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
}
private View mFloatingView;
@@ -28,8 +29,14 @@ public TrackerWindowManager(Context context) {
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.gravity = Gravity.LEFT | Gravity.TOP;
- params.type = WindowManager.LayoutParams.TYPE_PHONE;
+// params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
params.format = PixelFormat.RGBA_8888;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ params.type = WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY;
+ } else {
+ params.type = WindowManager.LayoutParams.TYPE_PHONE;
+ }
+
params.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL
| WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE;
@@ -37,7 +44,7 @@ public TrackerWindowManager(Context context) {
}
public void addView() {
- if(mFloatingView == null){
+ if (mFloatingView == null) {
mFloatingView = new FloatingView(mContext);
mFloatingView.setLayoutParams(LAYOUT_PARAMS);
@@ -45,8 +52,8 @@ public void addView() {
}
}
- public void removeView(){
- if(mFloatingView != null){
+ public void removeView() {
+ if (mFloatingView != null) {
mWindowManager.removeView(mFloatingView);
mFloatingView = null;
}
diff --git a/build.gradle b/build.gradle
index a3330d4..7d34715 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
+ google()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.2.0'
+ classpath 'com.android.tools.build:gradle:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
+ google()
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 04e285f..84c0fb2 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Dec 28 10:00:20 PST 2015
+#Fri Jul 17 15:31:07 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip