Skip to content

Commit

Permalink
content provider invock success
Browse files Browse the repository at this point in the history
  • Loading branch information
ratanparai committed Apr 24, 2019
1 parent 5e69255 commit 79d586a
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 3 deletions.
20 changes: 18 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:required="false"/>
<uses-feature
android:name="android.software.leanback"
android:required="true"/>
android:required="false"/>

<uses-permission android:name="android.permission.INTERNET" />

Expand All @@ -27,10 +27,26 @@
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
</intent-filter>
</activity>

<activity
android:name=".SearchableActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>

<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>

<activity android:name=".DetailsActivity"/>
<activity android:name=".PlaybackActivity"/>
<activity android:name=".BrowseErrorActivity"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.ratanparai.moviedog

import android.app.Activity

class SearchableActivity: Activity() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.ratanparai.moviedog.provider
import android.app.SearchManager
import android.content.ContentProvider
import android.content.ContentValues
import android.content.UriMatcher
import android.database.Cursor
import android.net.Uri
import android.content.UriMatcher
import android.util.Log
import com.ratanparai.moviedog.db.AppDatabase
import com.ratanparai.moviedog.db.dao.MovieDao
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
<string name="buy_2">AT $9.99</string>
<string name="movie">Movie</string>


<string name="search_hint">Search for Videos</string>
<string name="search_label">Movie Dog</string>
<string name="settings_description">Movie Dog: Videos</string>


<!-- Error messages -->
<string name="error_fragment_message">An error occurred</string>
<string name="dismiss_error">Dismiss</string>
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/res/xml/searchable.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- The attributes below configure the Android search box appearance
and the search suggestions settings.
See the Developer Guide for more information
http://developer.android.com/guide/topics/search/
The Assistant's priority order for intent actions are as follows:
1) Intent specified in cursor(SUGGEST_COLUMN_INTENT_ACTION)
2) Intent specific in this file (searchSuggestIntentAction)
3) ACTION_SEARCH(default)
It is recommended to set it to ACTION_VIEW in searchable.xml and only override in code if you
want to handle certain pieces of content differently.
-->
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:hint="@string/search_hint"
android:includeInGlobalSearch="true"
android:label="@string/search_label"
android:icon="@drawable/lb_ic_in_app_search"
android:searchSettingsDescription="@string/settings_description"
android:searchSuggestAuthority="com.ratanparai.moviedog"
android:searchSuggestIntentAction="android.intent.action.VIEW"
android:searchSuggestIntentData="content://com.rataparai.moviedog/video"
android:queryAfterZeroResults="true"
android:searchSuggestPath="search"
android:searchSuggestThreshold="0" />

0 comments on commit 79d586a

Please # to comment.