-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContactUs.java
149 lines (128 loc) · 4.58 KB
/
ContactUs.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package com.appnucleus.loginandregisteruser;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class ContactUs extends FragmentActivity
{
private GoogleMap mMap;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contact_us);
overridePendingTransition(R.anim.pull_in_left, R.anim.push_out_right);
//redirect to facebook
findViewById(R.id.facebook).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
String url = "http://www.facebook.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
//redirect to twitter
findViewById(R.id.twitter).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
String url = "http://www.twitter.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
//redirect to google plus
findViewById(R.id.googleplus).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
String url = "http://www.googleplus.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
//redirect to linkedin
findViewById(R.id.linkedin).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
String url = "http://www.linkedin.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
//set up the map to show our base
setUpMapIfNeeded();
}
private void setUpMapIfNeeded()
{
// Do a null check to confirm that we have not already instantiated the map.
if (mMap == null)
{
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
// Check if we were successful in obtaining the map.
if (mMap != null)
{
setUpMap();
}
}
}
/**
* This is where we can add markers or lines, add listeners or move the camera. In this case, we
* just add a marker near Africa.
* <p/>
* This should only be called once and when we are sure that {@link #mMap} is not null.
*/
private void setUpMap()
{
//marker to show college location
mMap.addMarker(new MarkerOptions().position(new LatLng(52.66280096826037, -7.802382163476523))
.title("RAMP Corporate Headquarters"));
LatLng latLng = new LatLng(52.6835, -7.8237);
//how close to zoom to college
float zoomLevel = 11; //This goes up to 21
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, zoomLevel));
//enable users location
mMap.setMyLocationEnabled(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_contact_us, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item)
{
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings)
{
return true;
}
return super.onOptionsItemSelected(item);
}
}