Skip to content

Commit

Permalink
Merge pull request #12 from sayrobert/feature_popup-settings
Browse files Browse the repository at this point in the history
patient menu
  • Loading branch information
noelbilleau authored Jul 7, 2017
2 parents 4ce044c + 1ab9f55 commit da0ac77
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@

import android.app.Fragment;
import android.app.FragmentTransaction;
import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;

public class PatientFragment extends Fragment {
public static PatientFragment newInstance() {
Expand Down Expand Up @@ -38,7 +40,93 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
}



});

final ImageButton male = (ImageButton) view.findViewById(R.id.male);
final ImageButton female = (ImageButton) view.findViewById(R.id.female);
male.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
male.setBackgroundColor(Color.parseColor("#4CB8FB"));
female.setBackgroundColor(Color.parseColor("#FFFFFF"));
return true;
}
});
female.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
female.setBackgroundColor(Color.parseColor("#4CB8FB"));
male.setBackgroundColor(Color.parseColor("#FFFFFF"));
return true;
}
});

final ImageButton baby = (ImageButton) view.findViewById(R.id.baby);
final ImageButton child = (ImageButton) view.findViewById(R.id.child);
final ImageButton adult = (ImageButton) view.findViewById(R.id.adult);
baby.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
baby.setBackgroundColor(Color.parseColor("#4CB8FB"));
child.setBackgroundColor(Color.parseColor("#FFFFFF"));
adult.setBackgroundColor(Color.parseColor("#FFFFFF"));
return true;
}
});
child.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
baby.setBackgroundColor(Color.parseColor("#FFFFFF"));
child.setBackgroundColor(Color.parseColor("#4CB8FB"));
adult.setBackgroundColor(Color.parseColor("#FFFFFF"));
return true;
}
});
adult.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
baby.setBackgroundColor(Color.parseColor("#FFFFFF"));
child.setBackgroundColor(Color.parseColor("#FFFFFF"));
adult.setBackgroundColor(Color.parseColor("#4CB8FB"));
return true;
}
});


final ImageButton thin = (ImageButton) view.findViewById(R.id.thin);
final ImageButton normal = (ImageButton) view.findViewById(R.id.normal);
final ImageButton big = (ImageButton) view.findViewById(R.id.big);
thin.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
thin.setBackgroundColor(Color.parseColor("#4CB8FB"));
normal.setBackgroundColor(Color.parseColor("#FFFFFF"));
big.setBackgroundColor(Color.parseColor("#FFFFFF"));
return true;
}
});
normal.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
thin.setBackgroundColor(Color.parseColor("#FFFFFF"));
normal.setBackgroundColor(Color.parseColor("#4CB8FB"));
big.setBackgroundColor(Color.parseColor("#FFFFFF"));
return true;
}
});
big.setOnTouchListener(new View.OnTouchListener(){
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
thin.setBackgroundColor(Color.parseColor("#FFFFFF"));
normal.setBackgroundColor(Color.parseColor("#FFFFFF"));
big.setBackgroundColor(Color.parseColor("#4CB8FB"));
return true;
}
});


return view;

}
}
26 changes: 15 additions & 11 deletions android-app/app/src/main/res/layout/fragment_patient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textColor="@color/new_blue"
android:text="@string/infosPatient"
android:textSize="30sp"></TextView>

Expand All @@ -27,15 +28,16 @@
android:id="@+id/InfoSexe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/new_blue"
android:text="@string/sex"
android:layout_centerHorizontal="true"
android:textSize="36sp"
android:textSize="26sp"
android:gravity="center"
/>

<ImageButton
android:background="@color/new_white_button"
android:id="@+id/Sexebtn"
android:id="@+id/female"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
Expand All @@ -46,7 +48,7 @@
android:layout_alignParentStart="true" />
<ImageButton
android:background="@color/new_white_button"
android:id="@+id/Sexebtn1"
android:id="@+id/male"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
Expand Down Expand Up @@ -77,7 +79,8 @@
android:layout_height="wrap_content"
android:text="@string/age"
android:layout_centerHorizontal="true"
android:textSize="36sp"
android:textColor="@color/new_blue"
android:textSize="26sp"
android:gravity="center"

/>
Expand All @@ -87,7 +90,7 @@
android:layout_centerHorizontal="true">
<ImageButton
android:background="@color/new_white_button"
android:id="@+id/ageebtn"
android:id="@+id/child"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
Expand All @@ -98,7 +101,7 @@
android:layout_alignParentStart="true" />
<ImageButton
android:background="@color/new_white_button"
android:id="@+id/agebtn1"
android:id="@+id/baby"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
Expand All @@ -108,7 +111,7 @@
android:layout_alignParentStart="true" />
<ImageButton
android:background="@color/new_white_button"
android:id="@+id/agebtn2"
android:id="@+id/adult"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
Expand All @@ -131,7 +134,8 @@
android:layout_height="wrap_content"
android:text="@string/weight"
android:layout_centerHorizontal="true"
android:textSize="36sp"
android:textSize="26sp"
android:textColor="@color/new_blue"
android:gravity="center"

/>
Expand All @@ -141,7 +145,7 @@
android:layout_centerHorizontal="true">
<ImageButton
android:background="@color/new_white_button"
android:id="@+id/corpbtn"
android:id="@+id/thin"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
Expand All @@ -152,7 +156,7 @@
android:layout_alignParentStart="true" />
<ImageButton
android:background="@color/new_white_button"
android:id="@+id/corpbtn1"
android:id="@+id/normal"
android:layout_marginStart="160dp"

android:layout_width="70dp"
Expand All @@ -164,7 +168,7 @@
android:layout_alignParentStart="true" />
<ImageButton
android:background="@color/new_white_button"
android:id="@+id/corpbtn4"
android:id="@+id/big"
android:layout_width="70dp"
android:layout_height="70dp"
android:adjustViewBounds="true"
Expand Down

0 comments on commit da0ac77

Please sign in to comment.