Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy #1

Open
wants to merge 4 commits into
base: deploy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".SignUpActivity"></activity>
<activity android:name=".SignInActivity">
<activity android:name=".SelectionActivity">
edrisaturay marked this conversation as resolved.
Show resolved Hide resolved
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SignUpActivity" />
<activity android:name=".SignInActivity">

</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.andela.app.animationchallenge;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class SelectionActivity extends AppCompatActivity implements View.OnClickListener {

private Button mDoctor, mPatient;
private int DOCTOR_SIGN_IN_CODE = 0001;
private int PATIENT_SIGN_IN_CODE = 0002;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_selection);
initComponents();

}

private void initComponents(){
mDoctor = findViewById(R.id.btn_doctor);
mPatient = findViewById(R.id.btn_patient);
mDoctor.setOnClickListener(this);
mPatient.setOnClickListener(this);
}

@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.btn_doctor: handleButtonClick(DOCTOR_SIGN_IN_CODE);
break;
case R.id.btn_patient: handleButtonClick(PATIENT_SIGN_IN_CODE);
}
}

private void handleButtonClick(int signInCode){
Intent intent = new Intent(SelectionActivity.this, SignInActivity.class);
intent.putExtra("SIGN_IN_CODE", signInCode);
startActivity(intent);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ public class SignInActivity extends AppCompatActivity implements View.OnClickLis
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_in);
initComp();
initComponents();
}

private void initComp(){
private void handleIntents(){

}
private void initComponents(){
mUsername = findViewById(R.id.et_username);
mPassword = findViewById(R.id.et_password);
mSignin = findViewById(R.id.btn_signin);
Expand All @@ -45,4 +48,6 @@ private void mSigninButtonClicked(){
private void mSignupButtonClicked(){

}


}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ public class SignUpActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_up);

}
}
52 changes: 52 additions & 0 deletions app/src/main/res/layout/activity_selection.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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"
android:padding="16dp"
tools:context=".SelectionActivity">

<ImageView
android:id="@+id/iv_logo"
android:src="@drawable/ic_launcher_foreground"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:id="@+id/tv_instruction_text"
android:text="Who are you please?"
android:textAlignment="center"
android:layout_above="@id/ll_selection_area"
android:layout_marginBottom="16dp"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

<LinearLayout
android:id="@+id/ll_selection_area"
android:layout_marginBottom="16dp"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:weightSum="2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >

<Button
android:id="@+id/btn_doctor"
android:layout_weight="1"
android:text="I'm a Doctor"
android:textAllCaps="false"
android:layout_width="0dp"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/btn_patient"
android:layout_weight="1"
android:text="I'm a Patiennt"
android:textAllCaps="false"
android:layout_width="0dp"
android:layout_height="wrap_content"/>

</LinearLayout>

</RelativeLayout>