-
-
Save SonPatrick/c0be9e4feec21a0ff7458fd912f054a2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
client=setupApollo() | |
client.query(FindQuery //From the auto generated class | |
.builder() | |
.name(repo_name_edittext.text.toString()) //Passing required arguments | |
.owner(owner_name_edittext.text.toString()) //Passing required arguments | |
.build()) | |
.enqueue(object : ApolloCall.Callback<FindQuery.Data>() { | |
override fun onFailure(e: ApolloException) { | |
Log.info(e.message.toString()) | |
} | |
override fun onResponse(response: Response<FindQuery.Data>) { | |
Log.info(" " + response.data()?.repository()) | |
runOnUiThread({ | |
progress_bar.visibility = View.GONE | |
name_text_view.text = String.format(getString(R.string.name_text), | |
response.data()?.repository()?.name()) | |
description_text_view.text = String.format(getString(R.string.description_text), | |
response.data()?.repository()?.description()) | |
forks_text_view.text = String.format(getString(R.string.fork_count_text), | |
response.data()?.repository()?.forkCount().toString()) | |
url_text_view.text = String.format(getString(R.string.url_count_text), | |
response.data()?.repository()?.url().toString()) | |
}) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment