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
1. Open bash | |
2. goto root project | |
3. git config --global alias.change-commits '!'"f() { VAR=\$1; OLD=\$2; NEW=\$3; shift 3; git filter-branch --env-filter \"if [[ \\\"\$\`echo \$VAR\`\\\" = '\$OLD' ]]; then export \$VAR='\$NEW'; fi\" \$@; }; f" | |
4. git change-commits GIT_AUTHOR_EMAIL "[email protected]" "[email protected]" HEAD~50..HEAD |
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
/* | |
* Copyright (c) 2022 esabook. | |
* Author: egit | |
*/ | |
package com.esabook.app.services | |
import android.app.Activity | |
import android.content.BroadcastReceiver | |
import android.content.Context |
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
fun ImageView.loadImageWithGlide( | |
imgObj: Any?, | |
cacheMode: DiskCacheStrategy = DiskCacheStrategy.AUTOMATIC, | |
onFail: (() -> Unit?)? = null, | |
onSuccess: (() -> Unit?)? = null, | |
) { | |
try { | |
Glide.with(this) | |
.load(imgObj) | |
.placeholder(this.drawable) |
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
fun TabLayout.asItemIndicator(recyclerView: RecyclerView) { | |
//setup tab as dot indicator | |
removeAllTabs() | |
recyclerView.adapter?.itemCount?.downTo(1)?.forEach { _ -> | |
addTab(newTab()) | |
} | |
//make tabActiveIndex as/jump rvAdapterIndex | |
addOnTabSelectedListener(object : TabLayout.OnTabSelectedListener { | |
override fun onTabSelected(tab: TabLayout.Tab?) { |
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
#!/bin/sh | |
# One step wrapper to install aab to connected device, it downloads bundletool if its missing and signs the app with android debug certifiate. | |
# | |
# Usage: installFromAAB apk.aab <local-aab-path/apk.aab> | |
# | |
BASENAME="${1##*/}" | |
KEYSTORE=~/.android/debug.keystore | |
KS_ALIAS="androiddebugkey" | |
PASS="pass: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
package *; | |
import android.Manifest; | |
import android.annotation.SuppressLint; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.graphics.Bitmap; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Bundle; |
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 * | |
import android.text.format.DateUtils | |
import java.text.SimpleDateFormat | |
import java.util.* | |
import java.util.concurrent.TimeUnit.MILLISECONDS | |
import kotlin.math.abs | |
object DateFormatUtils { | |
val DEFAULT_FROM_DATE_PATTERN = "yyyy-MM-dd" |
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 *; | |
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.widget.FrameLayout; | |
import timber.log.Timber; | |
/** |
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 * | |
import android.os.Bundle | |
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.fragment.app.Fragment | |
class LayoutFragment : Fragment() { |
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
/** | |
* Execute code with silent crash mode<br> | |
* usage:<br> | |
* <pre> | |
* Ignore.of(()-> { | |
* String bankName = o.infoPayment.namaBank.toUpperCase().replace("BANK", ""); | |
* binding.tvBankName.setText(bankName); | |
* }); | |
* </pre> |
NewerOlder