Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
waiting for gradle to finish

Ajith v Giri ajithvgiri

👨‍💻
waiting for gradle to finish
View GitHub Profile
View AndroidNative.java
package ch.milosz.reactnative;
public class AndroidNative {
public static class AppConstants {
public static Boolean isAppForeground = true;
public static Boolean isMeetingStarted = false;
}
}
View RNZoomUsModule.java
package ch.milosz.reactnative;
import android.util.Log;
import android.widget.Toast;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
@ajithvgiri
ajithvgiri / FormValidation.kt
Created Jun 1, 2021
formvalidation example
View FormValidation.kt
private var email = MutableLiveData<String>().apply { value = "" }
private var password = MutableLiveData<String>()
var emailErrorMsg = MutableLiveData<String>()
var passwordErrorMsg = MutableLiveData<String>()
var isEmailErrorMsgEnabled = MutableLiveData<Boolean>()
var isPasswordErrorMsgEnabled = MutableLiveData<Boolean>()
fun performValidation(){
@ajithvgiri
ajithvgiri / PreferenceHelper.kt
Created Apr 11, 2020
SharePreference Extension function for Kotlin
View PreferenceHelper.kt
import android.content.Context
import android.content.SharedPreferences
object PreferenceHelper {
fun qkopyPrefs(context: Context, name: String = "AppPreference"): SharedPreferences = context.getSharedPreferences(name, Context.MODE_PRIVATE)
inline fun SharedPreferences.edit(operation: (SharedPreferences.Editor) -> Unit) {
val editor = this.edit()
operation(editor)
@ajithvgiri
ajithvgiri / search result.json
Created Dec 21, 2019
Online Movies Database Search Result
View search result.json
{
"Search": [
{
"Title": "Harry Potter and the Deathly Hallows: Part 2",
"Year": "2011",
"imdbID": "tt1201607",
"Type": "movie",
"Poster": "https://m.media-amazon.com/images/M/MV5BMjIyZGU4YzUtNDkzYi00ZDRhLTljYzctYTMxMDQ4M2E0Y2YxXkEyXkFqcGdeQXVyNTIzOTk5ODM@._V1_SX300.jpg"
},
{
View example.json
{
"glossary":{
"title":"example glossary",
"GlossDiv":{
"title":"S",
"GlossList":{
"GlossEntry":{
"ID":"SGML",
"SortAs":"SGML",
"GlossTerm":"Standard Generalized Markup Language",
@ajithvgiri
ajithvgiri / call.html
Created Aug 15, 2019
Auto call script for Qkopy
View call.html
<!DOCTYPE html>
<html>
<body>
<a id="call" href="tel:+91 7907764039">Call</a>
<script>
//Click on load.
window.onload = function () {
document.getElementById('call').click()
View fyrubot.scpt
# activate the bot only if your IDE/Editor application is active
tell application "Android Studio" # You can change the IDE/Editor name eg: Xcode or Atom
activate
repeat
set title to "Fyru bot"
set message to "I am making auto commit & push"
display notification message with title title sound name "Glass"
# change the project path,commit message and the branch
do shell script "cd Users/ajithvgiri/AndroidStudioProjects/ExampleProject && git add -A && git commit -m 'commit from Fyru bot' && git push origin development"
delay 14400 # you can change the delay time current 14400 seconds = 4 hours
@ajithvgiri
ajithvgiri / DateTimeUtils.kt
Created May 10, 2019
String to Date & Date to Elapse Time Converstion
View DateTimeUtils.kt
//String to Date Conversion
fun toFeedDateParser(strParseDate: String?): Date? {
return if (!strParseDate.isNullOrEmpty()) {
val tz = TimeZone.getTimeZone("UTC")
// DateFormat feedFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.ENGLISH);
val feedFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.ENGLISH)
feedFormat.timeZone = tz
var newDate: Date? = null
View circle_shape.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="oval">
<size android:width="100dp"
android:height="100dp"/>
<solid android:color="#59d5fe"/>
</shape>
</item>
</selector>