Advertisement
Guest User

Untitled

a guest
Sep 16th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.40 KB | None | 0 0
  1. package fabiohcnobre.jhotelcolonialdosnobres;
  2.  
  3.  
  4. import java.util.ArrayList;
  5. import java.util.List;
  6.  
  7. import static android.Manifest.permission.READ_CONTACTS;
  8.  
  9. /**
  10. * A login screen that offers login via email/password.
  11. */
  12. public class LoginActivity extends AppCompatActivity implements LoaderCallbacks<Cursor>, GoogleApiClient.OnConnectionFailedListener {
  13.  
  14. /**
  15. * Id to identity READ_CONTACTS permission request.
  16. */
  17. private static final int REQUEST_READ_CONTACTS = 0;
  18.  
  19. private static final int RC_SIGN_IN = 9001;
  20.  
  21. /**
  22. * Keep track of the login task to ensure we can cancel it if requested.
  23. */
  24. // UI references.
  25. private AutoCompleteTextView mEmailView;
  26. private EditText mPasswordView;
  27. private View mProgressView;
  28. private View mLoginFormView;
  29.  
  30. private FirebaseAuth mAuth;
  31. private FirebaseAuth.AuthStateListener mAuthListener;
  32. private String TAG;
  33.  
  34. GoogleApiClient mGoogleApiClient;
  35.  
  36. CallbackManager mCallbackManager;
  37.  
  38. private GoogleApiClient client;
  39.  
  40.  
  41. @Override
  42. protected void onCreate(Bundle savedInstanceState) {
  43. super.onCreate(savedInstanceState);
  44. setContentView(R.layout.activity_login);
  45. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
  46. setSupportActionBar(toolbar);
  47. getSupportActionBar().setDisplayHomeAsUpEnabled(true);
  48.  
  49.  
  50. // Set up the login form.
  51. mEmailView = (AutoCompleteTextView) findViewById(R.id.email);
  52.  
  53. GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
  54. .requestIdToken(getString(R.string.default_web_client_id))
  55. .requestEmail()
  56. .build();
  57.  
  58. mGoogleApiClient = new GoogleApiClient.Builder(this)
  59. .enableAutoManage(this, this)
  60. .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
  61. .build();
  62.  
  63. SignInButton signInButton = (SignInButton) findViewById(R.id.sign_in_button);
  64. signInButton.setSize(SignInButton.SIZE_STANDARD);
  65. signInButton.setScopes(gso.getScopeArray());
  66.  
  67.  
  68. signInButton.setOnClickListener(new OnClickListener() {
  69. @Override
  70. public void onClick(View v) {
  71. switch (v.getId()) {
  72. case R.id.sign_in_button:
  73. showProgress(true);
  74. signIn();
  75. break;
  76. // ...
  77. }
  78. }
  79.  
  80. private void signIn() {
  81. Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient);
  82. startActivityForResult(signInIntent, RC_SIGN_IN);
  83.  
  84. }
  85.  
  86.  
  87. });
  88.  
  89. populateAutoComplete();
  90.  
  91. mAuth = FirebaseAuth.getInstance();
  92. mAuthListener = new FirebaseAuth.AuthStateListener() {
  93. @Override
  94. public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
  95. FirebaseUser user = firebaseAuth.getCurrentUser();
  96. if (user != null) {
  97. // User is signed in
  98. Log.d(TAG, "onAuthStateChanged:signed_in:" + user.getUid());
  99. } else {
  100. // User is signed out
  101. Log.d(TAG, "onAuthStateChanged:signed_out");
  102. }
  103. // ...
  104. }
  105. };
  106.  
  107.  
  108. FacebookSdk.sdkInitialize(getApplicationContext());
  109.  
  110. mCallbackManager = CallbackManager.Factory.create();
  111. LoginManager.getInstance().registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
  112. @Override
  113. public void onSuccess(LoginResult loginResult) {
  114. showProgress(true);
  115. Log.d(TAG, "facebook:onSuccess:" + loginResult);
  116. handleFacebookAccessToken(loginResult.getAccessToken());
  117. }
  118.  
  119. @Override
  120. public void onCancel() {
  121. Log.d(TAG, "facebook:onCancel");
  122. // ...
  123. }
  124.  
  125. @Override
  126. public void onError(FacebookException error) {
  127. Log.d(TAG, "facebook:onError", error);
  128. // ...
  129. }
  130. });
  131. LoginButton loginButton = (LoginButton) findViewById(R.id.button_facebook_login);
  132. loginButton.registerCallback(mCallbackManager, new FacebookCallback<LoginResult>() {
  133. @Override
  134. public void onSuccess(LoginResult loginResult) {
  135. showProgress(true);
  136. Log.d(TAG, "facebook:onSuccess:" + loginResult);
  137. handleFacebookAccessToken(loginResult.getAccessToken());
  138. }
  139.  
  140. @Override
  141. public void onCancel() {
  142. Log.d(TAG, "facebook:onCancel");
  143. // ...
  144. }
  145.  
  146. @Override
  147. public void onError(FacebookException error) {
  148. Log.d(TAG, "facebook:onError", error);
  149. // ...
  150. }
  151. });
  152.  
  153.  
  154.  
  155. mPasswordView = (EditText) findViewById(R.id.password);
  156. mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
  157. @Override
  158. public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
  159. if (id == R.id.login || id == EditorInfo.IME_NULL) {
  160. attemptLogin();
  161. return true;
  162. }
  163. return false;
  164. }
  165. });
  166.  
  167. Button mEmailSignInButton = (Button) findViewById(R.id.email_sign_in_button);
  168. mEmailSignInButton.setOnClickListener(new OnClickListener() {
  169. @Override
  170. public void onClick(View view) {
  171. attemptLogin();
  172. }
  173. });
  174.  
  175. mLoginFormView = findViewById(R.id.login_form);
  176. mProgressView = findViewById(R.id.login_progress);
  177. // ATTENTION: This was auto-generated to implement the App Indexing API.
  178. // See https://g.co/AppIndexing/AndroidStudio for more information.
  179. client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
  180. }
  181.  
  182. private void populateAutoComplete() {
  183. if (!mayRequestContacts()) {
  184. return;
  185. }
  186.  
  187. getLoaderManager().initLoader(0, null, this);
  188. }
  189.  
  190. private boolean mayRequestContacts() {
  191. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
  192. return true;
  193. }
  194. if (checkSelfPermission(READ_CONTACTS) == PackageManager.PERMISSION_GRANTED) {
  195. return true;
  196. }
  197. if (shouldShowRequestPermissionRationale(READ_CONTACTS)) {
  198. Snackbar.make(mEmailView, R.string.permission_rationale, Snackbar.LENGTH_INDEFINITE)
  199. .setAction(android.R.string.ok, new OnClickListener() {
  200. @Override
  201. @TargetApi(Build.VERSION_CODES.M)
  202. public void onClick(View v) {
  203. requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
  204. }
  205. });
  206. } else {
  207. requestPermissions(new String[]{READ_CONTACTS}, REQUEST_READ_CONTACTS);
  208. }
  209. return false;
  210. }
  211.  
  212. /**
  213. * Callback received when a permissions request has been completed.
  214. */
  215. @Override
  216. public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
  217. @NonNull int[] grantResults) {
  218. if (requestCode == REQUEST_READ_CONTACTS) {
  219. if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
  220. populateAutoComplete();
  221. }
  222. }
  223. }
  224.  
  225.  
  226. /**
  227. * Attempts to sign in or register the account specified by the login form.
  228. * If there are form errors (invalid email, missing fields, etc.), the
  229. * errors are presented and no actual login attempt is made.
  230. */
  231. private void attemptLogin() {
  232. // Reset errors.
  233. mEmailView.setError(null);
  234. mPasswordView.setError(null);
  235.  
  236. // Store values at the time of the login attempt.
  237. String email = mEmailView.getText().toString();
  238. String password = mPasswordView.getText().toString();
  239.  
  240. boolean cancel = false;
  241. View focusView = null;
  242.  
  243. // Check for a valid password, if the user entered one.
  244. if (!TextUtils.isEmpty(password) && !isPasswordValid(password)) {
  245. mPasswordView.setError(getString(R.string.error_invalid_password));
  246. focusView = mPasswordView;
  247. cancel = true;
  248. }
  249.  
  250. // Check for a valid email address.
  251. if (TextUtils.isEmpty(email)) {
  252. mEmailView.setError(getString(R.string.error_field_required));
  253. focusView = mEmailView;
  254. cancel = true;
  255. } else if (!isEmailValid(email)) {
  256. mEmailView.setError(getString(R.string.error_invalid_email));
  257. focusView = mEmailView;
  258. cancel = true;
  259. }
  260.  
  261. if (cancel) {
  262. // There was an error; don't attempt login and focus the first
  263. // form field with an error.
  264. focusView.requestFocus();
  265. } else {
  266. // Show a progress spinner, and kick off a background task to
  267. // perform the user login attempt.
  268. showProgress(true);
  269. mAuth.signInWithEmailAndPassword(email, password)
  270. .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
  271. @Override
  272. public void onComplete(@NonNull Task<AuthResult> task) {
  273. Log.d(TAG, "signInWithEmail:onComplete:" + task.isSuccessful());
  274.  
  275. // If sign in fails, display a message to the user. If sign in succeeds
  276. // the auth state listener will be notified and logic to handle the
  277. // signed in user can be handled in the listener.
  278. if (!task.isSuccessful()) {
  279. Log.w(TAG, "signInWithEmail", task.getException());
  280. Toast.makeText(LoginActivity.this, "Authentication failed.",
  281. Toast.LENGTH_SHORT).show();
  282. showProgress(false);
  283. } else {
  284. Intent it = new Intent(LoginActivity.this, searchActivity.class);
  285. startActivity(it);
  286. }
  287. }
  288. });
  289.  
  290. }
  291. }
  292.  
  293. private boolean isEmailValid(String email) {
  294. //TODO: Replace this with your own logic
  295. return email.contains("@");
  296. }
  297.  
  298. private boolean isPasswordValid(String password) {
  299. //TODO: Replace this with your own logic
  300. return password.length() > 4;
  301. }
  302.  
  303. /**
  304. * Shows the progress UI and hides the login form.
  305. */
  306. @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
  307. private void showProgress(final boolean show) {
  308. // On Honeycomb MR2 we have the ViewPropertyAnimator APIs, which allow
  309. // for very easy animations. If available, use these APIs to fade-in
  310. // the progress spinner.
  311. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
  312. int shortAnimTime = getResources().getInteger(android.R.integer.config_shortAnimTime);
  313.  
  314. mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
  315. mLoginFormView.animate().setDuration(shortAnimTime).alpha(
  316. show ? 0 : 1).setListener(new AnimatorListenerAdapter() {
  317. @Override
  318. public void onAnimationEnd(Animator animation) {
  319. mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
  320. }
  321. });
  322.  
  323. mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
  324. mProgressView.animate().setDuration(shortAnimTime).alpha(
  325. show ? 1 : 0).setListener(new AnimatorListenerAdapter() {
  326. @Override
  327. public void onAnimationEnd(Animator animation) {
  328. mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
  329. }
  330. });
  331. } else {
  332. // The ViewPropertyAnimator APIs are not available, so simply show
  333. // and hide the relevant UI components.
  334. mProgressView.setVisibility(show ? View.VISIBLE : View.GONE);
  335. mLoginFormView.setVisibility(show ? View.GONE : View.VISIBLE);
  336. }
  337. }
  338.  
  339. @Override
  340. public Loader<Cursor> onCreateLoader(int i, Bundle bundle) {
  341. return new CursorLoader(this,
  342. // Retrieve data rows for the device user's 'profile' contact.
  343. Uri.withAppendedPath(ContactsContract.Profile.CONTENT_URI,
  344. ContactsContract.Contacts.Data.CONTENT_DIRECTORY), ProfileQuery.PROJECTION,
  345.  
  346. // Select only email addresses.
  347. ContactsContract.Contacts.Data.MIMETYPE +
  348. " = ?", new String[]{ContactsContract.CommonDataKinds.Email
  349. .CONTENT_ITEM_TYPE},
  350.  
  351. // Show primary email addresses first. Note that there won't be
  352. // a primary email address if the user hasn't specified one.
  353. ContactsContract.Contacts.Data.IS_PRIMARY + " DESC");
  354. }
  355.  
  356. @Override
  357. public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
  358. List<String> emails = new ArrayList<>();
  359. cursor.moveToFirst();
  360. while (!cursor.isAfterLast()) {
  361. emails.add(cursor.getString(ProfileQuery.ADDRESS));
  362. cursor.moveToNext();
  363. }
  364.  
  365. addEmailsToAutoComplete(emails);
  366. }
  367.  
  368. @Override
  369. public void onLoaderReset(Loader<Cursor> cursorLoader) {
  370.  
  371. }
  372.  
  373. private void addEmailsToAutoComplete(List<String> emailAddressCollection) {
  374. //Create adapter to tell the AutoCompleteTextView what to show in its dropdown list.
  375. ArrayAdapter<String> adapter =
  376. new ArrayAdapter<>(LoginActivity.this,
  377. android.R.layout.simple_dropdown_item_1line, emailAddressCollection);
  378.  
  379. mEmailView.setAdapter(adapter);
  380. }
  381.  
  382. /**
  383. * ATTENTION: This was auto-generated to implement the App Indexing API.
  384. * See https://g.co/AppIndexing/AndroidStudio for more information.
  385. */
  386. public Action getIndexApiAction() {
  387. Thing object = new Thing.Builder()
  388. .setName("Login Page") // TODO: Define a title for the content shown.
  389. // TODO: Make sure this auto-generated URL is correct.
  390. .setUrl(Uri.parse("http://[ENTER-YOUR-URL-HERE]"))
  391. .build();
  392. return new Action.Builder(Action.TYPE_VIEW)
  393. .setObject(object)
  394. .setActionStatus(Action.STATUS_TYPE_COMPLETED)
  395. .build();
  396. }
  397.  
  398. @Override
  399. public void onConnectionFailed(@NonNull ConnectionResult connectionResult) {
  400.  
  401. }
  402.  
  403.  
  404. private interface ProfileQuery {
  405. String[] PROJECTION = {
  406. ContactsContract.CommonDataKinds.Email.ADDRESS,
  407. ContactsContract.CommonDataKinds.Email.IS_PRIMARY,
  408. };
  409.  
  410. int ADDRESS = 0;
  411. int IS_PRIMARY = 1;
  412. }
  413.  
  414. @Override
  415. public void onStart() {
  416. super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
  417. // See https://g.co/AppIndexing/AndroidStudio for more information.
  418. client.connect();
  419. mAuth.addAuthStateListener(mAuthListener);
  420. // ATTENTION: This was auto-generated to implement the App Indexing API.
  421. // See https://g.co/AppIndexing/AndroidStudio for more information.
  422. AppIndex.AppIndexApi.start(client, getIndexApiAction());
  423. //Login automatico com facebook
  424. // LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("public_profile"));
  425. }
  426.  
  427. @Override
  428. public void onStop() {
  429. super.onStop();// ATTENTION: This was auto-generated to implement the App Indexing API.
  430. // See https://g.co/AppIndexing/AndroidStudio for more information.
  431. AppIndex.AppIndexApi.end(client, getIndexApiAction());
  432. if (mAuthListener != null) {
  433. mAuth.removeAuthStateListener(mAuthListener);
  434. }
  435. // ATTENTION: This was auto-generated to implement the App Indexing API.
  436. // See https://g.co/AppIndexing/AndroidStudio for more information.
  437. LoginManager.getInstance().logOut();
  438. client.disconnect();
  439. }
  440.  
  441.  
  442. @Override
  443. public void onActivityResult(final int requestCode, final int resultCode, final Intent data) {
  444. super.onActivityResult(requestCode, resultCode, data);
  445. // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
  446. if (requestCode == RC_SIGN_IN) {
  447. GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
  448. if (result.isSuccess()) {
  449. // Google Sign In was successful, authenticate with Firebase
  450. GoogleSignInAccount account = result.getSignInAccount();
  451. firebaseAuthWithGoogle(account);
  452. } else {
  453. Toast.makeText(LoginActivity.this, "Falha Google",
  454. Toast.LENGTH_SHORT).show();
  455. }
  456. }else {
  457. mCallbackManager.onActivityResult(requestCode, resultCode, data);
  458.  
  459. }
  460. }
  461.  
  462. private void firebaseAuthWithGoogle(GoogleSignInAccount acct) {
  463. Log.d(TAG, "firebaseAuthWithGoogle:" + acct.getId());
  464.  
  465. AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null);
  466. mAuth.signInWithCredential(credential)
  467. .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
  468. @Override
  469. public void onComplete(@NonNull Task<AuthResult> task) {
  470. Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());
  471.  
  472. // If sign in fails, display a message to the user. If sign in succeeds
  473. // the auth state listener will be notified and logic to handle the
  474. // signed in user can be handled in the listener.
  475. if (!task.isSuccessful()) {
  476. Log.w(TAG, "signInWithCredential", task.getException());
  477. Toast.makeText(LoginActivity.this, "Falha FireBase",
  478. Toast.LENGTH_SHORT).show();
  479. } else {
  480. Intent it = new Intent(LoginActivity.this, searchActivity.class);
  481. startActivity(it);
  482. }
  483.  
  484. }
  485. });
  486. }
  487.  
  488. private void handleFacebookAccessToken(AccessToken token) {
  489. Log.d(TAG, "handleFacebookAccessToken:" + token);
  490.  
  491. AuthCredential credential = FacebookAuthProvider.getCredential(token.getToken());
  492. mAuth.signInWithCredential(credential)
  493. .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
  494. @Override
  495. public void onComplete(@NonNull Task<AuthResult> task) {
  496. Log.d(TAG, "signInWithCredential:onComplete:" + task.isSuccessful());
  497.  
  498. if (!task.isSuccessful()) {
  499. Log.w(TAG, "signInWithCredential", task.getException());
  500. Toast.makeText(LoginActivity.this, "Authentication failed.",
  501. Toast.LENGTH_SHORT).show();
  502. }else {
  503. Intent it = new Intent(LoginActivity.this, searchActivity.class);
  504. startActivity(it);
  505. }
  506.  
  507. // ...
  508. }
  509. });
  510. }
  511.  
  512. }
  513.  
  514. <?xml version="1.0" encoding="utf-8"?><android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
  515. xmlns:app="http://schemas.android.com/apk/res-auto"
  516. xmlns:tools="http://schemas.android.com/tools"
  517. android:layout_width="match_parent"
  518. android:layout_height="match_parent"
  519. android:fitsSystemWindows="true"
  520. tools:context="fabiohcnobre.jhotelcolonialdosnobres.LoginActivity">
  521.  
  522. <android.support.design.widget.AppBarLayout
  523. android:layout_width="match_parent"
  524. android:layout_height="wrap_content"
  525. android:theme="@style/AppTheme.AppBarOverlay">
  526.  
  527. <android.support.v7.widget.Toolbar
  528. android:id="@+id/toolbar"
  529. android:layout_width="match_parent"
  530. android:layout_height="?attr/actionBarSize"
  531. android:background="?attr/colorPrimary"
  532. app:popupTheme="@style/AppTheme.PopupOverlay" />
  533.  
  534. </android.support.design.widget.AppBarLayout>
  535.  
  536.  
  537. <RelativeLayout
  538. android:layout_width="match_parent"
  539. android:layout_height="461dp"
  540. android:paddingBottom="@dimen/activity_vertical_margin"
  541. android:paddingLeft="@dimen/activity_horizontal_margin"
  542. android:paddingRight="@dimen/activity_horizontal_margin"
  543. android:paddingTop="@dimen/activity_vertical_margin"
  544. app:layout_behavior="@string/appbar_scrolling_view_behavior" >
  545.  
  546. <LinearLayout
  547. android:orientation="vertical"
  548. android:layout_width="match_parent"
  549. android:layout_height="match_parent"
  550. android:layout_alignParentTop="true"
  551. android:layout_alignParentStart="true">
  552.  
  553. <!-- Login progress -->
  554. <ProgressBar
  555. android:id="@+id/login_progress"
  556. style="?android:attr/progressBarStyleLarge"
  557. android:layout_width="wrap_content"
  558. android:layout_height="wrap_content"
  559. android:layout_marginBottom="8dp"
  560. android:visibility="gone"
  561. android:layout_gravity="center_horizontal"/>
  562.  
  563. <TextView
  564. android:text="TextView"
  565. android:layout_width="match_parent"
  566. android:layout_height="wrap_content"
  567. android:id="@+id/textView2" />
  568.  
  569. <ScrollView
  570. android:id="@+id/login_form"
  571. android:layout_width="match_parent"
  572. android:layout_height="wrap_content">
  573.  
  574. <LinearLayout
  575. android:id="@+id/email_login_form"
  576. android:layout_width="match_parent"
  577. android:layout_height="wrap_content"
  578. android:orientation="vertical">
  579.  
  580. <android.support.design.widget.TextInputLayout
  581. android:layout_width="match_parent"
  582. android:layout_height="wrap_content">
  583.  
  584. <AutoCompleteTextView
  585. android:id="@+id/email"
  586. android:layout_width="match_parent"
  587. android:layout_height="wrap_content"
  588. android:hint="@string/prompt_email"
  589. android:inputType="textEmailAddress"
  590. android:maxLines="1"
  591. android:singleLine="true" />
  592.  
  593. </android.support.design.widget.TextInputLayout>
  594.  
  595. <android.support.design.widget.TextInputLayout
  596. android:layout_width="match_parent"
  597. android:layout_height="wrap_content">
  598.  
  599. <EditText
  600. android:id="@+id/password"
  601. android:layout_width="match_parent"
  602. android:layout_height="wrap_content"
  603. android:hint="@string/prompt_password"
  604. android:imeActionId="@+id/login"
  605. android:imeActionLabel="@string/action_sign_in_short"
  606. android:imeOptions="actionUnspecified"
  607. android:inputType="textPassword"
  608. android:maxLines="1"
  609. android:singleLine="true" />
  610.  
  611. </android.support.design.widget.TextInputLayout>
  612.  
  613. <Button
  614. android:id="@+id/email_sign_in_button"
  615. style="?android:textAppearanceSmall"
  616. android:layout_width="match_parent"
  617. android:layout_height="wrap_content"
  618. android:layout_marginTop="16dp"
  619. android:text="@string/action_sign_in"
  620. android:textStyle="bold" />
  621.  
  622.  
  623. </LinearLayout>
  624. </ScrollView>
  625.  
  626. <com.facebook.login.widget.LoginButton
  627. android:id="@+id/button_facebook_login"
  628. android:layout_width="match_parent"
  629. android:layout_height="wrap_content" />
  630.  
  631. <com.google.android.gms.common.SignInButton
  632. android:id="@+id/sign_in_button"
  633. android:layout_width="match_parent"
  634. android:layout_height="wrap_content" />
  635.  
  636. </LinearLayout>
  637.  
  638. </RelativeLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement