-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from Entreco/develop
Setup players merge to develop
- Loading branch information
Showing
138 changed files
with
4,081 additions
and
220 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
Binary file not shown.
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- AdMob --> | ||
<string name="setup_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string> | ||
</resources> |
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
50 changes: 50 additions & 0 deletions
50
android/DartsScorecard/app/src/main/java/nl/entreco/dartsscorecard/base/TestableAdapter.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,50 @@ | ||
package nl.entreco.dartsscorecard.base | ||
|
||
import android.content.Context | ||
import android.support.v7.widget.RecyclerView | ||
import android.view.LayoutInflater | ||
|
||
/** | ||
* Created by Entreco on 31/12/2017. | ||
*/ | ||
abstract class TestableAdapter<T : RecyclerView.ViewHolder?> : RecyclerView.Adapter<T>() { | ||
|
||
protected class LazyInflater(context: Context) { | ||
val inflater: LayoutInflater by lazy { LayoutInflater.from(context) } | ||
} | ||
|
||
protected fun tryNotifyItemInserted(position: Int) { | ||
try { | ||
notifyItemInserted(position) | ||
} catch (ignore: NullPointerException) { | ||
} | ||
} | ||
|
||
protected fun tryNotifyItemChanged(position: Int) { | ||
try { | ||
notifyItemChanged(position) | ||
} catch (ignore: NullPointerException) { | ||
} | ||
} | ||
|
||
protected fun tryNotifyItemRangeRemoved(position: Int, count: Int) { | ||
try { | ||
notifyItemRangeRemoved(position, count) | ||
} catch (ignore: NullPointerException) { | ||
} | ||
} | ||
|
||
protected fun tryNotifyItemRangeInserted(position: Int, count: Int) { | ||
try { | ||
notifyItemRangeInserted(position, count) | ||
} catch (ignore: NullPointerException) { | ||
} | ||
} | ||
|
||
protected fun tryNotifyItemRangeChanged(position: Int, count: Int) { | ||
try { | ||
notifyItemRangeChanged(position, count) | ||
} catch (ignore: NullPointerException) { | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...artsScorecard/app/src/main/java/nl/entreco/dartsscorecard/di/setup/EditPlayerComponent.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,13 @@ | ||
package nl.entreco.dartsscorecard.di.setup | ||
|
||
import dagger.Subcomponent | ||
import nl.entreco.dartsscorecard.setup.edit.EditPlayerViewModel | ||
|
||
/** | ||
* Created by Entreco on 02/01/2018. | ||
*/ | ||
@EditPlayerScope | ||
@Subcomponent(modules = [(EditPlayerModule::class)]) | ||
interface EditPlayerComponent { | ||
fun viewModel(): EditPlayerViewModel | ||
} |
19 changes: 19 additions & 0 deletions
19
...d/DartsScorecard/app/src/main/java/nl/entreco/dartsscorecard/di/setup/EditPlayerModule.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,19 @@ | ||
package nl.entreco.dartsscorecard.di.setup | ||
|
||
import dagger.Module | ||
import dagger.Provides | ||
import javax.inject.Named | ||
|
||
/** | ||
* Created by Entreco on 02/01/2018. | ||
*/ | ||
@Module | ||
class EditPlayerModule(private val suggestedName: String) { | ||
|
||
@Provides | ||
@Named("suggestion") | ||
@EditPlayerScope | ||
fun provideSuggestedName(): String { | ||
return suggestedName | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...id/DartsScorecard/app/src/main/java/nl/entreco/dartsscorecard/di/setup/EditPlayerScope.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,10 @@ | ||
package nl.entreco.dartsscorecard.di.setup | ||
|
||
import javax.inject.Scope | ||
|
||
/** | ||
* Created by Entreco on 02/01/2018. | ||
*/ | ||
@Scope | ||
@Retention(AnnotationRetention.RUNTIME) | ||
annotation class EditPlayerScope |
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
11 changes: 10 additions & 1 deletion
11
android/DartsScorecard/app/src/main/java/nl/entreco/dartsscorecard/di/setup/Setup01Module.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 |
---|---|---|
@@ -1,9 +1,18 @@ | ||
package nl.entreco.dartsscorecard.di.setup | ||
|
||
import dagger.Module | ||
import dagger.Provides | ||
import nl.entreco.dartsscorecard.setup.Setup01Activity | ||
import nl.entreco.dartsscorecard.setup.Setup01Navigator | ||
|
||
/** | ||
* Created by Entreco on 20/12/2017. | ||
*/ | ||
@Module | ||
class Setup01Module | ||
class Setup01Module(private val activity: Setup01Activity) { | ||
@Provides | ||
@Setup01Scope | ||
fun provideNavigator(): Setup01Navigator { | ||
return Setup01Navigator(activity) | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
...artsScorecard/app/src/main/java/nl/entreco/dartsscorecard/di/viewmodel/db/TurnDbModule.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,28 @@ | ||
package nl.entreco.dartsscorecard.di.viewmodel.db | ||
|
||
import dagger.Module | ||
import dagger.Provides | ||
import nl.entreco.dartsscorecard.di.viewmodel.ActivityScope | ||
import nl.entreco.data.DscDatabase | ||
import nl.entreco.data.db.turn.TurnMapper | ||
import nl.entreco.data.play.repository.LocalTurnRepository | ||
import nl.entreco.domain.repository.TurnRepository | ||
|
||
/** | ||
* Created by Entreco on 23/12/2017. | ||
*/ | ||
@Module | ||
class TurnDbModule { | ||
|
||
@Provides | ||
@ActivityScope | ||
fun provideTurnMapper(): TurnMapper { | ||
return TurnMapper() | ||
} | ||
|
||
@Provides | ||
@ActivityScope | ||
fun provideTurnRepository(db: DscDatabase, mapper: TurnMapper): TurnRepository { | ||
return LocalTurnRepository(db, mapper) | ||
} | ||
} |
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.