Guest User

Untitled

a guest
May 22nd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  1. public class LoginFragment extends Fragment{
  2. View view;
  3.  
  4. @Nullable
  5. @Override
  6. public View onCreateView(@NonNull LayoutInflater inflater, @Nullable
  7. ViewGroup container, @Nullable Bundle savedInstanceState) {
  8. final Button b = null;
  9. b.findViewById(R.id.Loginbutton);
  10. final EditText e = getView().findViewById(R.id.user);
  11. EditText e1 = getView().findViewById(R.id.pass);
  12. b.setOnClickListener(new View.OnClickListener() {
  13. @Override
  14. public void onClick(View v) {
  15. Intent l = new Intent(getActivity(), AfterLogin.class);
  16. startActivity(l);
  17. }
  18. });
  19. view = inflater.inflate(R.layout.fragment_login,container,false);
  20.  
  21. return view;
  22. }
  23.  
  24. public LoginFragment() {}
  25. }
  26.  
  27. <?xml version="1.0" encoding="utf-8"?>
  28. <android.widget.RelativeLayout
  29. xmlns:android="http://schemas.android.com/apk/res/android"
  30. xmlns:app="http://schemas.android.com/apk/res-auto"
  31. android:layout_width="match_parent"
  32. android:layout_height="match_parent"
  33. android:background="@color/DefaultWhite">
  34.  
  35. <TextView
  36. android:layout_width="wrap_content"
  37. android:layout_height="wrap_content"
  38. android:layout_alignParentTop="true"
  39. android:layout_centerHorizontal="true"
  40. android:layout_marginTop="125dp"
  41. android:text="@string/app_name"
  42. android:textColor="@color/colorPrimaryDark"
  43. android:textSize="30sp" />
  44. <ImageView
  45. android:contentDescription="@string/LoginText"
  46. android:id="@+id/imageView4"
  47. android:layout_width="48dp"
  48. android:layout_height="57dp"
  49. android:layout_alignParentTop="true"
  50. android:layout_centerHorizontal="true"
  51. android:layout_marginTop="78dp"
  52. app:srcCompat="@drawable/accountbox" />
  53.  
  54. <EditText
  55. android:id="@+id/user"
  56. android:inputType="text"
  57. android:layout_width="match_parent"
  58. android:layout_height="50dp"
  59. android:hint="@string/LoginText"
  60. android:gravity="center"
  61. android:layout_marginLeft="20dp"
  62. android:layout_marginTop="300dp"
  63. android:layout_marginRight="20dp"
  64. android:background="@drawable/loginpageloginedittext"
  65. />
  66. <EditText
  67. android:id="@+id/pass"
  68. android:layout_width="match_parent"
  69. android:layout_height="50dp"
  70. android:hint="@string/PasswordText"
  71. android:gravity="center"
  72. android:layout_marginEnd="20dp"
  73. android:layout_marginTop="360sp"
  74. android:background="@drawable/loginpageedittextpassword"
  75. android:layout_marginStart="20dp"
  76. android:inputType="textPassword"
  77. />
  78.  
  79. <Button
  80. android:id="@+id/LoginButton"
  81. android:layout_width="175dp"
  82. android:layout_height="wrap_content"
  83. android:layout_alignParentTop="true"
  84. android:layout_marginTop="450dp"
  85. android:background="@drawable/loginbutton"
  86. android:layout_marginStart="20dp"
  87. android:textColor="@color/DefaultWhite"
  88. android:layout_marginEnd="20dp"
  89. android:text="@string/LoginButton" />
  90.  
  91. <Button
  92. android:id="@+id/registerbutton"
  93. android:layout_width="175dp"
  94. android:layout_height="wrap_content"
  95. android:background="@drawable/forgotpasswordbutton"
  96. android:layout_marginTop="450dp"
  97. android:layout_marginStart="215dp"
  98. android:layout_marginBottom="10dp"
  99. android:text="@string/ForgotPassword" />
  100.  
  101.  
  102.  
  103. <TextView
  104. android:layout_width="wrap_content"
  105. android:layout_height="wrap_content"
  106. android:layout_marginTop="600dp"
  107. android:layout_marginStart="160dp"
  108. android:hint="@string/KnowUsMore" />
  109. </android.widget.RelativeLayout>
  110.  
  111. public class LoginFragment extends Fragment{
  112. View view;
  113.  
  114. @Nullable
  115. @Override
  116. public View onCreateView(@NonNull LayoutInflater inflater, @Nullable
  117. ViewGroup container, @Nullable Bundle savedInstanceState) {
  118.  
  119. view = inflater.inflate(R.layout.fragment_login,container,false);
  120.  
  121. Button b = view.findViewById(R.id.Loginbutton);
  122. EditText e = view.findViewById(R.id.user);
  123. EditText e1 = view.findViewById(R.id.pass);
  124.  
  125. b.setOnClickListener(new View.OnClickListener() {
  126. @Override
  127. public void onClick(View v) {
  128. Intent l = new Intent(getActivity(), AfterLogin.class);
  129. startActivity(l);
  130. }
  131. });
  132. return view;
  133. }
  134.  
  135. public LoginFragment() {}
Add Comment
Please, Sign In to add comment