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
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.widget.EditText; | |
public class CPFFormatter implements TextWatcher { | |
private final String CPF_MASK = "###.###.###-##"; | |
private final char[] CPF_MASK_ARRAY = CPF_MASK.toCharArray(); | |
private boolean isInTextChanged = false; | |
private boolean isInAfterTextChanged = false; |
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
import android.app.Activity | |
import android.content.Context | |
import android.util.Log | |
import com.android.billingclient.api.AcknowledgePurchaseParams | |
import com.android.billingclient.api.BillingClient | |
import com.android.billingclient.api.BillingClientStateListener | |
import com.android.billingclient.api.BillingFlowParams | |
import com.android.billingclient.api.BillingResult | |
import com.android.billingclient.api.Purchase | |
import com.android.billingclient.api.PurchasesUpdatedListener |
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
applicationVariants.all { variant -> | |
variant.resValue "string", "versionName", variant.versionName | |
variant.outputs.all { | |
outputFileName = archivesBaseName | |
outputFileName += "-v" + variant.versionName + "-" + variant.buildType.name + "-" + new Date().format('Mddyyyy') | |
outputFileName += ".apk" | |
} | |
} |
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
import android.animation.AnimatorSet | |
import android.animation.ObjectAnimator | |
import android.annotation.SuppressLint | |
import android.content.Context | |
import android.util.AttributeSet | |
import android.view.GestureDetector | |
import android.view.MotionEvent | |
import android.view.View | |
import android.widget.FrameLayout | |
import androidx.core.view.GestureDetectorCompat |
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
import android.content.ContentUris | |
import android.content.Context | |
import android.database.Cursor | |
import android.net.Uri | |
import android.os.Build | |
import android.os.Environment | |
import android.provider.DocumentsContract | |
import android.provider.MediaStore | |
import java.io.File | |
import java.io.FileOutputStream |
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
import android.text.Editable | |
import android.text.TextWatcher | |
import android.widget.EditText | |
/** | |
* @author Hitesh | |
* @version 1.0 | |
* @since 14-08-2019 | |
*/ |
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
import os | |
import shutil | |
import sys | |
if len(sys.argv)>1: | |
rootdir = sys.argv[1] | |
else: | |
# rootdir = os.path.dirname(os.path.realpath(__file__)) | |
#rootdir = 'D:\\example\\projects\\project name' | |
rootdir = 'D:\\AndroidStuioWS\\Good-work\\good-work-android' |
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
import android.util.Base64; | |
import java.nio.ByteBuffer; | |
import java.security.SecureRandom; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.SecretKeySpec; | |
/** |
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
/*That's how we do it. In Application class override onConfigurationChanged() like this. If you want different behavior for different activities - override onConfigurationChanged() in Activity. | |
Don't forget to add manifest tag android:configChanges="fontScale" since you are hadnling this configuration change yourself.*/ | |
@Override | |
public void onConfigurationChanged(Configuration newConfig) { | |
super.onConfigurationChanged(newConfig); | |
// In some cases modifying newConfig leads to unexpected behavior, | |
// so it's better to edit new instance. |
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.devdigital.eztp.utils.validator | |
import com.devdigital.eztp.extensions.getTrimString | |
import com.google.android.material.textfield.TextInputLayout | |
import kotlinx.android.synthetic.main.component_edittext.view.* | |
import java.util.regex.Pattern | |
/** | |
* @author Hitesh | |
* @version 1.0 |
NewerOlder