-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [feat]: disabling word wrap for log in details * [feat]: search in crash logs + small refactor * [feat]: moved apps chooser to another module and refactored to compose * [feat]: crashes blacklist * [build]: renamed modules * [fix]: opening crashes by default * [feat]: blacklisting in crash details * [feat]: search text in crash log * [feat]: disabling monet
- Loading branch information
Showing
397 changed files
with
2,038 additions
and
1,085 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/src/main/kotlin/com/f0x1d/logfox/coil/AppIconFetcher.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.f0x1d.logfox.coil | ||
|
||
import android.content.Context | ||
import coil.ImageLoader | ||
import coil.decode.DataSource | ||
import coil.fetch.DrawableResult | ||
import coil.fetch.FetchResult | ||
import coil.fetch.Fetcher | ||
import coil.request.Options | ||
import com.f0x1d.logfox.arch.di.IODispatcher | ||
import com.f0x1d.logfox.model.InstalledApp | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.withContext | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
class AppIconFetcher( | ||
private val context: Context, | ||
private val app: InstalledApp, | ||
private val ioDispatcher: CoroutineDispatcher, | ||
) : Fetcher { | ||
|
||
override suspend fun fetch(): FetchResult = withContext(ioDispatcher) { | ||
val appDrawable = context.packageManager.getApplicationIcon(app.packageName) | ||
|
||
DrawableResult( | ||
drawable = appDrawable, | ||
isSampled = true, | ||
dataSource = DataSource.DISK, | ||
) | ||
} | ||
|
||
@Singleton | ||
class Factory @Inject constructor( | ||
@ApplicationContext private val context: Context, | ||
@IODispatcher private val ioDispatcher: CoroutineDispatcher, | ||
) : Fetcher.Factory<InstalledApp> { | ||
override fun create( | ||
data: InstalledApp, | ||
options: Options, | ||
imageLoader: ImageLoader, | ||
): Fetcher = AppIconFetcher( | ||
context = context, | ||
app = data, | ||
ioDispatcher = ioDispatcher, | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.f0x1d.logfox.di | ||
|
||
import android.content.Context | ||
import coil.ImageLoader | ||
import com.f0x1d.logfox.coil.AppIconFetcher | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object CoilModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideImageLoader( | ||
@ApplicationContext context: Context, | ||
appIconFetcherFactory: AppIconFetcher.Factory, | ||
): ImageLoader = ImageLoader.Builder(context) | ||
.components { | ||
add(appIconFetcherFactory) | ||
} | ||
.build() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.