Skip to content
Snippets Groups Projects
Commit dc2475cd authored by Shubham Maheshwari's avatar Shubham Maheshwari
Browse files

Added the seperate sign up for student and faculty with tabs

parent 2968a234
No related branches found
No related tags found
No related merge requests found
......@@ -4,15 +4,14 @@
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".Dashboard"
android:label="DashBoard"
android:theme="@style/AppTheme.NoActionBar"></activity>
android:theme="@style/AppTheme.NoActionBar" />
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
......@@ -20,7 +19,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SignUpActivity"></activity>
<activity android:name=".SignUpActivity"
android:theme="@style/AppTheme.NoActionBar"/>
</application>
</manifest>
\ No newline at end of file
package com.example.taskboxx;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class FacultySignUpFragment extends Fragment {
public FacultySignUpFragment(){}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_faculty_sign_up, container, false);
}
}
package com.example.taskboxx;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Toast;
public class SignUpActivity extends AppCompatActivity {
Toolbar toolbar;
TabLayout tabLayout;
ViewPager viewPager;
viewpageradapter viewPagerAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up);
toolbar = (Toolbar) findViewById(R.id.toolBar);
setSupportActionBar(toolbar);
tabLayout = (TabLayout) findViewById(R.id.tabLayout);
viewPager = (ViewPager) findViewById(R.id.viewPager);
viewPagerAdapter = new viewpageradapter(getSupportFragmentManager());
viewPagerAdapter.addFragments(new StudentSignUpFragment(),"Student");
viewPagerAdapter.addFragments(new FacultySignUpFragment(),"Faculty");
viewPager.setAdapter(viewPagerAdapter);
tabLayout.setupWithViewPager(viewPager);
}
public void StudentSignUp(View view){
Toast.makeText(this, "Registered as a Student!", Toast.LENGTH_SHORT).show();
Toast.makeText(this, "Please Log In to Proceed", Toast.LENGTH_SHORT).show();
Intent loginintent = new Intent(this,LoginActivity.class);
startActivity(loginintent);
}
public void SignUp(View view){
Toast.makeText(this, "Registered!", Toast.LENGTH_SHORT).show();
public void FacultySignUp(View view){
Toast.makeText(this, "Registered as a Faculty!", Toast.LENGTH_SHORT).show();
Toast.makeText(this, "Please Log In to Proceed", Toast.LENGTH_SHORT).show();
Intent loginintent = new Intent(this,LoginActivity.class);
startActivity(loginintent);
......
package com.example.taskboxx;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class StudentSignUpFragment extends Fragment {
public StudentSignUpFragment(){}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_student_sign_up, container, false);
}
}
package com.example.taskboxx;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import java.util.ArrayList;
/**
* Created by Shubham Maheshwari on 13-04-2017.
*/
public class viewpageradapter extends FragmentStatePagerAdapter {
ArrayList<Fragment> fragments = new ArrayList<>();
ArrayList<String>tabTitles = new ArrayList<>();
public void addFragments(Fragment fragments, String tabTitles){
this.fragments.add(fragments);
this.tabTitles.add(tabTitles);
}
public viewpageradapter(FragmentManager fragmentManager){
super(fragmentManager);
}
@Override
public Fragment getItem(int position) {
return fragments.get(position);
}
@Override
public int getCount() {
return fragments.size();
}
@Override
public CharSequence getPageTitle(int position){
return tabTitles.get(position);
}
}
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<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="wrap_content"
android:layout_height="match_parent"
tools:context="com.example.taskboxx.SignUpActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/Explanation"
android:textColor="#AA000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="25dp"
android:text="Enter the following details to Sign up for TaskBoxx, your personal project and task manager!" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/SignUpName_textLayout"
android:layout_below="@+id/Explanation"
android:layout_marginTop="20dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Name_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Name" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="250dp"
android:layout_height="wrap_content"
android:id="@+id/SignUpRollNo_textLayout"
android:layout_below="@+id/SignUpName_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_RollNo_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Roll No." />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="200dp"
android:layout_height="wrap_content"
android:id="@+id/SignUpDept_textLayout"
android:layout_below="@+id/SignUpRollNo_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Dept_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Department" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="170dp"
android:layout_height="wrap_content"
android:id="@+id/SignUpCGPA_textLayout"
android:layout_below="@+id/SignUpRollNo_textLayout"
android:layout_toRightOf="@+id/SignUpDept_textLayout"
android:layout_toEndOf="@+id/SignUpDept_textLayout">
<EditText android:id="@+id/input_CGPA_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="10dp"
android:inputType="text"
android:hint="CGPA" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/SignUpSem_textLayout"
android:layout_below="@+id/SignUpName_textLayout"
android:layout_toEndOf="@+id/SignUpRollNo_textLayout"
android:layout_toRightOf="@+id/SignUpRollNo_textLayout">
<EditText android:id="@+id/input_Sem_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="10dp"
android:inputType="number"
android:hint="Sem" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/SignUpAOI_textLayout"
android:layout_below="@+id/SignUpDept_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_AOI_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Areas of Interest" />
</android.support.design.widget.TextInputLayout>
android:id="@+id/appBar"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
<include
android:layout_height="wrap_content"
android:id="@+id/SignUpemail_textLayout"
android:layout_below="@+id/SignUpAOI_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_email_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="textEmailAddress"
android:hint="Contact Email Address" />
</android.support.design.widget.TextInputLayout>
layout="@layout/toolbar_layout" />
<android.support.design.widget.TextInputLayout
<android.support.design.widget.TabLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/SignUpContact_textLayout"
android:layout_below="@+id/SignUpemail_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Contact_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="number"
android:hint="Contact No." />
</android.support.design.widget.TextInputLayout>
android:id="@+id/tabLayout"
app:tabMode="fixed"
app:tabGravity="fill">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@+id/SignUpContact_textLayout"
android:paddingLeft="125dp"
android:paddingRight="125dp"
android:layout_marginTop="20dp">
<Button
android:id="@+id/SignUp"
style="@style/Widget.AppCompat.Button.Borderless"
</android.support.design.widget.TabLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:onClick="SignUp"
android:text="Sign Up" />
</LinearLayout>
android:layout_height="match_parent"
android:layout_below="@+id/appBar"
android:id="@+id/viewPager">
</android.support.v4.view.ViewPager>
</RelativeLayout>
</ScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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.example.taskboxx.FacultySignUpFragment">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/Explanation"
android:textColor="#AA000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="25dp"
android:text="Enter the following details to Sign up for TaskBoxx, your personal project and task manager!" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/FacultySignUpName_textLayout"
android:layout_below="@+id/Explanation"
android:layout_marginTop="20dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Faculty_Name_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Name" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="250dp"
android:layout_height="wrap_content"
android:id="@+id/FacultySignUpRollNo_textLayout"
android:layout_below="@+id/FacultySignUpName_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Faculty_RollNo_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Faculty Roll No." />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="200dp"
android:layout_height="wrap_content"
android:id="@+id/FacultySignUpDept_textLayout"
android:layout_below="@+id/FacultySignUpName_textLayout"
android:layout_toRightOf="@+id/FacultySignUpRollNo_textLayout"
android:layout_toEndOf="@+id/FacultySignUpRollNo_textLayout">
<EditText android:id="@+id/input_Faculty_Dept_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:inputType="text"
android:hint="Dept." />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/FacultySignUpWA_textLayout"
android:layout_below="@+id/FacultySignUpRollNo_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Faculty_WA_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Working Areas" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/FacultySignUpemail_textLayout"
android:layout_below="@+id/FacultySignUpWA_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Faculty_email_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Email ID" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/FacultySignUpContact_textLayout"
android:layout_below="@+id/FacultySignUpemail_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Faculty_Contact_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Contact no." />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@+id/FacultySignUpContact_textLayout"
android:paddingLeft="125dp"
android:paddingRight="125dp"
android:layout_marginTop="20dp">
<Button
android:id="@+id/SignUp"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:onClick="FacultySignUp"
android:text="Sign Up" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="wrap_content"
tools:context="com.example.taskboxx.StudentSignUpFragment">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/Explanation"
android:textColor="#AA000000"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="25dp"
android:layout_marginRight="25dp"
android:layout_marginTop="25dp"
android:text="Enter the following details to Sign up for TaskBoxx, your personal project and task manager!" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpName_textLayout"
android:layout_below="@+id/Explanation"
android:layout_marginTop="20dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Student_Name_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Name" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="250dp"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpRollNo_textLayout"
android:layout_below="@+id/StudentSignUpName_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Student_RollNo_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Roll No." />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="200dp"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpDept_textLayout"
android:layout_below="@+id/StudentSignUpRollNo_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Student_Dept_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Department" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="170dp"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpCGPA_textLayout"
android:layout_below="@+id/StudentSignUpRollNo_textLayout"
android:layout_toRightOf="@+id/StudentSignUpDept_textLayout"
android:layout_toEndOf="@+id/StudentSignUpDept_textLayout">
<EditText android:id="@+id/input_Student_CGPA_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="10dp"
android:inputType="text"
android:hint="CGPA" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpSem_textLayout"
android:layout_below="@+id/StudentSignUpName_textLayout"
android:layout_toEndOf="@+id/StudentSignUpRollNo_textLayout"
android:layout_toRightOf="@+id/StudentSignUpRollNo_textLayout">
<EditText android:id="@+id/input_Student_Sem_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="10dp"
android:inputType="number"
android:hint="Sem" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpAOI_textLayout"
android:layout_below="@+id/StudentSignUpDept_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Student_AOI_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="text"
android:hint="Areas of Interest" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpemail_textLayout"
android:layout_below="@+id/StudentSignUpAOI_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Student_email_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="textEmailAddress"
android:hint="Contact Email Address" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/StudentSignUpContact_textLayout"
android:layout_below="@+id/StudentSignUpemail_textLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<EditText android:id="@+id/input_Student_Contact_SignUp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="30dp"
android:layout_marginLeft="30dp"
android:inputType="number"
android:hint="Contact No." />
</android.support.design.widget.TextInputLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@+id/StudentSignUpContact_textLayout"
android:paddingLeft="125dp"
android:paddingRight="125dp"
android:layout_marginTop="20dp">
<Button
android:id="@+id/SignUp"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#EEEEEE"
android:onClick="StudentSignUp"
android:text="Sign Up" />
</LinearLayout>
</RelativeLayout>
</ScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:fitsSystemWindows="true"
android:id="@+id/toolBar"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
android:elevation="0dp">
</android.support.v7.widget.Toolbar>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment