Commit 903fd124 authored by Sajal Narang's avatar Sajal Narang

Implement navigation

parent ecc5387e
......@@ -4,6 +4,7 @@
<modules>
<module fileurl="file://$PROJECT_DIR$/IITB-App.iml" filepath="$PROJECT_DIR$/IITB-App.iml" />
<module fileurl="file://$PROJECT_DIR$/IITBApp.iml" filepath="$PROJECT_DIR$/IITBApp.iml" />
<module fileurl="file://$PROJECT_DIR$/InstiApp.iml" filepath="$PROJECT_DIR$/InstiApp.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
......
......@@ -51,9 +51,9 @@ public class EventFragment extends BaseFragment {
Event event;
Button goingButton;
Button interestedButton;
Button notGoingButton;
ImageButton shareEventButton;
ImageButton navigateButton;
ImageButton webEventButton;
ImageButton shareEventButton;
RecyclerView bodyRecyclerView;
private AppDatabase appDatabase;
String TAG = "EventFragment";
......@@ -93,8 +93,9 @@ public class EventFragment extends BaseFragment {
TextView eventDescription = (TextView) getActivity().findViewById(R.id.event_page_description);
goingButton = getActivity().findViewById(R.id.going_button);
interestedButton = getActivity().findViewById(R.id.interested_button);
shareEventButton = getActivity().findViewById(R.id.share_event_button);
navigateButton = getActivity().findViewById(R.id.navigate_button);
webEventButton = getActivity().findViewById(R.id.web_event_button);
shareEventButton = getActivity().findViewById(R.id.share_event_button);
Picasso.with(getContext()).load(event.getEventImageURL()).into(eventPicture);
eventTitle.setText(event.getEventName());
......@@ -119,6 +120,7 @@ public class EventFragment extends BaseFragment {
Body body = bodyList.get(position);
BodyFragment bodyFragment = BodyFragment.newInstance(body);
FragmentTransaction ft = getActivity().getSupportFragmentManager().beginTransaction();
ft.setCustomAnimations(R.anim.slide_in_left, R.anim.slide_out_left, R.anim.slide_in_right, R.anim.slide_out_right);
ft.replace(R.id.framelayout_for_fragment, bodyFragment, bodyFragment.getTag());
ft.addToBackStack(bodyFragment.getTag());
ft.commit();
......@@ -138,8 +140,20 @@ public class EventFragment extends BaseFragment {
interestedButton.setBackgroundColor(getResources().getColor(event.getEventUserUes() == Constants.STATUS_INTERESTED ? R.color.colorAccent : R.color.colorWhite));
goingButton.setBackgroundColor(getResources().getColor(event.getEventUserUes() == Constants.STATUS_GOING ? R.color.colorAccent : R.color.colorWhite));
navigateButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Venue primaryVenue = event.getEventVenues().get(0);
Uri gmmIntentUri = Uri.parse("google.navigation:q=" + primaryVenue.getVenueLatitude() + "," + primaryVenue.getVenueLongitude() + "(" + primaryVenue.getVenueName() + ")");
Intent mapIntent = new Intent(Intent.ACTION_VIEW, gmmIntentUri);
mapIntent.setPackage("com.google.android.apps.maps");
startActivity(mapIntent);
}
});
shareEventButton.setOnClickListener(new View.OnClickListener() {
String shareUrl = ShareURLMaker.getEventURL(event);
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_SEND);
......@@ -149,11 +163,11 @@ public class EventFragment extends BaseFragment {
startActivity(Intent.createChooser(i, "Share URL"));
}
});
if (event.getEventWebsiteURL() != null && !event.getEventWebsiteURL().isEmpty())
{
if (event.getEventWebsiteURL() != null && !event.getEventWebsiteURL().isEmpty()) {
webEventButton.setVisibility(View.VISIBLE);
webEventButton.setOnClickListener(new View.OnClickListener() {
String eventwebURL = event.getEventWebsiteURL();
@Override
public void onClick(View view) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(eventwebURL));
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,2L4.5,20.29l0.71,0.71L12,18l6.79,3 0.71,-0.71z"/>
</vector>
......@@ -57,24 +57,35 @@
<ImageButton
android:id="@+id/web_event_button"
android:layout_width="10dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Event Website"
android:src="@drawable/ic_language_black_24dp"
android:layout_marginStart="8dp"
app:srcCompat="@drawable/ic_language_black_24dp"
android:tint="@color/colorWhite"
android:visibility="invisible"/>
<ImageButton
android:id="@+id/navigate_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Navigate"
android:layout_marginStart="8dp"
app:srcCompat="@drawable/baseline_navigation_24"
android:tint="@color/colorWhite" />
<ImageButton
android:id="@+id/share_event_button"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Share Event"
android:layout_marginStart="8dp"
android:src="@drawable/ic_menu_share"
android:tint="@color/colorWhite" />
</LinearLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment