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
productFlavors { | |
appin { | |
manifestPlaceholders = [hostName: "www.xyz.in", deepLinkPlaceholder: generateData("www.xyz.in", listOfDeepLinkUrls, locales, ["www.xyz.in"])] | |
} | |
appza { | |
manifestPlaceholders = [hostName: "www.xyz.co.za", deepLinkPlaceholder: generateData("www.xyz.co.za", listOfDeepLinkUrls, locales, ["www.xyz.co.za"])] | |
} | |
} |
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
android.applicationVariants.all { variant -> | |
variant.outputs.all { output -> | |
output.processManifest.doLast { | |
def placeholders = variant.mergedFlavor.manifestPlaceholders; | |
if (placeholders == null || placeholders.isEmpty()) { | |
return | |
} | |
def buildType = "${variant.getFlavorName()}${variant.buildType.name.capitalize()}" | |
String manifestDir = "build/intermediates/merged_manifests/$buildType" |
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
ext { | |
listOfDeepLinkUrls = new ArrayList<String>() | |
listOfDeepLinkUrls.add("/home") | |
locales = ["en", "ar","es","hi-IN"] | |
} | |
ext.generateData = { host, listOfDeepLinkUrls, locales,listOfDomains -> | |
String links = "" | |
listOfDeepLinkUrls.each{ item -> |
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
override fun onSectionClicked(entity: Sections, absolutePosition: Int) { | |
if (viewModel.orignalSectionList.size <= 1) return | |
val mainAdapter = adapterWrapper.getMainAdapter() | |
adapterWrapper.swapAdapter() | |
viewModel.sectionList.forEachIndexed { index, section -> | |
val nestedSelectHeaderAdapter = NestedSelectHeaderAdapter(section, this@NestedFilterViewFragment) | |
mainAdapter.addAdapter(nestedSelectHeaderAdapter) | |
if (entity.sectionIndex == index && section.isSelected) { | |
addAdapterToMergeAdapter(section, index + 1) | |
} |
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
class NestedFilterViewAdapterWrapper { | |
private val mainAdapter = ConcatAdapter() | |
fun getMainAdapter() = mainAdapter | |
fun refreshAdapters() = getMainAdapter().adapters.map { it.notifyDataSetChanged() } | |
fun swapAdapter() = getMainAdapter().removeAllAdapters() |
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
package com.example.expandablerecyclerview.data.nestedselect | |
import androidx.databinding.Observable | |
import androidx.databinding.ObservableField | |
data class SelectableEntity(var id: String = "", var itemName: String = "", var isSelected: Boolean = false) { | |
val selectableField = ObservableField(isSelected) |
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
package com.example.expandablerecyclerview.data.nestedselect | |
import androidx.databinding.Observable | |
import androidx.databinding.ObservableField | |
import kotlin.collections.ArrayList | |
data class Sections(var id: String?, | |
var sectionName: String, | |
var isMultiSelectEnabled: Boolean = false, | |
var items: List<SelectableEntity> = ArrayList(), |
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
open class UserViewModel @Inject constructor(private val repository: UserRepository, @Named("default") private val defaultDispatcher: CoroutineDispatcher) : BaseViewModel() { | |
private val userData = MutableLiveData<DisplayData>() | |
fun getData(): LiveData<DisplayData> = userData | |
fun fetchUserData(username: String) = viewModelScope.launch(defaultDispatcher) { | |
viewStatus.postValue(ViewStatus.LOADING) | |
try { | |
val user = repository.fetchRepository("pranay1494") | |
userData.postValue(getUserDisplayData(user)) |
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
package com.example.coroutinesdemo.base | |
import kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.Dispatchers | |
data class CoroutineDispatcherProvider constructor( | |
val main: CoroutineDispatcher = Dispatchers.Main, | |
val default: CoroutineDispatcher = Dispatchers.Default, | |
val io: CoroutineDispatcher = Dispatchers.IO | |
) |
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
@Before | |
fun setUp(){ | |
MockitoAnnotations.initMocks(this) | |
viewModel = UserViewModel(repository,dispatcherRule.testDispatcher) | |
viewModel.getData().observeForever(observer) | |
} |
NewerOlder