Skip to content

Instantly share code, notes, and snippets.

View fanjavaid's full-sized avatar
:electron:

Fandi Akhmad fanjavaid

:electron:
View GitHub Profile
@fanjavaid
fanjavaid / ThousandFormatter.kt
Created August 15, 2022 15:06
Simple thousand formatter and cleaner
fun Long.formatThousand(): String {
val decimalFormatter = DecimalFormat("#,###")
return decimalFormatter.format(this)
}
fun String.clearThousandFormat(): String {
return this.replace(",", "")
}
@fanjavaid
fanjavaid / Components.kt
Created August 15, 2022 14:58
Formatting input to thousand separator Jetpack Compose
@Composable
fun ThousandFormatTextField() {
var text by remember {
mutableStateOf(TextFieldValue(""))
}
TextField(
value = text,
onValueChange = { newInput ->
val newValue = if (newInput.text.isNotBlank()) {
newInput.text
@fanjavaid
fanjavaid / SampleActivity7.kt
Last active December 3, 2021 04:53
Swipe Button using Motion Layout
package com.tempercube.motionlayout.motions
import android.animation.ObjectAnimator
import android.animation.ValueAnimator.REVERSE
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.Gravity
@fanjavaid
fanjavaid / error.log
Created June 25, 2020 03:40
error.log
env COCOAPODS_BINARY_BUILD_CONFIGURATION="Debug" bundle exec pod install --repo-update
🚀 Prebuild frameworks
Preparing to Merge: UISwift
Downloading Pods in the group
/usr/local/lib/ruby/gems/2.7.0/gems/nanaimo-0.2.6/lib/nanaimo/writer/pbxproj.rb:13: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/local/lib/ruby/gems/2.7.0/gems/nanaimo-0.2.6/lib/nanaimo/writer.rb:35: warning: The called method `initialize' is defined here
Analyzing dependencies
Pre-downloading: `NVActivityIndicatorView` from `https://github.com/bukalapak/NVActivityIndicatorView.git`, tag `bukalapak_1.3`
/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.8.4/lib/cocoapods/downloader/cache.rb:114: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/usr/local/lib/ruby/gems/2.7.0/gems/cocoapods-1.8.4/lib/cocoapods/downloader/request.rb:61: warning: The called method `slug' is defined here
val length = sources.size
var lastComparisonIndex = 0
var curr = 0
var i = 0
while (lastComparisonIndex < length) {
try {
if (curr % length == 0) curr = 0
if (i > 0 && i % length == 0)
lastComparisonIndex++
@fanjavaid
fanjavaid / error.log
Created July 29, 2019 17:21
Encoder Error 2
07-29 13:20:45.265 3548-3877/com.bukalapak.android E/linker: library /system/lib/libswscale.so with text relocation is whitelisted
07-29 13:20:45.268 3548-3877/com.bukalapak.android E/ACodec: [OMX.ffmpeg.h264.decoder] storeMetaDataInBuffers failed w/ err -1010
07-29 13:20:45.269 3548-3877/com.bukalapak.android E/OMXNodeInstance: getExtensionIndex(1:ffmpeg.h264.decoder, OMX.google.android.index.prepareForAdaptivePlayback) ERROR: UnsupportedIndex(0x8000101a)
07-29 13:20:45.269 3548-3877/com.bukalapak.android E/OMXNodeInstance: getConfig(1:ffmpeg.h264.decoder, ConfigCommonOutputCrop(0x700000f)) ERROR: Undefined(0x80001001)
07-29 13:20:45.286 3548-3878/com.bukalapak.android A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x60 in tid 3878 (eg.h264.decoder)
07-29 13:20:45.341 269-269/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-29 13:20:45.341 269-269/? A/DEBUG: Build fingerprint: 'Android/vbox86p/vbox86p:6.0/MRA58K/233:userdebug/test-keys'
07-29 13:20:45.341 269-269/? A/DEBUG
@fanjavaid
fanjavaid / error.log
Created July 29, 2019 17:16
Error decoder
07-29 10:14:42.662 8869-9210/com.bukalapak.android E/ACodec: [OMX.ffmpeg.h264.decoder] storeMetaDataInBuffers failed w/ err -1010
07-29 10:14:42.663 8869-9210/com.bukalapak.android E/OMXNodeInstance: getExtensionIndex(1:ffmpeg.h264.decoder, OMX.google.android.index.prepareForAdaptivePlayback) ERROR: UnsupportedIndex(0x8000101a)
07-29 10:14:42.663 8869-9210/com.bukalapak.android E/OMXNodeInstance: getConfig(1:ffmpeg.h264.decoder, ConfigCommonOutputCrop(0x700000f)) ERROR: Undefined(0x80001001)
@fanjavaid
fanjavaid / TransactionService.kt
Last active September 5, 2018 18:31
Update Transaction Payment Status
class TransactionService {
fun updateStatus(transactionId: Long, type: String, status: String): Boolean {
// Get Transaction by ID
val transaction = transactionRepository.findById(transactionId)
// If record exists
if (transaction.isPresent) {
transaction.get().apply {
// Check what type of status do you want to update
@fanjavaid
fanjavaid / CenteredImageButton.kt
Last active August 8, 2018 14:56
Center Icon and Text in Button
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Rect
import android.graphics.Typeface
import android.graphics.drawable.Drawable
import android.support.annotation.ColorRes
import android.support.annotation.DrawableRes
import android.support.v4.content.ContextCompat
import android.util.AttributeSet
09-05 20:31:50.566 15495-15495/com.example.android.emojify W/DynamiteModule: Local module descriptor class for com.google.android.gms.vision.dynamite not found.
09-05 20:31:50.583 15495-15495/com.example.android.emojify I/DynamiteModule: Considering local module com.google.android.gms.vision.dynamite:0 and remote module com.google.android.gms.vision.dynamite:1101
09-05 20:31:50.583 15495-15495/com.example.android.emojify I/DynamiteModule: Selected remote version of com.google.android.gms.vision.dynamite, version >= 1101
09-05 20:31:50.591 15495-15495/com.example.android.emojify W/System: ClassLoader referenced unknown path:
09-05 20:31:50.621 15495-15495/com.example.android.emojify W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/0000000c/n/armeabi-v7a
09-05 20:31:50.621 15495-15495/com.example.android.emojify W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/0000000c/n/armeabi
09-05 20:31:50.732 15495-15495/