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
import org.jetbrains.annotations.NotNull; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.Future; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TimeoutException; | |
public class ComputationFuture<T> implements Future<T> { |
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
/** | |
* Created by Prasanna on 28-11-2018. | |
*/ | |
class KotlinSingleton { | |
companion object { | |
@Volatile | |
private var INSTANCE: KotlinSingleton? = null | |
fun getInstance(id: String): KotlinSingleton = INSTANCE ?: synchronized(this) { | |
INSTANCE ?: buildInstance(id).also { INSTANCE = it } |
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
public void exportDatabase() { | |
try { | |
File sd = Environment.getExternalStorageDirectory(); | |
File data = Environment.getDataDirectory(); | |
if (sd.canWrite()) { | |
String currentDBPath = "path to db"; | |
String backupDBPath = "path to export"; | |
File currentDB = new File(data, currentDBPath); | |
File backupDB = new File(sd, backupDBPath); |
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 recyclerview; | |
import android.content.Context; | |
import android.os.Build; | |
import android.support.v4.view.MotionEventCompat; | |
import android.support.v7.widget.RecyclerView; | |
import android.support.v7.widget.RecyclerView.OnItemTouchListener; | |
import android.view.GestureDetector.SimpleOnGestureListener; | |
import android.view.MotionEvent; | |
import android.view.View; |
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
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) | |
#include <jni.h> | |
#include "platform/android/jni/JniHelper.h" | |
#include "AndroidInterfaceManager.h" | |
#include "InterfaceManagerInstance.h" | |
#include "CommonData.h" | |
using namespace std; |
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
public class Section { | |
public String title; | |
public String desc; | |
public List<App> apps; | |
public class App { | |
public String title; | |
public String rating; | |
} |
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 com.android.gifts.bottomnavigation; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.text.TextPaint; | |
import android.util.AttributeSet; |