Last active
May 17, 2019 12:40
-
-
Save amanjeetsingh150/4b34bc15081ec558136141e9d518d7ff 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