Skip to content

Instantly share code, notes, and snippets.

@Judas
Judas / customChatButton.swift
Last active March 20, 2023 13:51
iAdvize iOS SDK - Custom Chat Button
class CustomerClass {
func updateChatButton() {
guard IAdvizeSDK.shared.activationStatus == .activated else {
hideChatButton()
return
}
guard !IAdvizeSDK.shared.chatboxController.isChatboxPresented() else {
hideChatButton()
return
@Judas
Judas / NotificationService.kt
Created September 22, 2021 07:21
iAdvize Android notification
class NotificationService : FirebaseMessagingService() {
override fun onNewToken(token: String) {
super.onNewToken(token)
IAdvizeSDK.notificationController.registerPushToken(token)
}
override fun onMessageReceived(remoteMessage: RemoteMessage) {
if (IAdvizeSDK.notificationController.isIAdvizePushNotification(remoteMessage.data)
&& !IAdvizeSDK.chatboxController.isChatboxPresented()
) {
@Judas
Judas / ActivityLifecycleController.kt
Last active May 13, 2022 16:28
iAdvize Android SDK - Chat button overlay management
class ActivityLifecycleController constructor(listener: CurrentActivityUpdatedListener) :
Application.ActivityLifecycleCallbacks {
interface CurrentActivityUpdatedListener {
fun onCurrentActivityUpdated()
}
/**
* Current activity displayed in screen.
*/
@Judas
Judas / aligned.png
Last active February 21, 2019 14:10
Stepper Alignment
aligned.png
@Judas
Judas / repoid.sh
Created August 2, 2016 10:00
Custom script to manage local/remote development environment
#!/bin/sh
function sync {
if ! [ -e "/usr/local/bin/repo" ] ; then
echo "[repoid] ==> Downloading repo script"
curl -s https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo
chmod a+x /usr/local/bin/repo
fi
echo "[repoid] ==> Initializing repositories"
@Judas
Judas / default.xml
Created August 2, 2016 09:59
Repo configuration file
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="origin" fetch="https://github.com/yourorg" />
<default remote="origin" revision="develop" />
<project remote="origin" name="mobile-android-authentication-ui" path="modules/authentication-ui" />
<project remote="origin" name="mobile-android-conversation-ui" path="modules/conversation-ui" />
<project remote="origin" name="mobile-android-livefeed-ui" path="modules/livefeed-ui" />
<project remote="origin" name="mobile-android-stats-ui" path="modules/stats-ui" />
<project remote="origin" name="mobile-android-user-profile-ui" path="modules/user-profile-ui" />
@Judas
Judas / release.sh
Created August 1, 2016 15:46
Release script for Android module (git-flow, semver, dependencies...)
#!/bin/sh
function printHelp {
echo ""
echo "USAGE: release <command>"
echo " help Shows this help message."
echo " major Releases a major version"
echo " minor Releases a minor version"
echo " patch Releases a patch version"
}
@Judas
Judas / AnimatedAdapter.java
Last active January 21, 2016 10:29
Animated Adapter for RecyclerView with model use-case
package com.judas.protos.recyclerview.adapters;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
public abstract class AnimatedAdapter<VH extends RecyclerView.ViewHolder, T> extends RecyclerView.Adapter<VH> {