Skip to content
Open

Rusi #80

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("Rusi", R.drawable.rli_image_self1)
);

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

public class EmployeeView extends AppCompatActivity {
public static final String EMPLOYEE_NAME = "extra.employee.name";
Expand All @@ -18,7 +19,9 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
setContentView(R.layout.employee_view);
String employee = getIntent().getStringExtra(EMPLOYEE_NAME);
if(employee != null){
// call a function
if (employee.equals("Rusi")){
this.showRusi();
}
}
}

Expand All @@ -28,4 +31,12 @@ private void showAshique(){
fragmentTransaction.add(R.id.employee_profile,new Ashique());
fragmentTransaction.commit();
}

private void showRusi(){
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.employee_profile,new Rusi());
fragmentTransaction.commit();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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;

/**
* Created by rusili on 10/19/16.
*/

public class Rusi extends Fragment{

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