diff --git a/app/src/main/graphql/org/ddnss/sfs/noise/GetMessages.graphql b/app/src/main/graphql/org/ddnss/sfs/noise/GetMessages.graphql index dc86a0b..cb7eef1 100644 --- a/app/src/main/graphql/org/ddnss/sfs/noise/GetMessages.graphql +++ b/app/src/main/graphql/org/ddnss/sfs/noise/GetMessages.graphql @@ -1,3 +1,3 @@ -query GetMessages{ +#query GetMessages{ -} \ No newline at end of file +#} \ No newline at end of file diff --git a/app/src/main/java/org/ddnss/sfs/git/wdg/noise/MainActivity.kt b/app/src/main/java/org/ddnss/sfs/git/wdg/noise/MainActivity.kt index 0944118..d1070ab 100644 --- a/app/src/main/java/org/ddnss/sfs/git/wdg/noise/MainActivity.kt +++ b/app/src/main/java/org/ddnss/sfs/git/wdg/noise/MainActivity.kt @@ -2,6 +2,7 @@ package org.ddnss.sfs.git.wdg.noise import android.os.Bundle import android.view.Menu +import android.widget.TextView import com.google.android.material.snackbar.Snackbar import com.google.android.material.navigation.NavigationView import androidx.navigation.findNavController @@ -11,6 +12,7 @@ import androidx.navigation.ui.setupActionBarWithNavController import androidx.navigation.ui.setupWithNavController import androidx.drawerlayout.widget.DrawerLayout import androidx.appcompat.app.AppCompatActivity +import androidx.lifecycle.lifecycleScope import org.ddnss.sfs.git.wdg.noise.databinding.ActivityMainBinding class MainActivity : AppCompatActivity() { @@ -42,6 +44,18 @@ class MainActivity : AppCompatActivity() { ) setupActionBarWithNavController(navController, appBarConfiguration) navView.setupWithNavController(navController) + getData() + } + + fun getData(){ + val text: TextView = findViewById(R.id.testData) + + lifecycleScope.launchWhenResumed { + val response = apolloClient.query(GetUsersQuery()).execute() + + //Log.d("LaunchList", "Success ${response.data}") + text.text = response.data.toString() + } } override fun onCreateOptionsMenu(menu: Menu): Boolean { diff --git a/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt b/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt index e1cfc99..ed6b85f 100644 --- a/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt +++ b/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryFragment.kt @@ -4,6 +4,7 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.TextView import androidx.fragment.app.Fragment import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.lifecycleScope @@ -20,6 +21,8 @@ class GalleryFragment : Fragment() { // onDestroyView. private val binding get() = _binding!! + //var text: TextView = findViewById(R.id.testData) as TextView + override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -37,11 +40,6 @@ class GalleryFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - lifecycleScope.launchWhenResumed { - val response = apolloClient.query(GetUsersQuery()).execute() - - - } } diff --git a/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryViewModel.kt b/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryViewModel.kt index c598637..45e59b9 100644 --- a/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryViewModel.kt +++ b/app/src/main/java/org/ddnss/sfs/git/wdg/noise/ui/gallery/GalleryViewModel.kt @@ -6,8 +6,5 @@ import androidx.lifecycle.ViewModel class GalleryViewModel : ViewModel() { - private val _text = MutableLiveData().apply { - value = "This is gallery Fragment" - } - val text: LiveData = _text + } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_gallery.xml b/app/src/main/res/layout/fragment_gallery.xml index 4e39916..7e5fd03 100644 --- a/app/src/main/res/layout/fragment_gallery.xml +++ b/app/src/main/res/layout/fragment_gallery.xml @@ -6,11 +6,4 @@ android:layout_height="match_parent" tools:context=".ui.gallery.GalleryFragment"> - diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 5090604..d15e917 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -6,4 +6,12 @@ android:layout_height="match_parent" tools:context=".ui.home.HomeFragment"> + + \ No newline at end of file