(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
╔══════════╦═════════════════╦═══════════════╦═══════════════╗ | |
║ Function ║ Receiver (this) ║ Argument (it) ║ Result ║ | |
╠══════════╬═════════════════╬═══════════════╬═══════════════╣ | |
║ let ║ this@MyClass ║ String("...") ║ Int(42) ║ | |
║ run ║ String("...") ║ N\A ║ Int(42) ║ | |
║ run* ║ this@MyClass ║ N\A ║ Int(42) ║ | |
║ with* ║ String("...") ║ N\A ║ Int(42) ║ | |
║ apply ║ String("...") ║ N\A ║ String("...") ║ | |
║ also ║ this@MyClass ║ String("...") ║ String("...") ║ | |
╚══════════╩═════════════════╩═══════════════╩═══════════════╝ |
//fldGrpSecA01: is the view group in which whole layout is defined in xml | |
Clear.clearAllFields(fldGrpSecA01); |
//Clearing edittext | |
txtbox1.setText(null); | |
txtbox1.clearFocus(); | |
txtbox1.setError(null); | |
//Clearing Radiogroup | |
mnc2.clearCheck() | |
mnc2.clearFocus(); | |
mnc2.setError(null); |
//fldGrpSecA01: is the view group in which whole layout is defined in xml | |
Validator.emptyCheckingContainer(this, fldGrpSecA01); |
//Empty edittext checking | |
if (txtbox1.getText().toString().isEmpty()) { | |
txtbox1.setError("This data is Required!"); | |
return false; | |
} else { | |
txtbox1.setError(null); | |
} | |
//Equal/Pattern edittext checking | |
if (!txtBoxDefault.isTextEqualToPattern()) |
fun clearCheckBoxes(container: ViewGroup, flag: Boolean? = null) | |
fun clearRadioGroup(view: RadioGroup, flag: Boolean? = null) | |
fun clearAllFields(view: View, flag: Boolean? = null) |
fun emptyTextBox(context: Context, txt: EditText, toggleFlag: Boolean = true): Boolean | |
fun emptyTextView(context: Context, txt: TextView, toggleFlag: Boolean = true): Boolean | |
fun emptyCustomTextBox(context: Context, txt: TextView, msg: String, toggleFlag: Boolean = true): Boolean | |
fun emptyEditTextPicker(context: Context, txt: EditText, toggleFlag: Boolean = true): Boolean | |
fun rangeTextBox(context: Context, txt: EditText, min: Int, max: Int, type: String, toggleFlag: Boolean = true): Boolean |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
class MainActivity : AppCompatActivity(), MainView.UIView { | |
private val CAMERA_REQUEST = 1001 | |
private lateinit var presenter: MainPresenter | |
private lateinit var baseDialog: BaseDialogPresenter | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) |
class MainPresenter(private val mainActivity: MainActivity) : MainView.PresenterView { | |
private var permissionFlag = false | |
init { | |
onGettingPermission() | |
} | |
override fun grantPermission(): Boolean { | |
return permissionFlag |