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

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

public class EmployeeView extends AppCompatActivity {
public static final String EMPLOYEE_NAME = "extra.employee.name";
Expand All @@ -18,7 +19,16 @@ 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 "Ashique":
showAshique();
break;
case "Mel":
showMel();
break;
default:
break;
}
}
}

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



private void showMel(){
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.add(R.id.employee_profile,new Mel());
fragmentTransaction.commit();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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 meltemyildirim on 10/23/16.
*/

public class Mel extends Fragment {


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


}
Binary file added app/src/main/res/drawable/mel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 21 additions & 32 deletions app/src/main/res/layout/meltem_yildirim.xml
Original file line number Diff line number Diff line change
@@ -1,44 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">


<ImageView
android:layout_width="match_parent"
android:layout_height="240dp"
android:layout_height="220dp"
android:id="@+id/image_top"
android:src="@drawable/top"
android:scaleType="fitCenter" />
android:src="@drawable/mel"
android:background="#000" />

<RelativeLayout
<ImageView
android:id="@+id/bottom_image"
android:src="@drawable/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/image_top">
android:layout_weight="50"
android:layout_height="0dp" />

<ImageView
android:id="@+id/right_image"
android:layout_width="150dp"
android:layout_height="150dp"

android:src="@drawable/right"
android:layout_marginLeft="12dp"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<TextView
android:id="@+id/text"
android:layout_width="200dp"
android:layout_height="100dp"
android:text="some text"
android:layout_alignTop="@+id/right_image"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginRight="34dp"
android:layout_marginEnd="34dp" />
</RelativeLayout>
<TextView
android:id="@+id/textview"
android:layout_marginTop="0dp"
android:layout_width="match_parent"
android:layout_weight="50"
android:layout_height="0dp"
android:text="@string/mel"
android:paddingTop="2dp"/>


</RelativeLayout>
</LinearLayout>
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@
<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="mel">" The angels, not half so happy in Heaven,
Went envying her and me—
Yes!—that was the reason (as all men know,
In this kingdom by the sea)
That the wind came out of the cloud by night,
Chilling and killing my Annabel Lee.
- Edgar A. POE - " </string>
</resources>