-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated to view binding, Updated dependencies, Changed adapter callbacks, Refactored UI, Added extension functions, Migrated from glide to coil, Added separate dialogs for add and edit, Removed useless code, Fixed lint checks, Moved modules.
- Loading branch information
Showing
45 changed files
with
758 additions
and
877 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.cybershark.linkmanager | ||
|
||
import android.app.Application | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
@HiltAndroidApp | ||
class LinkManager : Application() |
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/cybershark/linkmanager/di/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,38 @@ | ||
package com.cybershark.linkmanager.di | ||
|
||
import android.content.Context | ||
import androidx.room.Room | ||
import com.cybershark.linkmanager.repository.Repository | ||
import com.cybershark.linkmanager.repository.room.dao.LinkDao | ||
import com.cybershark.linkmanager.repository.room.db.LinksDB | ||
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 AppModule { | ||
|
||
@Singleton | ||
@Provides | ||
fun getRoomDB(@ApplicationContext context: Context): LinksDB { | ||
return Room.databaseBuilder(context, LinksDB::class.java, "links") | ||
.fallbackToDestructiveMigration() | ||
.build() | ||
} | ||
|
||
@Singleton | ||
@Provides | ||
fun getRoomDao(linksDB: LinksDB): LinkDao { | ||
return linksDB.getDAO() | ||
} | ||
|
||
@Singleton | ||
@Provides | ||
fun getRepository(linkDao: LinkDao): Repository { | ||
return Repository(linkDao) | ||
} | ||
} |
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.