Skip to content

Commit

Permalink
[smarcet] - #12704
Browse files Browse the repository at this point in the history
* added deep linking to search feature
  • Loading branch information
smarcet committed Mar 27, 2017
1 parent 39c3ed2 commit 45a509e
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
android:host="tracks"
android:scheme="org.openstack.android.summit" />

<data
android:host="search"
android:scheme="org.openstack.android.summit" />

</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ private boolean isInternalAppLink(Uri url){
if(url.getHost().toLowerCase().contains(DeepLinkInfo.NotificationsPath)) return true;
if(url.getHost().toLowerCase().contains(DeepLinkInfo.LevelPath)) return true;
if(url.getHost().toLowerCase().contains(DeepLinkInfo.TrackPath)) return true;
if(url.getHost().toLowerCase().contains(DeepLinkInfo.SearchPath)) return true;
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class DeepLinkInfo {
public static final String ActionViewLocation = "VIEW_LOCATION";
public static final String ActionViewSchedule = "VIEW_SCHEDULE";
public static final String ActionViewNotification = "VIEW_NOTIFICATION";
public static final String ActionViewSearch = "VIEW_SEARCH";

public static final String EventsPath = "events";
public static final String SpeakersPath = "speakers";
Expand All @@ -20,6 +21,7 @@ public class DeepLinkInfo {
public static final String LocationsPath = "locations";
public static final String SchedulePath = "schedule";
public static final String NotificationsPath = "notifications";
public static final String SearchPath = "search";

private String param;
private String action;
Expand All @@ -33,6 +35,7 @@ public DeepLinkInfo(String action, String param) {
if(action.toLowerCase().startsWith(NotificationsPath)) this.action = ActionViewNotification;
if(action.toLowerCase().startsWith(LevelPath)) this.action = ActionViewLevel;
if(action.toLowerCase().startsWith(TrackPath)) this.action = ActionViewTrack;
if(action.toLowerCase().startsWith(SearchPath)) this.action = ActionViewSearch;
}

public String getParam() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.openstack.android.summit.modules.main.business_logic.IMainInteractor;
import org.openstack.android.summit.modules.main.exceptions.MissingMemberException;
import org.openstack.android.summit.modules.rsvp.RSVPViewerActivity;

import java.net.URL;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
Expand Down Expand Up @@ -526,6 +528,19 @@ private boolean checkDeepLinks() {
this.wireframe.showEventsViewByLevel(level, this.view);
return true;
}
if (deepLinkInfo.getAction() == DeepLinkInfo.ActionViewSearch) {
if (!deepLinkInfo.hasParam()) return false;
view.setMenuItemChecked(R.id.nav_events);
String search = deepLinkInfo.getParam();
try{
search = java.net.URLDecoder.decode(search, "UTF-8");
}
catch (Exception ex){

}
this.wireframe.showSearchView(search, this.view);
return true;
}
if (deepLinkInfo.getAction() == DeepLinkInfo.ActionViewTrack) {
if (!deepLinkInfo.hasParam()) return false;
view.setMenuItemChecked(R.id.nav_events);
Expand Down
Empty file modified google-services.json.template
100644 → 100755
Empty file.
Empty file modified summit-app.properties.template
100644 → 100755
Empty file.

0 comments on commit 45a509e

Please sign in to comment.