(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.
//Empty edittext checking | |
if (txtbox1.getText().toString().isEmpty()) { | |
txtbox1.setError("This data is Required!"); | |
return false; | |
} else { | |
txtbox1.setError(null); | |
} | |
//Range edittext checking | |
if (txtbox2.getText().toString().isEmpty()) { |
//Empty edittext checking | |
if (!txtBoxReq.isEmptyTextBox()) | |
return; | |
//Range edittext checking | |
if (!txtBoxRange.isRangeTextValidate()) | |
return; | |
//Equal/Pattern edittext checking | |
if (!txtBoxDefault.isTextEqualToPattern()) |
╔═══════════════════╦═══════════════════════════╗ | |
║ Operations ║ Library Functions ║ | |
╠═══════════════════╬═══════════════════════════╣ | |
║ Empty edittext ║ isEmptyTextBox() ║ | |
║ ║ ║ | |
║ Range edittext ║ isRangeTextValidate() ║ | |
║ ║ ║ | |
║ Equal/Pattern ║ isTextEqualToPattern() ║ | |
║ Edittext ║ ║ | |
╚═══════════════════╩═══════════════════════════╝ |
package com.aliazaz.galleryapp; | |
import android.app.Application; | |
import com.facebook.drawee.backends.pipeline.Fresco; | |
public class MainApp extends Application { | |
@Override | |
public void onCreate() { |
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.aliazaz.galleryapp"> | |
<!---permissions--> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | |
<application | |
android:name=".MainApp" |
fun setAlertDialogView(flag: Boolean) | |
fun setMessage(message: String = "Loading Image...") | |
fun setTextColor(color: Int = Color.parseColor("#000000")) | |
fun setTextSize(txtsize: Float = 20f) | |
fun setAlertCancellable(cancel: Boolean = true) |
interface MainView { | |
interface UIView { | |
fun setTextView(analyzedText: String) | |
fun setBitmapOnImageView(bitmap: Bitmap) | |
fun setToast(message: String) |
class MainPresenter(private val mainActivity: MainActivity) : MainView.PresenterView { | |
private var permissionFlag = false | |
init { | |
onGettingPermission() | |
} | |
override fun grantPermission(): Boolean { | |
return permissionFlag |
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) |
(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.