Commit 45884f4a authored by Varun Patil's avatar Varun Patil

Add following map link

parent 7296bbc1
......@@ -76,6 +76,17 @@
android:pathPattern="/event/.*"
android:scheme="https" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="insti.app"
android:pathPattern="/map/.*"
android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name=".activity.LoginActivity"
......
......@@ -55,6 +55,7 @@ public class Constants {
public static final String DATA_TYPE_USER = "userprofile";
public static final String DATA_TYPE_NEWS = "newsentry";
public static final String DATA_TYPE_PT = "blogentry";
public static final String DATA_TYPE_MAP= "map";
public static final String CARD_TYPE_TITLE = "card_type_title";
public static final String CARD_TYPE_BODY_HEAD = "card_type_body_head";
......
......@@ -81,6 +81,7 @@ import retrofit2.Response;
import static app.insti.Constants.DATA_TYPE_BODY;
import static app.insti.Constants.DATA_TYPE_EVENT;
import static app.insti.Constants.DATA_TYPE_MAP;
import static app.insti.Constants.DATA_TYPE_NEWS;
import static app.insti.Constants.DATA_TYPE_PT;
import static app.insti.Constants.DATA_TYPE_USER;
......@@ -336,6 +337,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
case DATA_TYPE_NEWS:
updateFragment((new NewsFragment()).withId(id));
return;
case DATA_TYPE_MAP:
updateFragment(MapFragment.newInstance(id));
return;
}
Log.e("NOTIFICATIONS", "Server sent invalid notification?");
}
......@@ -399,6 +403,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
return DATA_TYPE_EVENT;
case "user":
return DATA_TYPE_USER;
case "map":
return DATA_TYPE_MAP;
}
} catch (MalformedURLException ignored) {}
return null;
......
......@@ -242,10 +242,7 @@ public class EventFragment extends BackHandledFragment implements TransitionTarg
ClickableSpan cs = new ClickableSpan() {
@Override
public void onClick(@NonNull View widget) {
MapFragment mapFragment = new MapFragment();
Bundle bundle = new Bundle();
bundle.putString(Constants.MAP_INITIAL_MARKER, MapFragment.getPassableName(venue.getVenueShortName()));
mapFragment.setArguments(bundle);
MapFragment mapFragment = MapFragment.newInstance(MapFragment.getPassableName(venue.getVenueShortName()));
((MainActivity) getActivity()).updateFragment(mapFragment);
}
......
......@@ -257,6 +257,14 @@ public class MapFragment extends Fragment implements TextWatcher,
super.onResume();
}
public static MapFragment newInstance(String location) {
Bundle args = new Bundle();
args.putString(Constants.MAP_INITIAL_MARKER, location);
MapFragment fragment = new MapFragment();
fragment.setArguments(args);
return fragment;
}
private void getAPILocations() {
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.getAllVenues().enqueue(new Callback<List<Venue>>() {
......
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