Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
class EmployeeListAdapter extends RecyclerView.Adapter{

private List<EmployeeDescription> mData = Arrays.asList(
new EmployeeDescription("Ashique", R.drawable.ashique)
new EmployeeDescription("Ashique", R.drawable.ashique),
new EmployeeDescription("Eddie", R.drawable.e_melendez)
);

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import nyc.c4q.grocerystore.R;
import nyc.c4q.grocerystore.employeeHandbook.employees.Ashique;
import nyc.c4q.grocerystore.employeeHandbook.employees.Eddie;

public class EmployeeView extends AppCompatActivity {
public static final String EMPLOYEE_NAME = "extra.employee.name";
Expand All @@ -18,7 +19,13 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.employee_view);
String employee = getIntent().getStringExtra(EMPLOYEE_NAME);
if(employee != null){
// call a function
switch (employee) {
case "Eddie":
showEddie();
break;
default:
break;
}
}
}

Expand All @@ -28,4 +35,7 @@ private void showAshique(){
fragmentTransaction.add(R.id.employee_profile,new Ashique());
fragmentTransaction.commit();
}
private void showEddie() {
getFragmentManager().beginTransaction().add(R.id.employee_profile, new Eddie()).commit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package nyc.c4q.grocerystore.employeeHandbook.employees;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import nyc.c4q.grocerystore.R;

public class Eddie extends Fragment {

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.eddie_melendez,container,false);
}
}
Binary file added app/src/main/res/drawable/e_melendez.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/e_melendez_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions app/src/main/res/layout/eddie_melendez.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:background="@drawable/e_melendez_bg">

<ImageView
android:id="@+id/profile_pic"
android:layout_centerHorizontal="true"
android:layout_width="200dp"
android:layout_height="220dp"
android:src="@drawable/e_melendez"/>

<TextView
android:id="@+id/nameField"
android:background="#CCFFFFFF"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/profile_pic"
android:layout_marginBottom="@dimen/activity_horizontal_margin"
android:text="Name: Edgardo Melendez" />
/>

<TextView
android:id="@+id/nicknameField"
android:background="#CCFFFFFF"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/nameField"
android:text="Nickname: Eddie"
android:layout_marginBottom="@dimen/activity_horizontal_margin"/>
/>

<TextView
android:id="@+id/bioField"
android:background="#CCFFFFFF"
android:padding="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/nicknameField"
android:text="@string/eddie_bio"/>
/>

</RelativeLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
<string name="jordans_nickname">Nickname: The World\'s Greatest</string>
<string name="Bio">My name is Jordan Smith. I\'m the manager of the freezer section of JJ\'s Grocery Store. Here\'s a picture of a waffle. I like waffles.</string>
<string name="jordans_name">Name:Jordan Smith</string>
<string name="eddie_bio">Bio:\n\nIn a far away place called Puerto Rico, a weird little boy was born. He found passion in the arts, writing, acting and now progamming. This is his story, as it begins....</string>
</resources>