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
private fun emailHintRequestSuccess(data: Intent?) { | |
val credential: Credential? = data?.getParcelableExtra(Credential.EXTRA_KEY) | |
credential?.let { | |
proceedOnMainScreen(it.id) | |
} | |
} |
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
private fun handleCredentialRequestResult(credentialRequestResult: CredentialRequestResult) { | |
if (credentialRequestResult.status.isSuccess) { | |
proceedOnMainScreen(credentialRequestResult.credential.id) | |
} else { | |
resolveCredentialRequest(credentialRequestResult.status) | |
} | |
} |
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
private fun resolveCredentialRequest(status: Status?) { | |
if (status?.statusCode == CommonStatusCodes.RESOLUTION_REQUIRED) { | |
initiateCredentialRequestResolution(status) | |
} else { | |
credentialRequestFailure() | |
} | |
} |
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
private fun initiateCredentialRequestResolution(status: Status?) { | |
try { | |
status?.startResolutionForResult(this, RC_CREDENTIALS_REQUEST) | |
} catch (sendIntentException: IntentSender.SendIntentException) { | |
credentialRequestResolutionFailure() | |
} | |
} |
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
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView( | |
LithoView | |
.create(this, ButtonContainer | |
.create(new ComponentContext(this)) |
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
#!/bin/sh | |
CMD=$1 | |
if [[ $ADB == "" ]]; then | |
ADB=adb | |
fi | |
if [[ $CMD != "on" && $CMD != "off" ]]; then | |
echo "Usage: $0 [on|off] [hhmm]" >&2 | |
exit |
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
def postCommitStatus(params = [:]) { | |
withCredentials([ | |
string([credentialsId: 'your-credentials-id', variable: 'GITHUB_API_TOKEN']) | |
]) { | |
def authHeaders = [[name: 'Authorization', value: "token ${GITHUB_API_TOKEN}"]] | |
def commit = params.commit | |
def requestBody = params.body | |
def statusUrl = "https://api.github.com/repos/repo-owner/repo-name/statuses/${commit}" | |
try { | |
def response = httpRequest acceptType: 'APPLICATION_JSON', contentType: 'APPLICATION_JSON', httpMode: 'POST', requestBody: requestBody, url: statusUrl, customHeaders: authHeaders |