/** * Override this to generate a customized intent for starting ParseLoginActivity. * However, the preferred method for configuring Parse Login UI components is by * specifying activity options in AndroidManifest.xml, not by overriding this. * * @return Intent that can be used to start ParseLoginActivity */ protected Intent getParseLoginIntent() { ParseLoginBuilder builder = new ParseLoginBuilder(this); return builder.build(); }
/** * Customize the text of the Parse username/password login button. * * @param id * The resource ID for the text to display on the login button. * @return The caller instance to allow chaining. */ public ParseLoginBuilder setParseLoginButtonText(int id) { return setParseLoginButtonText(maybeGetString(id)); }
/** * Customize the text for the link to resetting the user's forgotten password. * * @param id * The resource ID for the text to display on the link. * @return The caller instance to allow chaining. */ public ParseLoginBuilder setParseLoginHelpText(int id) { return setParseLoginHelpText(maybeGetString(id)); }
/** * Customize the text on the Parse signup button. * * @param id * The resource ID for the text to display on the button. * @return The caller instance to allow chaining. */ public ParseLoginBuilder setParseSignupButtonText(int id) { return setParseSignupButtonText(maybeGetString(id)); }
@Override public void onClick(View v) { if (currentUser != null) { // User clicked to log out. ParseUser.logOut(); currentUser = null; showProfileLoggedOut(); } else { // User clicked to log in. // This example customizes ParseLoginActivity in code. ParseLoginBuilder builder = new ParseLoginBuilder( SampleProfileActivity.this); Intent parseLoginIntent = builder.setParseLoginEnabled(true) .setParseLoginButtonText("Go") .setParseSignupButtonText("Register") .setParseLoginHelpText("Forgot password?") .setParseLoginInvalidCredentialsToastText("You email and/or password is not correct") .setParseLoginEmailAsUsername(true) .setParseSignupSubmitButtonText("Submit registration") .setFacebookLoginEnabled(true) .setFacebookLoginButtonText("Facebook") .setFacebookLoginPermissions(Arrays.asList("user_status", "read_stream")) .setTwitterLoginEnabled(true) .setTwitterLoginButtontext("Twitter") .build(); startActivityForResult(parseLoginIntent, LOGIN_REQUEST); } } });
/** * Customize the submit button on the Parse signup screen. This signup screen * is only shown if you enable Parse username/password login. * * @param id * The resource ID fo the text to display on the user signup * submission button. * @return The caller instance to allow chaining. */ public ParseLoginBuilder setParseSignupSubmitButtonText(int id) { return setParseSignupSubmitButtonText(maybeGetString(id)); }
/** * Customize the toast shown when the user enters an invalid username/password * pair. * * @param id * The resource ID for the text to display on the toast. * @return The caller instance to allow chaining. */ public ParseLoginBuilder setParseLoginInvalidCredentialsToastText(int id) { return setParseLoginInvalidCredentialsToastText(maybeGetString(id)); }
@Override public void onClick(View v) { if (currentUser != null) { // User clicked to log out. ParseUser.logOut(); currentUser = null; showProfileLoggedOut(); } else { // User clicked to log in. ParseLoginBuilder loginBuilder = new ParseLoginBuilder( SampleProfileActivity.this); startActivityForResult(loginBuilder.build(), LOGIN_REQUEST); } } });
@Override public void onClick(View v) { if (currentUser != null) { // User clicked to log out. ParseUser.logOut(); currentUser = null; showProfileLoggedOut(); } else { // User clicked to log in. ParseLoginBuilder loginBuilder = new ParseLoginBuilder( SampleProfileActivity.this); startActivityForResult(loginBuilder.build(), LOGIN_REQUEST); } } });