Skip to content

Commit

Permalink
Dependency updates + targetSdkVersion 34
Browse files Browse the repository at this point in the history
Also fix unfortunate issue where wrong name for system freeform mode setting was displayed to the user on Android 10+
  • Loading branch information
farmerbb committed Sep 8, 2024
1 parent df3b883 commit 928d0ea
Show file tree
Hide file tree
Showing 20 changed files with 137 additions and 45 deletions.
22 changes: 18 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
apply from: '../dependencies.gradle'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
/* TODO disabling Jacoco due to incompatibility with AGP >= 8.0
* https://github.com/arturdm/jacoco-android-gradle-plugin/issues/102
apply plugin: 'com.dicedmelon.gradle.jacoco-android'
jacoco {
Expand All @@ -15,6 +17,7 @@ jacocoAndroidUnitTestReport {
html.enabled true
xml.enabled true
}
*/

repositories {
google()
Expand All @@ -29,7 +32,8 @@ spotless {
}

android {
compileSdkVersion COMPILE_SDK_VERSION
compileSdk COMPILE_SDK_VERSION
namespace "com.farmerbb.taskbar"

defaultConfig {
applicationId "com.farmerbb.taskbar"
Expand All @@ -50,13 +54,18 @@ android {
buildConfigField "long", "TIMESTAMP", "${System.currentTimeMillis()}L"
}

buildFeatures {
buildConfig true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

signingConfigs {
Expand Down Expand Up @@ -122,10 +131,13 @@ android {

showStandardStreams = false
exceptionFormat = 'full'
/* TODO disabling Jacoco due to incompatibility with AGP >= 8.0
* https://github.com/arturdm/jacoco-android-gradle-plugin/issues/102
jacoco {
includeNoLocationClasses = true
excludes = ['jdk.internal.*']
}
*/
}
}

Expand Down Expand Up @@ -158,4 +170,6 @@ dependencies {
testImplementation "org.powermock:powermock-api-mockito2:$POWERMOCK_VERSION"
testImplementation "org.powermock:powermock-classloading-xstream:$POWERMOCK_VERSION"
testImplementation 'org.apache.commons:commons-lang3:3.12.0'

coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.1.2"
}
34 changes: 34 additions & 0 deletions app/src/compat-34/java/com/farmerbb/taskbar/util/CompatUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright 2020 Braden Farmer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.farmerbb.taskbar.util;

// Utility class meant for compatibility between the Android-x86 version of Taskbar (compiled with SDK 28)
// and the Play Store version of Taskbar (compiled with SDK 30).
// TODO Do not make changes to this file without making corresponding changes to the Android-x86 version.

import android.os.Build;
import android.view.View;
import android.view.WindowInsets;

public class CompatUtils {

private CompatUtils() {}

public static boolean isImeVisible(View view) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.R
&& view.getRootWindowInsets().isVisible(WindowInsets.Type.ime());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private void proceedWithAppLaunch(Bundle savedInstanceState) {
try {
setContentView(R.layout.tb_main);
} catch (IllegalStateException e) {
setTheme(R.style.Theme_AppCompat_Light);
setTheme(com.google.android.material.R.style.Theme_AppCompat_Light);
setContentView(R.layout.tb_main);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ public boolean onPreferenceClick(final Preference p) {
.setMessage(R.string.tb_freeform_dialog_message_alt)
.setPositiveButton(R.string.tb_action_continue, (dialogInterface, i) -> freeformSetupComplete());
} else {
String settingName = getString(R.string.tb_force_activities_resizable);
String settingName = Build.VERSION.SDK_INT > Build.VERSION_CODES.P
? getString(R.string.tb_enable_freeform_windows)
: getString(R.string.tb_force_activities_resizable);

builder.setTitle(R.string.tb_freeform_dialog_title)
.setMessage(getString(R.string.tb_freeform_dialog_message, settingName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,14 @@ public boolean onQueryTextSubmit(String query) {
public boolean onQueryTextChange(String newText) {
searchView.setIconified(false);

View closeButton = searchView.findViewById(R.id.search_close_btn);
View closeButton = searchView.findViewById(com.google.android.material.R.id.search_close_btn);
if(closeButton != null) closeButton.setVisibility(View.GONE);

refreshApps(newText, false);

if(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1) {
U.newHandler().postDelayed(() -> {
EditText editText = searchView.findViewById(R.id.search_src_text);
EditText editText = searchView.findViewById(com.google.android.material.R.id.search_src_text);
if(editText != null) {
editText.requestFocus();
editText.setSelection(editText.getText().length());
Expand Down Expand Up @@ -647,7 +647,7 @@ else if(clazz.equals(InvisibleActivityAlt.class))
context.startActivity(intent);
}

EditText editText = searchView.findViewById(R.id.search_src_text);
EditText editText = searchView.findViewById(com.google.android.material.R.id.search_src_text);
if(searchView.getVisibility() == View.VISIBLE) {
if(hasHardwareKeyboard) {
searchView.setIconifiedByDefault(true);
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<string name="tb_toggle_dashboard">Dashboard umschalten</string>

<string name="tb_force_activities_resizable">Größenänderung von Apps erzwingen</string>
<string name="tb_enable_freeform_windows">Freiform-Fenster aktivieren</string>

<string name="tb_filepicker_select_an_image_file">Wählen Sie eine Bilddatei aus</string>
<string name="tb_filepicker_install_file_manager">Fehler bei der Bild-Auswahl</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<string name="tb_toggle_dashboard">Cambiar Dashboard</string>

<string name="tb_force_activities_resizable">Forzar actividades para ser redimensionadas</string>
<string name="tb_enable_freeform_windows">Enable freeform windows</string>

<string name="tb_filepicker_select_an_image_file">Seleccione un archivo de imagen</string>
<string name="tb_filepicker_install_file_manager">Error al seleccionar la imagen</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<string name="tb_toggle_dashboard">Toggle Dashboard</string>

<string name="tb_force_activities_resizable">強制的にアクティビティをリサイズ可能にする</string>
<string name="tb_enable_freeform_windows">Enable freeform windows</string>

<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<string name="tb_toggle_dashboard">Widgetoverzicht tonen/verbergen</string>

<string name="tb_force_activities_resizable">Formaat activiteiten geforceerd aanpasbaar maken</string>
<string name="tb_enable_freeform_windows">Enable freeform windows</string>

<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Taskbar jest i zawsze będzie w 100%% darmowy, open source, bez reklam. Jednak w
<string name="tb_enable_developer_options">Włącz opcje programisty, stukając wersję 7 razy</string>
<string name="tb_enable_double_tap_to_sleep">Włączyć dwukrotne stuknięcie w tryb uśpienia?</string>
<string name="tb_enable_force_activities_resizable">Przewiń do dołu i włącz \"%s\"</string>
<string name="tb_enable_freeform_windows">Włącz okienka freeform</string>
<string name="tb_enable_recent_apps">"Na pasku zadań można opcjonalnie wyświetlać ikony ostatnio używanych aplikacji wzdłuż krawędzi ekranu. W tym celu %1$s wymaga uprawnień dostępu do użytkowania.

"</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<string name="tb_toggle_dashboard">Toggle Dashboard</string>

<string name="tb_force_activities_resizable">Изменение размера в многооконном режиме</string>
<string name="tb_enable_freeform_windows">Enable freeform windows</string>

<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ Bu durumda, bu cihazdaki serbest biçimli modu kullanmak için özel bir ROM fla
<string name="tb_toggle_dashboard">Toggle Dashboard</string>

<string name="tb_force_activities_resizable">Yeniden boyutlandırılacak etkinlikleri zorla</string>
<string name="tb_enable_freeform_windows">Enable freeform windows</string>

<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<string name="tb_toggle_dashboard">切换面板</string>

<string name="tb_force_activities_resizable">强制将活动设为可调整大小</string>
<string name="tb_enable_freeform_windows">开启自由式窗口</string>

<string name="tb_filepicker_select_an_image_file">选择一张图片</string>
<string name="tb_filepicker_install_file_manager">请安装一个文件管理器。</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<string name="tb_toggle_dashboard">Toggle Dashboard</string>

<string name="tb_force_activities_resizable">Force activities to be resizable</string>
<string name="tb_enable_freeform_windows">Enable freeform windows</string>

<string name="tb_filepicker_select_an_image_file">Select an image file</string>
<string name="tb_filepicker_install_file_manager">Error selecting image</string>
Expand Down
10 changes: 9 additions & 1 deletion app/src/playstore/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<uses-permission-sdk-23 android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission-sdk-23 android:name="android.permission.BLUETOOTH" />
<uses-permission-sdk-23 android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission-sdk-23 android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />

<uses-permission-sdk-23 android:name="com.farmerbb.taskbar.support.USE_SUPPORT_LIBRARY" />

Expand Down Expand Up @@ -393,8 +394,15 @@

<service android:name=".service.TaskbarService"/>
<service android:name=".service.StartMenuService"/>
<service android:name=".service.NotificationService"/>
<service android:name=".service.DashboardService"/>

<service
android:name=".service.NotificationService"
android:foregroundServiceType="specialUse">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This foreground service is required because the app\'s core functionality draws an overlay over other apps, displaying UI that is hosted inside of services instead of an activity"/>
</service>
<service
android:name=".service.PowerMenuService"
android:enabled="true"
Expand Down
10 changes: 5 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ allprojects {
VERSION_NAME = "6.2"

MIN_SDK_VERSION = 21
COMPILE_SDK_VERSION = 31
TARGET_SDK_VERSION = 31
COMPILE_SDK_VERSION = 34
TARGET_SDK_VERSION = 34

SUPPORT_V4_VERSION = "1.0.0"
APPCOMPAT_VERSION = "1.4.0"
APPCOMPAT_VERSION = "1.7.0"
BROWSER_VERSION = "1.0.0" // keeping at 1.0.0 to preserve compatibility with Android-x86
MATERIAL_VERSION = "1.4.0"
MATERIAL_VERSION = "1.12.0"
POWERMOCK_VERSION = "2.0.9"
AGP_VERSION = "7.0.4"
AGP_VERSION = "8.5.2"
HIDDEN_API_BYPASS_VERSION = "3.0"
SHIZUKU_VERSION = "12.1.0"
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
44 changes: 31 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +82,12 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +134,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,18 +201,28 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
Loading

0 comments on commit 928d0ea

Please sign in to comment.