Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Update gradle and libraries #626

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/debug_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
- name: Clone repository
uses: actions/checkout@v3

- name: Setup java 17 as required by gradle
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'

- name: Build APK
shell: bash {0}
run: |
Expand Down
10 changes: 6 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
apply plugin: 'com.android.application'

android {
namespace "com.termux.api"

compileSdkVersion project.properties.compileSdkVersion.toInteger()
def appVersionName = System.getenv("TERMUX_API_APP_VERSION_NAME") ?: ""
def apkVersionTag = System.getenv("TERMUX_API_APK_VERSION_TAG") ?: ""

defaultConfig {
applicationId "com.termux.api"
minSdkVersion project.properties.minSdkVersion.toInteger()
targetSdkVersion project.properties.targetSdkVersion.toInteger()
versionCode 51
Expand Down Expand Up @@ -64,9 +65,10 @@ android {
}

dependencies {
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.biometric:biometric:1.2.0-alpha03'
implementation 'androidx.media:media:1.4.3'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.biometric:biometric:1.2.0-alpha05'
implementation 'androidx.media:media:1.6.0'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'

implementation 'com.termux.termux-app:termux-shared:8c1749ef96'
// Use if below libraries are published locally by termux-app with `./gradlew publishReleasePublicationToMavenLocal` and used with `mavenLocal()`.
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.termux.api"
android:sharedUserId="${TERMUX_PACKAGE_NAME}">


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ protected void onCreate(Bundle savedInstanceState) {
TermuxThemeUtils.setAppNightMode(this);
AppCompatActivityUtils.setNightMode(this, NightMode.getAppNightMode().getName(), true);

AppCompatActivityUtils.setToolbar(this, R.id.toolbar);
AppCompatActivityUtils.setToolbarTitle(this, R.id.toolbar, TermuxConstants.TERMUX_API_APP_NAME, 0);
AppCompatActivityUtils.setToolbar(this, com.termux.shared.R.id.toolbar);
AppCompatActivityUtils.setToolbarTitle(this, com.termux.shared.R.id.toolbar, TermuxConstants.TERMUX_API_APP_NAME, 0);

TextView pluginInfo = findViewById(R.id.textview_plugin_info);
pluginInfo.setText(getString(R.string.plugin_info, TermuxConstants.TERMUX_GITHUB_REPO_URL,
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/termux/api/util/ViewUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static void setWarningTextViewAndButtonState(@NonNull Context context,
@NonNull TextView textView, @NonNull Button button,
boolean warningState, String text) {
if (warningState) {
textView.setTextColor(ContextCompat.getColor(context, R.color.red_error));
textView.setLinkTextColor(ContextCompat.getColor(context, R.color.red_error_link));
textView.setTextColor(ContextCompat.getColor(context, com.termux.shared.R.color.red_error));
textView.setLinkTextColor(ContextCompat.getColor(context, com.termux.shared.R.color.red_error_link));
button.setEnabled(true);
button.setAlpha(1);
} else {
Expand Down
58 changes: 29 additions & 29 deletions app/src/main/res/layout/activity_termux_api.xml
Original file line number Diff line number Diff line change
@@ -1,98 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<include
layout="@layout/partial_primary_toolbar"
android:id="@+id/partial_primary_toolbar"/>
android:id="@+id/partial_primary_toolbar"
layout="@layout/partial_primary_toolbar" />

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:layout_height="match_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".activities.TermuxAPIActivity">

<com.google.android.material.textview.MaterialTextView
android:id="@+id/textview_plugin_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="start|center_vertical"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:gravity="start|center_vertical"
android:textSize="14sp"
android:textStyle="normal"
android:textColor="?android:textColorPrimary"
android:textColorLink="?android:textColorLink"
android:autoLink="web"/>
android:textSize="14sp"
android:textStyle="normal" />

<View style="@style/ViewDivider"/>
<View style="@style/ViewDivider" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/textview_battery_optimization_not_disabled_warning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:autoLink="web"
android:gravity="start|center_vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:text="@string/msg_battery_optimization_not_disabled_warning"
android:textSize="14sp"
android:textStyle="normal"
android:textColor="@color/red_error"
android:textColorLink="@color/red_error_link"
android:autoLink="web"/>
android:textSize="14sp"
android:textStyle="normal" />

<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/btn_disable_battery_optimizations"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:gravity="center"
android:text="@string/action_disable_battery_optimizations"
android:textSize="12sp"
android:textColor="?android:textColorPrimary"
android:textSize="12sp"
app:strokeColor="?android:textColorPrimary"
app:strokeWidth="2dp"/>
app:strokeWidth="2dp" />

<View style="@style/ViewDivider"/>
<View style="@style/ViewDivider" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/textview_display_over_other_apps_not_granted_warning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/activity_vertical_margin"
android:autoLink="web"
android:gravity="start|center_vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:text="@string/msg_display_over_other_apps_permission_not_granted_warning"
android:textSize="14sp"
android:textStyle="normal"
android:textColor="@color/red_error"
android:textColorLink="@color/red_error_link"
android:autoLink="web"/>
android:textSize="14sp"
android:textStyle="normal" />

<com.google.android.material.button.MaterialButton
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:id="@+id/btn_grant_display_over_other_apps_permission"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:gravity="center"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:gravity="center"
android:text="@string/action_grant_display_over_other_apps_permission"
android:textSize="12sp"
android:textColor="?android:textColorPrimary"
android:textSize="12sp"
app:strokeColor="?android:textColorPrimary"
app:strokeWidth="2dp"/>
app:strokeWidth="2dp" />
</LinearLayout>

</ScrollView>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.3.1"
classpath "com.android.tools.build:gradle:8.1.2"
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ android.useAndroidX=true

minSdkVersion=24
targetSdkVersion=28
compileSdkVersion=30
compileSdkVersion=34
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.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading