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 State1 : IState1 { | |
var featureAvailable = false | |
private set | |
get() = field | |
var totalFeature = "" | |
private set | |
get() = field | |
var consumedFeature = "" | |
private set |
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 BaseContext(private var state: IBaseState) { | |
fun getState(): IBaseState { | |
return state | |
} | |
} | |
interface IBaseState { | |
fun setPackageExpiryVisibility() | |
} | |
interface IState1 : IBaseState { |
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 StateViewHolder(binding: ViewDataBinding) : RecyclerView.ViewHolder(binding.root) { | |
lateinit var viewModel: BaseViewModel | |
fun bind(info: Pair<Pair<Boolean, String>, Int>, remaining: Int) { | |
@DrawableRes val icon: Int | |
val stateContext: BaseStateContext | |
if (AppFlavor.country == Country.Bangladesh) { | |
icon=R.drawable.ico_state_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
interface IBaseStrategy { | |
fun isEnable(enable : Boolean) | |
} | |
interface IPendingStrategy : IBaseStrategy{ | |
} | |
interface IErrorStrategy : IBaseStrategy{ | |
var OnReUpload : (result : Result)-> Unit | |
} | |
interface IManageStrategy : IBaseStrategy{ |
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
/** Represents Module for Test Management | |
* @author Aveek | |
* @author www.myproject.com | |
* @version 1 | |
* @since 4.4.0 - Version | |
*/ | |
@Module | |
internal class TestModule (val context : TestManagement) { | |
/** | |
* provides viewModel of the XML |
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
const val addFragment = 1 | |
const val replaceFragment = 2 | |
private inline fun generateFragmentTransaction(fragmentToReplaceOrAdd : Fragment, addOrReplace: Int) : FragmentTransaction { | |
return when(addOrReplace) { | |
addFragment -> supportFragmentManager.beginTransaction().add(R.id.container_frame, fragmentToReplaceOrAdd) | |
else -> supportFragmentManager.beginTransaction().replace(R.id.container_frame, fragmentToReplaceOrAdd) | |
} | |
} | |
private fun fragmentAddOrReplacer(name : String, transaction : ()-> FragmentTransaction){ | |
transaction().apply { |
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
activity.setResult(Activity.RESULT_OK, Intent().apply { // this:intent | |
putExtra("response", true) | |
putExtra("message", "success") | |
putExtra("result", "ok") | |
}) | |
activity.setResult(Activity.RESULT_OK, Intent().also { // it:intent | |
it.putExtra("response", true) | |
it.putExtra("message", "success") | |
it.putExtra("result", "ok") |
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
val person = Person().apply{ | |
name = "aveek" | |
tel = "+98234552344" | |
}.also{ | |
Log.d("test",it.name) | |
} |
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
// Without Let | |
if(person!=null){ | |
doSomething() | |
} | |
// With Let | |
person?.let{ | |
doSomething() | |
} |
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
// Without run | |
fun printPersonName(person : Person){ | |
print(person.name) | |
} | |
// With run | |
fun printPersonName(person : Person) = person.run{ | |
print(name) | |
} |