-
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.
- Loading branch information
Sergey Korney
committed
Feb 16, 2024
1 parent
e7769e4
commit 03e7b18
Showing
23 changed files
with
797 additions
and
119 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
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/com/affise/app/dependencies/fragments/modules/ApiFragmentModule.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 com.affise.app.dependencies.fragments.modules | ||
|
||
import androidx.lifecycle.ViewModelProvider | ||
import com.affise.app.dependencies.models.DaggerViewModelFactory | ||
import com.affise.app.ui.activity.main.MenuHolder | ||
import com.affise.app.ui.fragments.api.ApiContract | ||
import com.affise.app.ui.fragments.api.ApiFragment | ||
import com.affise.app.ui.fragments.api.ApiViewModel | ||
import dagger.Module | ||
import dagger.Provides | ||
|
||
@Module | ||
class ApiFragmentModule { | ||
|
||
@Provides | ||
fun provideMenuHolder( | ||
fragment: ApiFragment | ||
): MenuHolder = fragment.requireActivity() as MenuHolder | ||
|
||
@Provides | ||
fun provideViewModel( | ||
fragment: ApiFragment, | ||
viewModelFactory: DaggerViewModelFactory | ||
): ApiContract.ViewModel = ViewModelProvider( | ||
fragment, viewModelFactory | ||
).get(ApiViewModel::class.java) | ||
} |
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
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/affise/app/ui/fragments/api/ApiContract.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,26 @@ | ||
package com.affise.app.ui.fragments.api | ||
|
||
import androidx.lifecycle.LiveData | ||
import com.affise.attribution.referrer.ReferrerKey | ||
|
||
interface ApiContract { | ||
interface ViewModel { | ||
val offlineModeState: LiveData<Boolean> | ||
val backgroundTrackingModeState: LiveData<Boolean> | ||
val trackingModeState: LiveData<Boolean> | ||
val output: LiveData<String> | ||
fun onDebugValidateClicked() | ||
fun onRegisterDeeplinkClicked() | ||
fun onGetReferrerClicked() | ||
fun onGetReferrerValueClicked(key: ReferrerKey) | ||
fun onStatusClicked() | ||
fun onRandomPushTokenClicked() | ||
fun onRandomUserIdClicked() | ||
fun onRandomDeviceIdClicked() | ||
fun onProvidersClicked() | ||
fun onSetOfflineModeCheckboxClicked(isChecked: Boolean) | ||
fun onSetBackgroundTrackingModeCheckboxClicked(isChecked: Boolean) | ||
fun onSetTrackingModeCheckboxClicked(isChecked: Boolean) | ||
fun clearOutput() | ||
} | ||
} |
Oops, something went wrong.