Skip to content

Instantly share code, notes, and snippets.

View RohitSurwase's full-sized avatar
💭
Slightly Busy

Rohit Surwase RohitSurwase

💭
Slightly Busy
View GitHub Profile
@RohitSurwase
RohitSurwase / Robo_Script.json
Created October 20, 2019 12:57
Example of a Robo Script.
[
{
"eventType": "VIEW_CLICKED",
"timestamp": 1570986000016,
"replacementText": "",
"actionCode": -1,
"delayTime": 0,
"canScrollTo": false,
"elementDescriptors": [
{
@RohitSurwase
RohitSurwase / CoroutineIntentService.kt
Last active February 4, 2023 10:02
IntentService (Service) using Kotlin Coroutines instead of Handler+Looper.
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 December 4, 2017 11:35
Calling Viewpager Fragment's Function on it's Visibility - Solid Solution.
private boolean notFirstTime;
@Override
public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser && notFirstTime) {
//TODO: Call function to be executed every time.
requestData();
}
}