Skip to content

Commit 0de0f44

Browse files
- HistorySingleActivity
1 parent a91aa63 commit 0de0f44

File tree

6 files changed

+109
-2
lines changed

6 files changed

+109
-2
lines changed

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ dependencies {
5353

5454

5555

56+
5657
apply plugin: 'com.google.gms.google-services'

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
<activity android:name=".CustomerMapActivity" />
4747
<activity android:name=".CustomerSettingsActivity" />
4848
<activity android:name=".DriverSettingsActivity" />
49-
<activity android:name=".HistoryActivity"></activity>
49+
<activity android:name=".HistoryActivity" />
50+
<activity android:name=".HistorySingleActivity"></activity>
5051
</application>
5152

5253
</manifest>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.simcoder.uber;
2+
3+
import android.support.v7.app.AppCompatActivity;
4+
import android.os.Bundle;
5+
6+
import com.google.android.gms.maps.GoogleMap;
7+
import com.google.android.gms.maps.OnMapReadyCallback;
8+
import com.google.android.gms.maps.SupportMapFragment;
9+
10+
public class HistorySingleActivity extends AppCompatActivity implements OnMapReadyCallback{
11+
12+
private GoogleMap mMap;
13+
private SupportMapFragment mMapFragment;
14+
@Override
15+
protected void onCreate(Bundle savedInstanceState) {
16+
super.onCreate(savedInstanceState);
17+
setContentView(R.layout.activity_history_single);
18+
mMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
19+
20+
mMapFragment.getMapAsync(this);
21+
}
22+
23+
@Override
24+
public void onMapReady(GoogleMap googleMap) {
25+
}
26+
}

app/src/main/java/com/simcoder/uber/historyRecyclerView/HistoryViewHolders.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package com.simcoder.uber.historyRecyclerView;
22

3+
import android.content.Intent;
4+
import android.os.Bundle;
35
import android.support.v7.widget.RecyclerView;
46
import android.view.View;
57
import android.widget.TextView;
68

9+
import com.simcoder.uber.HistorySingleActivity;
710
import com.simcoder.uber.R;
811

912
/**
@@ -25,5 +28,10 @@ public HistoryViewHolders(View itemView) {
2528

2629
@Override
2730
public void onClick(View v) {
31+
Intent intent = new Intent(v.getContext(), HistorySingleActivity.class);
32+
Bundle b = new Bundle();
33+
b.putString("rideId", rideId.getText().toString());
34+
intent.putExtras(b);
35+
v.getContext().startActivity(intent);
2836
}
2937
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
5+
xmlns:tools="http://schemas.android.com/tools"
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
tools:context="com.simcoder.uber.HistorySingleActivity"
9+
android:orientation="vertical">
10+
<fragment
11+
android:layout_width="match_parent"
12+
android:layout_height="200dp"
13+
android:name="com.google.android.gms.maps.SupportMapFragment"
14+
android:id="@+id/map"/>
15+
<LinearLayout
16+
android:layout_width="match_parent"
17+
android:layout_height="wrap_content"
18+
android:layout_margin="20sp"
19+
android:orientation="vertical">
20+
<TextView
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
android:text="From - To"
24+
android:layout_marginBottom="20sp"
25+
android:id="@+id/rideLocation"/>
26+
<TextView
27+
android:layout_width="match_parent"
28+
android:layout_height="wrap_content"
29+
android:text="distance"
30+
android:layout_marginBottom="20sp"
31+
android:id="@+id/rideDistance"/>
32+
<TextView
33+
android:layout_width="match_parent"
34+
android:layout_height="wrap_content"
35+
android:text="date"
36+
android:layout_marginBottom="20sp"
37+
android:id="@+id/rideDate"/>
38+
</LinearLayout>
39+
40+
<LinearLayout
41+
android:layout_width="match_parent"
42+
android:layout_height="wrap_content"
43+
android:layout_margin="20sp"
44+
android:orientation="horizontal">
45+
<ImageView
46+
android:layout_width="100dp"
47+
android:layout_height="100dp"
48+
android:id="@+id/userImage"
49+
android:src="@mipmap/ic_default_user"/>
50+
<LinearLayout
51+
android:layout_width="wrap_content"
52+
android:layout_height="wrap_content"
53+
android:orientation="vertical"
54+
android:layout_marginLeft="10dp"
55+
android:layout_marginTop="20sp">
56+
<TextView
57+
android:layout_width="match_parent"
58+
android:layout_height="wrap_content"
59+
android:text="name"
60+
android:layout_marginBottom="20sp"
61+
android:id="@+id/userName"/>
62+
<TextView
63+
android:layout_width="match_parent"
64+
android:layout_height="wrap_content"
65+
android:text="phone"
66+
android:layout_marginBottom="20sp"
67+
android:id="@+id/userPhone"/>
68+
</LinearLayout>
69+
70+
</LinearLayout>
71+
72+
</LinearLayout>

app/src/main/res/layout/item_history.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@
1616
android:id="@+id/rideId"
1717
android:textSize="12dp"
1818
android:text="rideId"/>
19-
2019
</LinearLayout>

0 commit comments

Comments
 (0)