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 @@ -15,6 +15,7 @@ class EmployeeListAdapter extends RecyclerView.Adapter{

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

@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.Josiel;

public class EmployeeView extends AppCompatActivity {
public static final String EMPLOYEE_NAME = "extra.employee.name";
Expand All @@ -19,6 +20,14 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
String employee = getIntent().getStringExtra(EMPLOYEE_NAME);
if(employee != null){
// call a function
switch(employee){
case "Ashique":
showAshique();
break;
case "Josiel":
showJosiel();
break;
}
}
}

Expand All @@ -27,5 +36,15 @@ private void showAshique(){
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.employee_profile,new Ashique());
fragmentTransaction.commit();

}

// R.id.employee_profile, new Josiel()

private void showJosiel(){
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.employee_profile, new Josiel());
fragmentTransaction.commit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package nyc.c4q.grocerystore.employeeHandbook.employees;

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

import nyc.c4q.grocerystore.R;



public class Josiel extends Fragment {

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.josiel_lopez,container,false);
}
}