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.wajahatkarim.splashscreen | |
import android.content.Intent | |
import androidx.appcompat.app.AppCompatActivity | |
import android.os.Bundle | |
import kotlinx.coroutines.* | |
class CoroutinesSplashActivity : AppCompatActivity() { | |
val activityScope = CoroutineScope(Dispatchers.Main) |
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
<!-- reset scratch variables at the start --> | |
{{ $.Scratch.Set "bl_title" false }} | |
{{ $.Scratch.Set "bl_subtitle" false }} | |
{{ $.Scratch.Set "bl_link" false }} | |
{{ $.Scratch.Set "bl_thumbnail" false }} | |
{{ if .IsNamedParams }} | |
{{ $.Scratch.Set "bl_subtitle" (.Get "subtitle") }} | |
{{ $.Scratch.Set "bl_link" (.Get "link") }} | |
{{ $.Scratch.Set "bl_thumbnail" (.Get "thumbnail") }} |
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
// TakePicture Contract Registration | |
private val takePicture = registerForActivityResult(ActivityResultContracts.TakePicture()) {bitmap -> | |
bitmap?.let { | |
imageView.setImageBitmap(bitmap) | |
} | |
} | |
// Calling the takePicture contract | |
captureButton.setOnClickListener { | |
var imageUri: Uri? = null |
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
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
ext { | |
kotlin_version = '1.4.21' | |
} | |
repositories { | |
google() | |
jcenter() | |
} | |
dependencies { |
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
/** | |
* Kotlin Extensions for simpler, easier and funw way | |
* of launching of Activities | |
*/ | |
inline fun <reified T : Any> Activity.launchActivity ( | |
requestCode: Int = -1, | |
options: Bundle? = null, | |
noinline init: Intent.() -> Unit = {}) | |
{ |
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
object YourKeys { | |
init { | |
System.loadLibrary("native-lib") | |
} | |
external fun apiKey(): String | |
} | |
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
#include <jni.h> | |
#include <string> | |
extern "C" JNIEXPORT jstringJNICALL | |
Java_com_package_name_YourKeys_apiKey(JNIEnv *env, jobject object) { | |
std::string api_key = "your_api_key"; | |
return env->NewStringUTF(api_key.c_str()); |
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
android { | |
compileSdkVersion 23 | |
buildToolsVersion "23.0.2" | |
defaultConfig { | |
applicationId "com.texturelabs.rosera.pop_movies" | |
minSdkVersion 14 | |
targetSdkVersion 23 | |
versionCode 1 | |
versionName "1.0" |
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
object Constants { | |
const val API_KEY = "abcdefg2q4qsaf34rtyy421k" | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!--API Key--> | |
<string name="api_key">abcdefg2q4qsaf34rtyy421k</string> | |
</resources> |
NewerOlder