Skip to content
Closed
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
57 changes: 31 additions & 26 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.devtools.ksp'
// KAPT removed - Glide 4.16.0 supports KSP, eliminating the need for KAPT
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: 'jacoco'
apply plugin: "com.starter.easylauncher"

android {
Expand All @@ -26,13 +27,8 @@ android {
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

javaCompileOptions {
annotationProcessorOptions {
arguments += ["room.schemaLocation" : "$projectDir/src/test/resources/schemas".toString(),
"room.incremental" : "true",
"room.expandProjection": "true"]
}
}
// Room configuration is now handled by KSP (see ksp block below)
// javaCompileOptions are kept for any other annotation processors that might need them
}

signingConfigs {
Expand Down Expand Up @@ -63,6 +59,8 @@ android {

buildFeatures {
viewBinding true
// Required on AGP 8+ when using custom BuildConfig fields
buildConfig true
}

flavorDimensions = ['static']
Expand All @@ -85,12 +83,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}

testOptions {
Expand Down Expand Up @@ -127,10 +125,10 @@ dependencies {
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.room:room-runtime:$roomVersion"
playImplementation "com.android.billingclient:billing:$androidBillingVersion"
kapt "androidx.room:room-compiler:$roomVersion"
ksp "androidx.room:room-compiler:$roomVersion"
// RxJava support for Room
implementation "androidx.room:room-rxjava2:$roomVersion"
kapt "androidx.annotation:annotation:$androidXAnnotationVersion"
ksp "androidx.annotation:annotation:$androidXAnnotationVersion"

implementation "androidx.preference:preference-ktx:$androidXPrefVersion"

Expand All @@ -153,7 +151,7 @@ dependencies {
testImplementation "io.mockk:mockk:$mockkVersion"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutineTestVersion"
testImplementation "androidx.arch.core:core-testing:$androidXArchCoreTestVersion"
kaptTest "com.google.auto.service:auto-service:1.0-rc4"
kspTest "com.google.auto.service:auto-service:1.0-rc4"

androidTestImplementation "junit:junit:$junitVersion"//tests the app logic
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
Expand Down Expand Up @@ -219,7 +217,10 @@ dependencies {
// Excludes the support library because it's already included by Glide.
transitive = false
}
kapt "com.github.bumptech.glide:compiler:$glideVersion"
// Use KSP for Glide (Glide 4.12.0+ supports KSP)
// This eliminates the need for KAPT entirely, avoiding Windows SQLite native library issues
// Use the ksp artifact for Glide to generate GlideApp
ksp "com.github.bumptech.glide:ksp:$glideVersion"

implementation "com.leinardi.android:speed-dial:$fabSpeedDialVersion"

Expand Down Expand Up @@ -257,9 +258,22 @@ dependencies {
}

kotlin {
jvmToolchain(11)
jvmToolchain(17)
}


// KSP (Kotlin Symbol Processing) configuration
// KSP is faster than KAPT and doesn't have the Windows native library extraction issues
// KSP automatically handles task dependencies, so no manual configuration is needed
ksp {
arg("room.schemaLocation", "$projectDir/src/test/resources/schemas")
arg("room.incremental", "true")
arg("room.expandProjection", "true")
}

// KAPT has been completely removed - both Room and Glide now use KSP
// This eliminates Windows SQLite native library issues that occurred with KAPT

configurations.configureEach {
resolutionStrategy {
dependencySubstitution {
Expand Down Expand Up @@ -295,15 +309,6 @@ project.afterEvaluate {
clean.dependsOn supportOldLangCodes
clean.mustRunAfter supportOldLangCodes

jacoco {
toolVersion = "${jacocoVersion}"
}

jacocoAndroidUnitTestReport {
html.enabled true
xml.enabled true
}

tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.ArrayList;
import java.util.List;

import com.amaze.filemanager.GlideApp;
import com.bumptech.glide.Glide;
import com.amaze.filemanager.R;
import com.amaze.filemanager.adapters.data.CompressedObjectParcelable;
import com.amaze.filemanager.adapters.holders.CompressedItemViewHolder;
Expand Down Expand Up @@ -240,15 +240,15 @@ public void onBindViewHolder(final CompressedItemViewHolder holder, int position
compressedExplorerFragment.getResources().getDisplayMetrics()));

if (rowItem.type == CompressedObjectParcelable.TYPE_GOBACK) {
GlideApp.with(compressedExplorerFragment)
Glide.with(compressedExplorerFragment)
.load(R.drawable.ic_arrow_left_white_24dp)
.into(holder.genericIcon);
gradientDrawable.setColor(Utils.getColor(context, R.color.goback_item));
holder.txtTitle.setText("..");
holder.txtDesc.setText("");
holder.date.setText(R.string.goback);
} else {
GlideApp.with(compressedExplorerFragment)
Glide.with(compressedExplorerFragment)
.load(rowItem.iconData.image)
.into(holder.genericIcon);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.amaze.filemanager.GlideApp;
import com.bumptech.glide.Glide;
import com.amaze.filemanager.R;
import com.amaze.filemanager.adapters.data.IconDataParcelable;
import com.amaze.filemanager.adapters.data.LayoutElementParcelable;
Expand Down Expand Up @@ -616,7 +616,7 @@ private void setItems(

preloader =
new RecyclerViewPreloader<>(
GlideApp.with(mainFragment),
Glide.with(mainFragment),
modelProvider,
sizeProvider,
GlideConstants.MAX_PRELOAD_FILES);
Expand Down Expand Up @@ -807,10 +807,10 @@ && getItemsDigested().get(holder.getAdapterPosition()).getChecked()
});

// clear previously cached icon
GlideApp.with(mainFragment).clear(holder.genericIcon);
GlideApp.with(mainFragment).clear(holder.pictureIcon);
GlideApp.with(mainFragment).clear(holder.apkIcon);
GlideApp.with(mainFragment).clear(holder.baseItemView);
Glide.with(mainFragment).clear(holder.genericIcon);
Glide.with(mainFragment).clear(holder.pictureIcon);
Glide.with(mainFragment).clear(holder.apkIcon);
Glide.with(mainFragment).clear(holder.baseItemView);

holder.baseItemView.setOnClickListener(
v -> {
Expand Down Expand Up @@ -1023,10 +1023,10 @@ && getItemsDigested().get(holder.getAdapterPosition()).getChecked()

// view is a grid view
// clear previously cached icon
GlideApp.with(mainFragment).clear(holder.genericIcon);
GlideApp.with(mainFragment).clear(holder.iconLayout);
GlideApp.with(mainFragment).clear(holder.imageView1);
GlideApp.with(mainFragment).clear(holder.baseItemView);
Glide.with(mainFragment).clear(holder.genericIcon);
Glide.with(mainFragment).clear(holder.iconLayout);
Glide.with(mainFragment).clear(holder.imageView1);
Glide.with(mainFragment).clear(holder.baseItemView);

holder.checkImageViewGrid.setColorFilter(accentColor);
holder.baseItemView.setOnClickListener(
Expand Down Expand Up @@ -1061,7 +1061,7 @@ && getItemsDigested().get(holder.getAdapterPosition()).getChecked()
holder.genericIcon.setImageResource(R.drawable.ic_doc_apk_white);
}
} else {
GlideApp.with(mainFragment).load(rowItem.iconData.image).into(holder.genericIcon);
Glide.with(mainFragment).load(rowItem.iconData.image).into(holder.genericIcon);
}

if (holder.genericIcon.getVisibility() == View.VISIBLE) {
Expand Down Expand Up @@ -1275,7 +1275,7 @@ private void showThumbnailWithBackground(
OnImageProcessed errorListener) {
if (iconData.isImageBroken()) {
viewHolder.genericIcon.setVisibility(View.VISIBLE);
GlideApp.with(mainFragment)
Glide.with(mainFragment)
.load(R.drawable.ic_broken_image_white_24dp)
.into(viewHolder.genericIcon);
GradientDrawable gradientDrawable = (GradientDrawable) viewHolder.genericIcon.getBackground();
Expand All @@ -1286,7 +1286,7 @@ private void showThumbnailWithBackground(
}

viewHolder.genericIcon.setVisibility(View.VISIBLE);
GlideApp.with(mainFragment).load(iconData.loadingImage).into(viewHolder.genericIcon);
Glide.with(mainFragment).load(iconData.loadingImage).into(viewHolder.genericIcon);
GradientDrawable gradientDrawable = (GradientDrawable) viewHolder.genericIcon.getBackground();

RequestListener<Drawable> requestListener =
Expand All @@ -1298,7 +1298,7 @@ public boolean onLoadFailed(
new Handler(
msg -> {
viewHolder.genericIcon.setVisibility(View.VISIBLE);
GlideApp.with(mainFragment)
Glide.with(mainFragment)
.load(R.drawable.ic_broken_image_white_24dp)
.into(viewHolder.genericIcon);
return false;
Expand Down Expand Up @@ -1344,7 +1344,7 @@ private void showRoundedThumbnail(

viewHolder.genericIcon.setVisibility(View.VISIBLE);
iconBackground.setBackgroundColor(grey_color);
GlideApp.with(mainFragment)
Glide.with(mainFragment)
.load(R.drawable.ic_broken_image_white_24dp)
.into(viewHolder.genericIcon);
view.setVisibility(View.INVISIBLE);
Expand All @@ -1357,7 +1357,7 @@ private void showRoundedThumbnail(
getBoolean(PREFERENCE_USE_CIRCULAR_IMAGES) ? viewHolder.genericIcon : viewHolder.iconLayout;

viewHolder.genericIcon.setVisibility(View.VISIBLE);
GlideApp.with(mainFragment).load(iconData.loadingImage).into(viewHolder.genericIcon);
Glide.with(mainFragment).load(iconData.loadingImage).into(viewHolder.genericIcon);
view.setVisibility(View.INVISIBLE);

RequestListener<Drawable> requestListener =
Expand All @@ -1368,7 +1368,7 @@ public boolean onLoadFailed(
iconBackground.setBackgroundColor(grey_color);
new Handler(
msg -> {
GlideApp.with(mainFragment)
Glide.with(mainFragment)
.load(R.drawable.ic_broken_image_white_24dp)
.into(viewHolder.genericIcon);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.amaze.filemanager.GlideApp;
import com.amaze.filemanager.GlideRequest;
import com.bumptech.glide.Glide;
import com.amaze.filemanager.R;
import com.bumptech.glide.ListPreloader;
import com.bumptech.glide.RequestBuilder;
Expand All @@ -51,12 +50,12 @@ public class AppsAdapterPreloadModel implements ListPreloader.PreloadModelProvid
private final Logger LOG = LoggerFactory.getLogger(AppsAdapterPreloadModel.class);

private Context mContext;
private GlideRequest<Drawable> request;
private RequestBuilder<Drawable> request;
private List<String> items;
private boolean isBottomSheet;

public AppsAdapterPreloadModel(Fragment f, boolean isBottomSheet) {
request = GlideApp.with(f).asDrawable().fitCenter();
request = Glide.with(f).asDrawable().fitCenter();
this.mContext = f.requireContext();
this.isBottomSheet = isBottomSheet;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
import java.util.Collections;
import java.util.List;

import com.amaze.filemanager.GlideApp;
import com.amaze.filemanager.GlideRequest;
import com.bumptech.glide.Glide;
import com.amaze.filemanager.adapters.data.IconDataParcelable;
import com.bumptech.glide.ListPreloader;
import com.bumptech.glide.RequestBuilder;
Expand All @@ -43,12 +42,12 @@ public class RecyclerPreloadModelProvider
implements ListPreloader.PreloadModelProvider<IconDataParcelable> {

private final List<IconDataParcelable> urisToLoad;
private final GlideRequest<Drawable> request;
private final RequestBuilder<Drawable> request;

public RecyclerPreloadModelProvider(
@NonNull Fragment fragment, @NonNull List<IconDataParcelable> uris, boolean isCircled) {
urisToLoad = uris;
GlideRequest<Drawable> incompleteRequest = GlideApp.with(fragment).asDrawable();
RequestBuilder<Drawable> incompleteRequest = Glide.with(fragment).asDrawable();

if (isCircled) {
request = incompleteRequest.circleCrop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,14 @@ public boolean onCreateOptionsMenu(final Menu menu) {
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
final int id = item.getItemId();
switch (id) {
case android.R.id.home:
goToReturnActivity();
break;
case R.id.menu_item_share_error:
final Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, buildMarkdown());
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, getString(R.string.share)));
break;
default:
break;
if (id == android.R.id.home) {
goToReturnActivity();
} else if (id == R.id.menu_item_share_error) {
final Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, buildMarkdown());
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, getString(R.string.share)));
}
return false;
}
Expand Down
Loading