Skip to content

Instantly share code, notes, and snippets.

Avatar
🇵🇰
Passion to help others 😊

Ali Azaz Alam AliAzaz

🇵🇰
Passion to help others 😊
View GitHub Profile
View Edittext_old_validation.java
//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()) {
@AliAzaz
AliAzaz / Edittext_new_validation.java
Last active May 20, 2019
Newly adopted method for validation using EdittextPicker Library
View Edittext_new_validation.java
//Empty edittext checking
if (!txtBoxReq.isEmptyTextBox())
return;
//Range edittext checking
if (!txtBoxRange.isRangeTextValidate())
return;
//Equal/Pattern edittext checking
if (!txtBoxDefault.isTextEqualToPattern())
@AliAzaz
AliAzaz / EdittextPicker_Library_Functions.txt
Last active May 20, 2019
EdittextPicker Library provided functions
View EdittextPicker_Library_Functions.txt
╔═══════════════════╦═══════════════════════════╗
║ Operations ║ Library Functions ║
╠═══════════════════╬═══════════════════════════╣
║ Empty edittext ║ isEmptyTextBox() ║
║ ║ ║
║ Range edittext ║ isRangeTextValidate() ║
║ ║ ║
║ Equal/Pattern ║ isTextEqualToPattern() ║
║ Edittext ║ ║
╚═══════════════════╩═══════════════════════════╝
@AliAzaz
AliAzaz / MainApp.java
Created May 28, 2019
Application file for Fresco implementation
View MainApp.java
package com.aliazaz.galleryapp;
import android.app.Application;
import com.facebook.drawee.backends.pipeline.Fresco;
public class MainApp extends Application {
@Override
public void onCreate() {
@AliAzaz
AliAzaz / AndroidManifest.xml
Created May 28, 2019
Manifest file for Fresco implementation
View AndroidManifest.xml
<?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"
@AliAzaz
AliAzaz / BaseDialogView.kt
Last active Sep 6, 2019
Custom Base Alert Dialog provided functions
View BaseDialogView.kt
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)
@AliAzaz
AliAzaz / FirebaseML01_View.kt
Last active Sep 14, 2019
View class of text recognizer and label in image using Firebase ML Kit
View FirebaseML01_View.kt
interface MainView {
interface UIView {
fun setTextView(analyzedText: String)
fun setBitmapOnImageView(bitmap: Bitmap)
fun setToast(message: String)
@AliAzaz
AliAzaz / FirebaseML01_Presenter.kt
Created Sep 14, 2019
Presenter class of text recognizer and label in image using Firebase ML Kit
View FirebaseML01_Presenter.kt
class MainPresenter(private val mainActivity: MainActivity) : MainView.PresenterView {
private var permissionFlag = false
init {
onGettingPermission()
}
override fun grantPermission(): Boolean {
return permissionFlag
@AliAzaz
AliAzaz / FirebaseML01_MainActivity.kt
Created Sep 14, 2019
MainActivity class of text recognizer and label in image using Firebase ML Kit
View FirebaseML01_MainActivity.kt
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)
@AliAzaz
AliAzaz / introrx.md
Created Dec 6, 2019 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md