Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Slightly Busy

Rohit Surwase RohitSurwase

💭
Slightly Busy
View GitHub Profile
@RohitSurwase
RohitSurwase / Robo_Script.json
Created Oct 20, 2019
Example of a Robo Script.
View Robo_Script.json
[
{
"eventType": "VIEW_CLICKED",
"timestamp": 1570986000016,
"replacementText": "",
"actionCode": -1,
"delayTime": 0,
"canScrollTo": false,
"elementDescriptors": [
{
@RohitSurwase
RohitSurwase / CoroutineIntentService.kt
Last active Nov 18, 2021
IntentService (Service) using Kotlin Coroutines instead of Handler+Looper.
View CoroutineIntentService.kt
import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.support.annotation.Nullable
import android.support.annotation.WorkerThread
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.channels.SendChannel
import kotlinx.coroutines.channels.actor
import kotlin.coroutines.CoroutineContext
@RohitSurwase
RohitSurwase / ViewPagerFirstFragment.class
Last active Dec 4, 2017
Calling Viewpager Fragment's Function on it's Visibility - Solid Solution.
View ViewPagerFirstFragment.class
private boolean notFirstTime;
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser && notFirstTime) {
//TODO: Call function to be executed every time.
requestData();
}
}