-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
History cache compose #11494
Open
braiso-22
wants to merge
30
commits into
TeamNewPipe:refactor
Choose a base branch
from
braiso-22:history_cache_compose
base: refactor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
History cache compose #11494
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
2ac0d1f
add NP icon for Android Studio's NewUI
theScrabi 5e5e77f
Merge pull request #11230 from TeamNewPipe/idea_icon
TobiGr 9f766eb
Fix NPE in MediaSessionPlayerUi while destroying player
Stypox 6f71c00
Merge pull request #11261 from Stypox/fix-media-session-ui-npe
Stypox 0e0cee1
Update NewPipeExtractor to v0.24.1
Stypox acc5be9
Add changelogs for hotfix release v0.27.1 (998)
Stypox 0f64158
Hotfix release v0.27.1 (998)
Stypox ad6b676
Update README.pt_BR.md (#11275)
tag27 72e9f7f
Merge branch 'master' into dev
Stypox 0e8303f
Update Matrix room link, and prioritise it (#11350)
opusforlife2 947ac28
Update NewPipeExtractor to v0.24.2
Stypox 56b6241
Hotfix release v0.27.2 (999)
Stypox 03a6b5c
Add changelogs for hotfix release v0.27.2 (999)
Stypox 64a8f65
Merge pull request #11351 from Stypox/update-npe
Stypox dbcb721
Don't warn about rhino class in proguard
Stypox d442b45
Remove code committed accidentally
Stypox 51ee2f8
Merge branch 'master' into dev
Stypox d2cc37a
Added daggerhilt for better dependency injection for Compose Viewmodels
e1169dc
fixed inversed colors of surface for light theme
91af8b0
Added the new compose screen with its components and events
38c823a
Remove outdated returnActivity test code
Two-Ai 7a498d8
changed a bit the components to make the screen stable for compose
86dbfea
updated gradle
fad3120
Merge pull request #11428 from Two-Ai/remove-returnActivity-test
TobiGr 035c394
Fixing the 404 page not found, when clicking on "contribution notes" …
Stackoverflow-addict 0057192
Changed business logic to be in its own files
ff42678
Updated view and viewmodel and remapped the fragments/activities
0530a6b
fix imports in some files
4c5cb31
Merge branch 'dev' into history_cache_compose
braiso-22 89576ad
Merge branch 'refactor' into history_cache_compose
braiso-22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
27 changes: 27 additions & 0 deletions
27
app/src/main/java/org/schabi/newpipe/dependency_injection/AppModule.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,27 @@ | ||
package org.schabi.newpipe.dependency_injection | ||
|
||
import android.content.Context | ||
import android.content.SharedPreferences | ||
import androidx.preference.PreferenceManager | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import dagger.hilt.components.SingletonComponent | ||
import org.schabi.newpipe.error.usecases.OpenErrorActivity | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object AppModule { | ||
@Provides | ||
@Singleton | ||
fun provideSharedPreferences(@ApplicationContext context: Context): SharedPreferences = | ||
PreferenceManager.getDefaultSharedPreferences(context) | ||
|
||
@Provides | ||
@Singleton | ||
fun provideOpenActivity( | ||
@ApplicationContext context: Context, | ||
): OpenErrorActivity = OpenErrorActivity(context) | ||
} |
56 changes: 56 additions & 0 deletions
56
app/src/main/java/org/schabi/newpipe/dependency_injection/DatabaseModule.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,56 @@ | ||
package org.schabi.newpipe.dependency_injection | ||
|
||
import android.content.Context | ||
import androidx.room.Room | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.android.qualifiers.ApplicationContext | ||
import dagger.hilt.components.SingletonComponent | ||
import org.schabi.newpipe.database.AppDatabase | ||
import org.schabi.newpipe.database.AppDatabase.DATABASE_NAME | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_1_2 | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_2_3 | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_3_4 | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_4_5 | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_5_6 | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_6_7 | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_7_8 | ||
import org.schabi.newpipe.database.Migrations.MIGRATION_8_9 | ||
import org.schabi.newpipe.database.history.dao.SearchHistoryDAO | ||
import org.schabi.newpipe.database.history.dao.StreamHistoryDAO | ||
import org.schabi.newpipe.database.stream.dao.StreamDAO | ||
import org.schabi.newpipe.database.stream.dao.StreamStateDAO | ||
import javax.inject.Singleton | ||
|
||
@InstallIn(SingletonComponent::class) | ||
@Module | ||
class DatabaseModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideAppDatabase(@ApplicationContext appContext: Context): AppDatabase = | ||
Room.databaseBuilder( | ||
appContext, | ||
AppDatabase::class.java, | ||
DATABASE_NAME | ||
).addMigrations( | ||
MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5, | ||
MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8, MIGRATION_8_9 | ||
).build() | ||
|
||
@Provides | ||
fun provideStreamStateDao(appDatabase: AppDatabase): StreamStateDAO = | ||
appDatabase.streamStateDAO() | ||
|
||
@Provides | ||
fun providesStreamDao(appDatabase: AppDatabase): StreamDAO = appDatabase.streamDAO() | ||
|
||
@Provides | ||
fun provideStreamHistoryDao(appDatabase: AppDatabase): StreamHistoryDAO = | ||
appDatabase.streamHistoryDAO() | ||
|
||
@Provides | ||
fun provideSearchHistoryDao(appDatabase: AppDatabase): SearchHistoryDAO = | ||
appDatabase.searchHistoryDAO() | ||
} |
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
18 changes: 18 additions & 0 deletions
18
app/src/main/java/org/schabi/newpipe/error/usecases/OpenErrorActivity.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,18 @@ | ||
package org.schabi.newpipe.error.usecases | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import org.schabi.newpipe.error.ErrorActivity | ||
import org.schabi.newpipe.error.ErrorInfo | ||
|
||
class OpenErrorActivity( | ||
private val context: Context, | ||
) { | ||
operator fun invoke(errorInfo: ErrorInfo) { | ||
val intent = Intent(context, ErrorActivity::class.java) | ||
intent.putExtra(ErrorActivity.ERROR_INFO, errorInfo) | ||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
|
||
context.startActivity(intent) | ||
} | ||
} | ||
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be better as a static method in the error activity class itself.