Skip to content

Instantly share code, notes, and snippets.

View mo7amd89's full-sized avatar

Mohammed Imam mo7amd89

View GitHub Profile
@mo7amd89
mo7amd89 / UnsafeHttpClient.kt
Last active June 11, 2023 12:49 — forked from maiconhellmann/UnsafeOkHttpClient.kt
UnsafeHttpClient wrote in Kotlin
import okhttp3.OkHttpClient
import java.security.cert.CertificateException
import javax.net.ssl.SSLContext
import javax.net.ssl.TrustManager
import javax.net.ssl.X509TrustManager
class UnsafeOkHttpClient {
companion object {
fun getUnsafeOkHttpClient(): OkHttpClient.Builder {
try {
@mo7amd89
mo7amd89 / logo.md
Last active November 13, 2023 10:56

#ITS logo logo

@mo7amd89
mo7amd89 / ApolloRequestHandler.kt
Created January 8, 2024 06:18 — forked from sahalnazar/ApolloRequestHandler.kt
GraphQL request handler helper class for Apollo Client in Kotlin
import com.apollographql.apollo3.ApolloClient
import com.apollographql.apollo3.api.ApolloResponse
import com.apollographql.apollo3.api.Mutation
import com.apollographql.apollo3.api.Operation
import com.apollographql.apollo3.api.Query
import com.apollographql.apollo3.exception.ApolloException
import timber.log.Timber
/**
* This class handles the execution of GraphQL queries and mutations using the Apollo client.
@mo7amd89
mo7amd89 / ApiCall.kt
Created January 11, 2024 07:04
Handle api call Android kotlin
import kotlinx.coroutines.*
// this code snipped from Vengatesh M.’s Post https://www.linkedin.com/feed/update/urn:li:activity:7150818581406994432/
fun main() {
val viewmodel = ViewModel()
runBlocking {
viewmodel.getDataFromApi()
}
}
@mo7amd89
mo7amd89 / FlipCard.kt
Created April 21, 2024 13:04 — forked from ardakazanci/FlipCard.kt
Flip Card with Jetpack Compose
@Composable
fun FlipActionScreen() {
var flippedState by remember { mutableStateOf(false) }
val rotationY by animateFloatAsState(
targetValue = if (flippedState) 180f else 0f,
animationSpec = spring(
dampingRatio = Spring.DampingRatioHighBouncy,
stiffness = Spring.StiffnessVeryLow
)
)

TAKE A PHOTO WITH CAMERA IN KOTLIN

SETTING

Step-1

Create provider_paths.xml in res/xml folder and write below code in it.

<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
@mo7amd89
mo7amd89 / play-auth-proguard-rules.pro
Created October 14, 2024 10:11 — forked from ChanSek/play-auth-proguard-rules.pro
ProGuard rules for Google Play Services (Authentication)
-keepclassmembers class com.google.android.gms.dynamite.DynamiteModule {
** MODULE_ID;
** MODULE_VERSION;
** sClassLoader;
}
-keepclassmembers class com.google.android.gms.internal.in {
** mOrigin;
** mCreationTimestamp;
** mName;
** mValue;