Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////////////////////////////////////////////
- **JAVA CLASSES**
- ------------------------------------------------------------
- **DBHelper**
- import android.content.ContentValues;
- import android.content.Context;
- import android.database.Cursor;
- import android.database.sqlite.SQLiteDatabase;
- import android.database.sqlite.SQLiteOpenHelper;
- import android.util.Log;
- import java.util.ArrayList;
- /**
- * Created by Suraj on 10/6/2018.
- */
- public class DBHandler extends SQLiteOpenHelper {
- public DBHandler(Context context) {
- super(context, "user_db", null, 1);
- }
- @Override
- public void onCreate(SQLiteDatabase db) {
- String createQuery = "CREATE TABLE "+UserProfile.Users.TABLE_NAME +"( "+UserProfile.Users.COL_ID +" INTEGER PRIMARY KEY AUTOINCREMENT ,"+UserProfile.Users.COL_USERNAME+" TEXT UNIQUE," +
- UserProfile.Users.COL_PASSWORD +" TEXT, "+UserProfile.Users.COL_GENDER +" TEXT, "+UserProfile.Users.COL_DOB +" TEXT"+")";
- Log.d("createQuery",createQuery);
- try {
- db.execSQL(createQuery);
- }
- catch (Exception e){
- e.printStackTrace();
- Log.e("Exception",e.getMessage());
- }
- }
- @Override
- public void onUpgrade(SQLiteDatabase db, int i, int i1) {
- String createQuery = "CREATE TABLE "+UserProfile.Users.TABLE_NAME +"( "+UserProfile.Users.COL_ID +" INTEGER PRIMARY KEY AUTOINCREMENT ,"+UserProfile.Users.COL_USERNAME+" TEXT," +
- UserProfile.Users.COL_PASSWORD +" TEXT, "+UserProfile.Users.COL_GENDER +" TEXT, "+UserProfile.Users.COL_DOB+" TEXT"+")";
- Log.d("createQuery",createQuery);
- try {
- db.execSQL(createQuery);
- }
- catch (Exception e){
- e.printStackTrace();
- Log.e("Exception",e.getMessage());
- }
- }
- public boolean addInfo(UserProfile.Users users){
- SQLiteDatabase db = this.getWritableDatabase();
- String insertQuery = "INSERT INTO "+UserProfile.Users.TABLE_NAME+"("+UserProfile.Users.COL_USERNAME+","+UserProfile.Users.COL_PASSWORD+","+UserProfile.Users.COL_GENDER+","+
- UserProfile.Users.COL_DOB+") VALUES('"+users.getUsername()+"','"+users.getPassword()+"','"+users.getGender()+"','"+users.getDob()+"')";
- Log.d("insertQuery",insertQuery);
- try {
- db.execSQL(insertQuery);
- return true;
- }
- catch (Exception e){
- e.printStackTrace();
- Log.d("Exception",e.getMessage());
- }
- db.close();
- return false;
- }
- public boolean updateInfor(UserProfile.Users users){
- SQLiteDatabase db = this.getWritableDatabase();
- ContentValues values = new ContentValues();
- String username = users.getUsername();
- String password = users.getPassword();
- String dob = users.getDob();
- String gender = users.getGender();
- int id = users.getId();
- values.put(UserProfile.Users.COL_DOB,dob);
- values.put(UserProfile.Users.COL_GENDER,gender);
- values.put(UserProfile.Users.COL_PASSWORD,password);
- values.put(UserProfile.Users.COL_USERNAME,username);
- int result = db.update(UserProfile.Users.TABLE_NAME,values,UserProfile.Users.COL_ID+" = ?",new String[]{String.valueOf(id)});
- if(result >0)
- return true;
- return false;
- }
- public ArrayList<UserProfile.Users> readAllInfor(){
- ArrayList<UserProfile.Users> userList = new ArrayList<>();
- SQLiteDatabase db = this.getWritableDatabase();
- String readAllQuery = "SELECT * FROM "+UserProfile.Users.TABLE_NAME;
- Cursor cursor = db.rawQuery(readAllQuery,null);
- if(cursor.moveToFirst()){
- do{
- UserProfile.Users users = UserProfile.getProfile().getUser();
- users.setId(Integer.parseInt(cursor.getString(0)));
- users.setUsername(cursor.getString(1));
- users.setPassword(cursor.getString(2));
- users.setGender(cursor.getString(3));
- users.setDob(cursor.getString(4));
- userList.add(users);
- }while (cursor.moveToNext());
- }
- return userList;
- }
- public UserProfile.Users readAllInfor(String userName){
- SQLiteDatabase db = this.getWritableDatabase();
- String readSingleQuery = "SELECT * FROM "+ UserProfile.Users.TABLE_NAME+" WHERE "+ UserProfile.Users.COL_USERNAME + " = '"+ userName+"'";
- Cursor cursor = db.rawQuery(readSingleQuery,null);
- if(cursor.moveToFirst()){
- UserProfile.Users users = UserProfile.getProfile().getUser();
- users.setId(Integer.parseInt(cursor.getString(0)));
- users.setUsername(cursor.getString(1));
- users.setPassword(cursor.getString(2));
- users.setGender(cursor.getString(3));
- users.setDob(cursor.getString(4));
- return users;
- }
- return null;
- }
- public UserProfile.Users readAllInfor(int id){
- SQLiteDatabase db = this.getWritableDatabase();
- String readSingleQuery = "SELECT * FROM "+ UserProfile.Users.TABLE_NAME+" WHERE "+ UserProfile.Users.COL_ID + " = '"+ id+"'";
- Cursor cursor = db.rawQuery(readSingleQuery,null);
- if(cursor.moveToFirst()){
- UserProfile.Users users = UserProfile.getProfile().getUser();
- users.setId(Integer.parseInt(cursor.getString(0)));
- users.setUsername(cursor.getString(1));
- users.setPassword(cursor.getString(2));
- users.setGender(cursor.getString(3));
- users.setDob(cursor.getString(4));
- return users;
- }
- return null;
- }
- public void deleteInfo(String username){
- SQLiteDatabase db = this.getWritableDatabase();
- String deleteQuery = "DELETE FROM "+ UserProfile.Users.TABLE_NAME+" WHERE "+ UserProfile.Users.COL_USERNAME +" = '"+ username +"' ";
- Log.d("deleteQuery ",deleteQuery);
- db.execSQL(deleteQuery);
- db.close();
- }
- }
- ------------------------------------------------------------------------------------------------------
- **UserProfile**
- public final class UserProfile {
- private UserProfile(){
- }
- public static UserProfile getProfile(){
- UserProfile userProfile = new UserProfile();
- return userProfile;
- }
- class Users implements BaseColumn{
- public static final String TABLE_NAME = "UserInfo";
- public static final String COL_ID = "_ID";
- public static final String COL_USERNAME = "userName ";
- public static final String COL_DOB = "dateOfBirth";
- public static final String COL_GENDER = "Gender";
- public static final String COL_PASSWORD = "Password";
- //display karana ona variable tika
- private int id;
- private String username;
- private String dob;
- private String gender;
- private String password;
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getUsername() {
- return username;
- }
- public void setUsername(String username) {
- this.username = username;
- }
- public String getDob() {
- return dob;
- }
- public void setDob(String dob) {
- this.dob = dob;
- }
- public String getGender() {
- return gender;
- }
- public void setGender(String gender) {
- this.gender = gender;
- }
- public String getPassword() {
- return password;
- }
- public void setPassword(String password) {
- this.password = password;
- }
- }
- //hethuwa-wena thanaka class ekaka wena wenama varible cll krnnaq ona unoth
- public Users getUser(){
- Users users = new Users();
- return users;
- }
- }
- ----------------------------------------------------------------------------------------------------------------
- **EditProfile**
- import android.content.Intent;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.RadioButton;
- import android.widget.RadioGroup;
- import android.widget.Toast;
- public class EditProfile extends AppCompatActivity {
- Button searchBtn;
- EditText userName_editText;
- EditText password_editText;
- EditText dob_editText;
- RadioGroup genderRadioGroup;
- RadioButton genderRadioBtn;
- //new Edit
- RadioButton genderRadioBtnMale;
- RadioButton genderRadioBtnFemale;
- Button editBtn;
- Button deleteBtn;
- Intent intent;
- DBHandler dbHandler;
- public static final String USERID_EDITPROFILE = "userID";
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_edit_profile);
- searchBtn = (Button)findViewById(R.id.editprof_searchbtn);
- userName_editText = (EditText)findViewById(R.id.editprof_userName);
- password_editText = (EditText)findViewById(R.id.editprof_password);
- dob_editText = (EditText)findViewById(R.id.editprof_dob);
- genderRadioGroup = (RadioGroup)findViewById(R.id.editprof_radiogroup);
- editBtn = (Button)findViewById(R.id.editprof_editbtn);
- deleteBtn = (Button)findViewById(R.id.editprof_deletebtn);
- //new edit
- genderRadioBtnMale = (RadioButton) findViewById(R.id.editprof_male_radio);
- genderRadioBtnFemale = (RadioButton) findViewById(R.id.editprof_female_radio);
- intent = getIntent();
- dbHandler = new DBHandler(EditProfile.this);
- setUserDetails();
- deleteBtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- String username = userName_editText.getText().toString();
- if(username == null){
- Toast.makeText(EditProfile.this,"Please enter username to delete your profile",Toast.LENGTH_SHORT).show();
- }
- else{
- UserProfile.Users users = dbHandler.readAllInfor(username);
- if(users == null){
- Toast.makeText(EditProfile.this,"No profile found from this username, please enter valid username",Toast.LENGTH_SHORT).show();
- }
- else{
- dbHandler.deleteInfo(username);
- Intent redirectintent_home = new Intent(EditProfile.this,Home.class);
- startActivity(redirectintent_home);
- }
- }
- }
- });
- editBtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- String userID_String = intent.getStringExtra(Home.USERID);
- if(userID_String == null){
- Toast.makeText(EditProfile.this,"Error!!",Toast.LENGTH_SHORT).show();
- Intent redirectintent_home = new Intent(getApplicationContext(),Home.class);
- startActivity(redirectintent_home);
- }
- int userID = Integer.parseInt(userID_String);
- String username = userName_editText.getText().toString();
- String password = password_editText.getText().toString();
- String dob = dob_editText.getText().toString();
- int selectedGender = genderRadioGroup.getCheckedRadioButtonId();
- genderRadioBtn = (RadioButton)findViewById(selectedGender);
- String gender = genderRadioBtn.getText().toString();
- UserProfile.Users users = UserProfile.getProfile().getUser();
- users.setUsername(username);
- users.setPassword(password);
- users.setDob(dob);
- users.setGender(gender);
- users.setId(userID);
- dbHandler.updateInfor(users);
- Toast.makeText(EditProfile.this,"Updated Successfully",Toast.LENGTH_SHORT).show();
- Intent redirectintent_home = new Intent(getApplicationContext(),Home.class);
- startActivity(redirectintent_home);
- }
- });
- searchBtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- String username = userName_editText.getText().toString();
- if (username == null){
- Toast.makeText(EditProfile.this,"Please enter a username",Toast.LENGTH_SHORT).show();
- }
- else{
- UserProfile.Users users_search = dbHandler.readAllInfor(username);
- if(users_search == null){
- Toast.makeText(EditProfile.this,"Please enter a valid username",Toast.LENGTH_SHORT).show();
- }
- else{
- userName_editText.setText(users_search.getUsername());
- password_editText.setText(users_search.getPassword());
- dob_editText.setText(users_search.getDob());
- int id = users_search.getId();
- Intent redirectintent = new Intent(EditProfile.this,EditProfile.class);
- redirectintent.putExtra(USERID_EDITPROFILE,Integer.toString(id));
- startActivity(redirectintent);
- }
- }
- }
- });
- }
- public void setUserDetails(){
- String userID_String = intent.getStringExtra(Home.USERID);
- if(userID_String == null){
- Toast.makeText(EditProfile.this,"Error!!",Toast.LENGTH_SHORT).show();
- Intent redirectintent_home = new Intent(EditProfile.this,Home.class);
- startActivity(redirectintent_home);
- }
- int userID = Integer.parseInt(userID_String);
- UserProfile.Users users = dbHandler.readAllInfor(userID);
- userName_editText.setText(users.getUsername());
- password_editText.setText(users.getPassword());
- dob_editText.setText(users.getDob());
- //new edit
- String gender = users.getGender();
- if(gender.equals("Male")){
- genderRadioBtnMale.setChecked(true);
- genderRadioBtnFemale.setChecked(false);
- }
- else{
- genderRadioBtnMale.setChecked(false);
- genderRadioBtnFemale.setChecked(true);
- }
- }
- }
- ---------------------------------------------------------------------------------------------------------------
- **Home**
- import android.content.Intent;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.Toast;
- public class Home extends AppCompatActivity {
- EditText username_editText;
- EditText password_editText;
- Button loginbtn;
- Button registerbtn;
- public static final String USERID = "userID";
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_home);
- username_editText = (EditText)findViewById(R.id.home_userName);
- password_editText = (EditText)findViewById(R.id.home_password);
- loginbtn = (Button)findViewById(R.id.home_loginBtn);
- registerbtn = (Button)findViewById(R.id.home_registerBtn);
- final DBHandler dbHandler = new DBHandler(Home.this);
- registerbtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- Intent intent = new Intent(Home.this,ProfileManagement.class);
- startActivity(intent);
- }
- });
- loginbtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- String userName = username_editText.getText().toString();
- String password = password_editText.getText().toString();
- if(userName.equals("") || password.equals("")){
- Toast.makeText(Home.this,"Login Unsuccessful",Toast.LENGTH_SHORT).show();
- }
- else{
- UserProfile.Users users = dbHandler.readAllInfor(userName);
- if(users == null){
- Toast.makeText(Home.this,"Invalid username or password",Toast.LENGTH_SHORT).show();
- }
- else{
- int userID = users.getId();
- Intent editProfIntent = new Intent(Home.this,EditProfile.class);
- editProfIntent.putExtra(USERID,Integer.toString(userID));
- startActivity(editProfIntent);
- }
- }
- }
- });
- }
- }
- ----------------------------------------------------------------------------------------------------------------------
- **ProfileManagement**
- import android.content.Intent;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- import android.widget.Button;
- import android.widget.EditText;
- import android.widget.RadioButton;
- import android.widget.RadioGroup;
- import android.widget.Toast;
- public class ProfileManagement extends AppCompatActivity {
- EditText username_editText;
- EditText password_editText;
- EditText dob_editText;
- RadioGroup radioGroup;
- RadioButton gender_radioBtn;
- Button saveProfBtn;
- public final static String USERID_PROFILEMGMT = "userID";
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_profile_management);
- username_editText = (EditText)findViewById(R.id.profmgmt_userName);
- password_editText = (EditText)findViewById(R.id.profmgmt_password);
- dob_editText = (EditText)findViewById(R.id.profmgmt_dob);
- radioGroup = (RadioGroup)findViewById(R.id.profmgmt_radiogroup);
- saveProfBtn = (Button)findViewById(R.id.profmgmt_btn);
- final DBHandler dbHandler = new DBHandler(ProfileManagement.this);
- saveProfBtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- String username = username_editText.getText().toString();
- String password = password_editText.getText().toString();
- String dob = dob_editText.getText().toString();
- int selectedGender = radioGroup.getCheckedRadioButtonId();
- gender_radioBtn = (RadioButton)findViewById(selectedGender);
- String gender = gender_radioBtn.getText().toString();
- UserProfile.Users users = UserProfile.getProfile().getUser();
- users.setUsername(username);
- users.setPassword(password);
- users.setDob(dob);
- users.setGender(gender);
- boolean result = dbHandler.addInfo(users);
- if(result == true){
- Toast.makeText(ProfileManagement.this,"Successfully added",Toast.LENGTH_SHORT).show();
- UserProfile.Users newusers = dbHandler.readAllInfor(username);
- int userID = newusers.getId();
- Intent intent = new Intent(ProfileManagement.this,EditProfile.class);
- intent.putExtra(USERID_PROFILEMGMT,Integer.toString(userID));
- startActivity(intent);
- }
- }
- });
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- **XML**
- ------------------------------------------------------------------------
- **activity edit profile**
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.modelpaper.mad.it17121002.EditProfile">
- <TextView
- android:id="@+id/textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/textView"
- android:layout_alignStart="@+id/textView"
- android:layout_below="@+id/textView"
- android:layout_marginTop="45dp"
- android:text="Date Of Birth "
- android:textSize="24sp" />
- <TextView
- android:id="@+id/textView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_marginTop="72dp"
- android:layout_toLeftOf="@+id/profmgmt_btn"
- android:layout_toStartOf="@+id/profmgmt_btn"
- android:text="User Name"
- android:textSize="24sp" />
- <TextView
- android:id="@+id/textView3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/textView4"
- android:layout_alignStart="@+id/textView4"
- android:layout_below="@+id/textView4"
- android:layout_marginTop="41dp"
- android:text="Gender"
- android:textSize="24sp" />
- <TextView
- android:id="@+id/textView4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/textView2"
- android:layout_alignStart="@+id/textView2"
- android:layout_below="@+id/textView2"
- android:layout_marginTop="46dp"
- android:text="Password"
- android:textSize="24sp" />
- <Button
- android:id="@+id/editprof_editbtn"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_marginBottom="54dp"
- android:layout_marginLeft="39dp"
- android:layout_marginStart="39dp"
- android:text="Edit" />
- <EditText
- android:id="@+id/editprof_userName"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignTop="@+id/textView"
- android:layout_toEndOf="@+id/textView2"
- android:layout_toRightOf="@+id/textView2"
- android:ems="10"
- android:inputType="textPersonName" />
- <EditText
- android:id="@+id/editprof_dob"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/textView2"
- android:layout_toEndOf="@+id/textView2"
- android:layout_toRightOf="@+id/textView2"
- android:ems="10"
- android:inputType="textPersonName" />
- <EditText
- android:id="@+id/editprof_password"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/textView4"
- android:layout_alignLeft="@+id/editprof_dob"
- android:layout_alignStart="@+id/editprof_dob"
- android:ems="10"
- android:inputType="textPersonName" />
- <RadioGroup
- android:id="@+id/editprof_radiogroup"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/profmgmt_password"
- android:layout_alignStart="@+id/profmgmt_password"
- android:layout_alignTop="@+id/textView3"
- android:layout_marginLeft="150dp">
- <RadioButton
- android:id="@+id/editprof_male_radio"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="Male"
- android:textSize="24sp" />
- <RadioButton
- android:id="@+id/editprof_female_radio"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="100dp"
- android:layout_weight="1"
- android:text="Female"
- android:textSize="24sp" />
- </RadioGroup>
- <Button
- android:id="@+id/editprof_deletebtn"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/editprof_editbtn"
- android:layout_alignBottom="@+id/editprof_editbtn"
- android:layout_marginEnd="14dp"
- android:layout_marginRight="14dp"
- android:layout_toLeftOf="@+id/editprof_searchbtn"
- android:layout_toStartOf="@+id/editprof_searchbtn"
- android:text="Delete" />
- <Button
- android:id="@+id/editprof_searchbtn"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_above="@+id/editprof_userName"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_marginBottom="11dp"
- android:text="Search" />
- </RelativeLayout>
- -----------------------------------------------------------------------------------------------------
- **activity home profile**
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.modelpaper.mad.it17121002.Home">
- <TextView
- android:id="@+id/userName_text"
- android:layout_width="wrap_content"
- android:layout_height="40dp"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:layout_marginLeft="14dp"
- android:layout_marginStart="14dp"
- android:layout_marginTop="71dp"
- android:text="User Name"
- android:textSize="24sp" />
- <TextView
- android:id="@+id/userName_text2"
- android:layout_width="wrap_content"
- android:layout_height="40dp"
- android:layout_alignLeft="@+id/userName_text"
- android:layout_alignStart="@+id/userName_text"
- android:layout_below="@+id/userName_text"
- android:layout_marginTop="49dp"
- android:text="Password"
- android:textSize="24sp" />
- <EditText
- android:id="@+id/home_userName"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentEnd="true"
- android:layout_alignParentRight="true"
- android:layout_alignTop="@+id/userName_text"
- android:layout_marginEnd="17dp"
- android:layout_marginRight="17dp"
- android:ems="10"
- android:inputType="textPersonName" />
- <EditText
- android:id="@+id/home_password"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/userName_text2"
- android:layout_alignEnd="@+id/home_userName"
- android:layout_alignRight="@+id/home_userName"
- android:ems="10"
- android:inputType="textPersonName" />
- <Button
- android:id="@+id/home_loginBtn"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@+id/home_password"
- android:layout_marginTop="97dp"
- android:layout_toLeftOf="@+id/home_password"
- android:layout_toStartOf="@+id/home_password"
- android:text="Login" />
- <Button
- android:id="@+id/home_registerBtn"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBaseline="@+id/home_loginBtn"
- android:layout_alignBottom="@+id/home_loginBtn"
- android:layout_alignEnd="@+id/home_password"
- android:layout_alignRight="@+id/home_password"
- android:layout_marginEnd="39dp"
- android:layout_marginRight="39dp"
- android:text="Register" />
- </RelativeLayout>
- -----------------------------------------------------------------------------------------------
- **activiity_profile_management**
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="com.modelpaper.mad.it17121002.ProfileManagement">
- <TextView
- android:id="@+id/textView2"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/textView"
- android:layout_alignStart="@+id/textView"
- android:layout_below="@+id/textView"
- android:layout_marginTop="45dp"
- android:text="Date Of Birth "
- android:textSize="24sp" />
- <TextView
- android:id="@+id/textView"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_marginTop="72dp"
- android:layout_toLeftOf="@+id/profmgmt_btn"
- android:layout_toStartOf="@+id/profmgmt_btn"
- android:text="User Name"
- android:textSize="24sp" />
- <TextView
- android:id="@+id/textView3"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/textView4"
- android:layout_alignStart="@+id/textView4"
- android:layout_below="@+id/textView4"
- android:layout_marginTop="41dp"
- android:text="Gender"
- android:textSize="24sp" />
- <TextView
- android:id="@+id/textView4"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/textView2"
- android:layout_alignStart="@+id/textView2"
- android:layout_below="@+id/textView2"
- android:layout_marginTop="46dp"
- android:text="Password"
- android:textSize="24sp" />
- <Button
- android:id="@+id/profmgmt_btn"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
- android:layout_centerHorizontal="true"
- android:layout_marginBottom="56dp"
- android:text="Register" />
- <EditText
- android:id="@+id/profmgmt_userName"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignTop="@+id/textView"
- android:layout_toEndOf="@+id/textView2"
- android:layout_toRightOf="@+id/textView2"
- android:ems="10"
- android:inputType="textPersonName" />
- <EditText
- android:id="@+id/profmgmt_dob"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/textView2"
- android:layout_toEndOf="@+id/textView2"
- android:layout_toRightOf="@+id/textView2"
- android:ems="10"
- android:inputType="textPersonName" />
- <EditText
- android:id="@+id/profmgmt_password"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignBottom="@+id/textView4"
- android:layout_alignEnd="@+id/profmgmt_dob"
- android:layout_alignRight="@+id/profmgmt_dob"
- android:ems="10"
- android:inputType="textPersonName" />
- <RadioGroup
- android:id="@+id/profmgmt_radiogroup"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignLeft="@+id/profmgmt_password"
- android:layout_alignStart="@+id/profmgmt_password"
- android:layout_alignTop="@+id/textView3">
- <RadioButton
- android:id="@+id/profmgmt_male_radio"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:text="Male"
- android:textSize="24sp" />
- <RadioButton
- android:id="@+id/profmgmt_female_radio"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="100dp"
- android:layout_weight="1"
- android:text="Female"
- android:textSize="24sp" />
- </RadioGroup>
- </RelativeLayout>
- ------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement