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
@Composable | |
fun SplashScreen(viewModel:SplashVM?,navHostController: NavHostController) { | |
val data = viewModel?.isDownloadData?.value | |
LaunchedEffect(key1 = data) { | |
when (data) { | |
is Resource.Success -> { | |
Log.d("SPLASH_SCREEN","MAIN SCREEN AÇILDI") | |
navHostController.navigate("main_screen") | |
} | |
} |
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
@Composable | |
fun SplashScreen(viewModel:SplashVM?,navHostController: NavHostController){ | |
val data = viewModel?.isDownloadData?.value | |
when(data){ | |
is Resource.Success ->{ | |
Log.d("SPLASH_SCREEN","MAIN SCREEN AÇILDI") | |
navHostController.navigate("main_screen") | |
} | |
} | |
} |
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
@HiltViewModel | |
class SplashVM @Inject constructor(private val getQuestionUseCase: QuestionUseCase) : ViewModel() { | |
var isDownloadData : MutableState<Resource<List<Question>>> = mutableStateOf(Resource.Loading(true)) | |
private set | |
init { | |
getQuestions() | |
} |
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
name: Java CI | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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
lifecycleScope.launchWhenResumed { | |
val response = try { | |
apolloClient(requireContext()).mutate(LoginMutation(email = Input.fromNullable("serkan.zaydn@gmail.com"))).toDeferred().await() | |
} catch (e: Exception) { | |
null | |
} | |
val login = response?.data?.login | |
} |
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
// AUTO-GENERATED FILE. DO NOT MODIFY. | |
// | |
// This class was automatically generated by Apollo GraphQL plugin from the GraphQL queries it found. | |
// It should not be modified by hand. | |
// | |
package com.example.rocketreserver | |
import com.apollographql.apollo.api.Input | |
import com.apollographql.apollo.api.Mutation | |
import com.apollographql.apollo.api.Operation |
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
mutation Login($email: String) { | |
login(email: $email) | |
} |
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
./gradlew downloadApolloSchema \ | |
--endpoint="https://your.domain/graphql/endpoint" \ #GraphQL endpoint | |
--schema="src/main/graphql/com/example/schema.json" #schema.json dosyasının ineceği path |
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
fun apolloClient(context: Context): ApolloClient { | |
check(Looper.myLooper() == Looper.getMainLooper()) { | |
"Only the main thread can get the apolloClient instance" | |
} | |
if (instance != null) { | |
return instance!! | |
} | |
val okHttpClient = OkHttpClient.Builder() |
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
implementation "com.apollographql.apollo:apollo-runtime:2.5.2" //Apollo | |
implementation "com.apollographql.apollo:apollo-coroutines-support:2.4.6" //Apollo Coroutine |