Search in sources :

Example 6 with LibraryDeepLinkModuleRegistry

use of com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry in project DeepLinkDispatch by airbnb.

the class DeepLinkActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Debug.startMethodTracing("deeplink.trace",90000000);
    Map configurablePlaceholdersMap = new HashMap();
    configurablePlaceholdersMap.put("configPathOne", "somePathThree");
    configurablePlaceholdersMap.put("configurable-path-segment-one", "");
    configurablePlaceholdersMap.put("configurable-path-segment", "");
    configurablePlaceholdersMap.put("configurable-path-segment-two", "");
    configurablePlaceholdersMap.put("configPathOne", "somePathOne");
    DeepLinkDelegate deepLinkDelegate = new DeepLinkDelegate(new SampleModuleRegistry(), new LibraryDeepLinkModuleRegistry(), new BenchmarkDeepLinkModuleRegistry(), new KaptLibraryDeepLinkModuleRegistry(), configurablePlaceholdersMap);
    deepLinkDelegate.dispatchFrom(this);
    // Debug.stopMethodTracing();
    finish();
}
Also used : HashMap(java.util.HashMap) KaptLibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.kaptlibrary.KaptLibraryDeepLinkModuleRegistry) LibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry) KaptLibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.kaptlibrary.KaptLibraryDeepLinkModuleRegistry) BenchmarkDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.benchmarkable.BenchmarkDeepLinkModuleRegistry) Map(java.util.Map) HashMap(java.util.HashMap)

Example 7 with LibraryDeepLinkModuleRegistry

use of com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry in project DeepLinkDispatch by airbnb.

the class MainActivityTest method testSameLengthComponentsMismatch.

@Test
public void testSameLengthComponentsMismatch() throws Exception {
    Map<String, String> configurablePathSegmentReplacements = new HashMap<>();
    configurablePathSegmentReplacements.put("configurable-path-segment", "obamaOs");
    configurablePathSegmentReplacements.put("configurable-path-segment-one", "belong");
    configurablePathSegmentReplacements.put("configurable-path-segment-two", "anywhere");
    DeepLinkDelegate deepLinkDelegate = new DeepLinkDelegate(new SampleModuleRegistry(), new LibraryDeepLinkModuleRegistry(), new BenchmarkDeepLinkModuleRegistry(), new KaptLibraryDeepLinkModuleRegistry(), configurablePathSegmentReplacements);
    assertThat(deepLinkDelegate.supportsUri("dld://classDeepLink"), equalTo(true));
    assertThat(deepLinkDelegate.supportsUri("dld://classDeepLinx"), equalTo(false));
}
Also used : HashMap(java.util.HashMap) KaptLibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.kaptlibrary.KaptLibraryDeepLinkModuleRegistry) LibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry) KaptLibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.kaptlibrary.KaptLibraryDeepLinkModuleRegistry) BenchmarkDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.benchmarkable.BenchmarkDeepLinkModuleRegistry) Test(org.junit.Test)

Example 8 with LibraryDeepLinkModuleRegistry

use of com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry in project DeepLinkDispatch by airbnb.

the class MainActivityTest method testConfigurablePathSegmentMatch.

@Test
public void testConfigurablePathSegmentMatch() {
    Map<String, String> configurablePathSegmentReplacements = new HashMap<>();
    configurablePathSegmentReplacements.put("configurable-path-segment", "obamaOs");
    configurablePathSegmentReplacements.put("configurable-path-segment-one", "belong");
    configurablePathSegmentReplacements.put("configurable-path-segment-two", "anywhere");
    DeepLinkDelegate deepLinkDelegate = new DeepLinkDelegate(new SampleModuleRegistry(), new LibraryDeepLinkModuleRegistry(), new BenchmarkDeepLinkModuleRegistry(), new KaptLibraryDeepLinkModuleRegistry(), configurablePathSegmentReplacements);
    assertThat(deepLinkDelegate.supportsUri("https://www.example.com/capnMcCains/bar"), equalTo(false));
    assertThat(deepLinkDelegate.supportsUri("https://www.example.com/obamaOs/bar"), equalTo(true));
}
Also used : HashMap(java.util.HashMap) KaptLibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.kaptlibrary.KaptLibraryDeepLinkModuleRegistry) LibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry) KaptLibraryDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.kaptlibrary.KaptLibraryDeepLinkModuleRegistry) BenchmarkDeepLinkModuleRegistry(com.airbnb.deeplinkdispatch.sample.benchmarkable.BenchmarkDeepLinkModuleRegistry) Test(org.junit.Test)

Aggregations

BenchmarkDeepLinkModuleRegistry (com.airbnb.deeplinkdispatch.sample.benchmarkable.BenchmarkDeepLinkModuleRegistry)8 KaptLibraryDeepLinkModuleRegistry (com.airbnb.deeplinkdispatch.sample.kaptlibrary.KaptLibraryDeepLinkModuleRegistry)8 LibraryDeepLinkModuleRegistry (com.airbnb.deeplinkdispatch.sample.library.LibraryDeepLinkModuleRegistry)8 HashMap (java.util.HashMap)8 Test (org.junit.Test)6 Map (java.util.Map)2 DeepLinkUri (com.airbnb.deeplinkdispatch.DeepLinkUri)1 TypeConverters (com.airbnb.deeplinkdispatch.handler.TypeConverters)1 SampleModuleRegistry (com.airbnb.deeplinkdispatch.sample.SampleModuleRegistry)1 Type (java.lang.reflect.Type)1 Function3 (kotlin.jvm.functions.Function3)1