Skip to content

Commit

Permalink
Add intent filter for ColorDict search action
Browse files Browse the repository at this point in the history
  • Loading branch information
itkach committed Dec 6, 2015
1 parent 467a9a5 commit 5637152
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
16 changes: 11 additions & 5 deletions AndroidManifest.template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
android:icon="@drawable/aard2"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar" >

<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
Expand All @@ -29,26 +30,28 @@
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".ArticleCollectionActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:excludeFromRecents="true"
android:taskAffinity="" >
<intent-filter>
<action android:name="aard2.lookup" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<action android:name="colordict.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:mimeType="text/plain" />
</intent-filter>

</activity>

{wikipedia_activities}
Expand All @@ -58,12 +61,15 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:label="@string/title_activity_file_select" >
</activity>
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow"> </uses-library>

<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />

<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:resource="@dimen/app_defaultsize_w" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:resource="@dimen/app_defaultsize_h" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:resource="@dimen/app_minimumsize_w" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:resource="@dimen/app_minimumsize_h" />

</application>

</manifest>
16 changes: 11 additions & 5 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
android:icon="@drawable/aard2"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar" >

<activity
android:name=".MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
Expand All @@ -29,26 +30,28 @@
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".ArticleCollectionActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:excludeFromRecents="true"
android:taskAffinity="" >
<intent-filter>
<action android:name="aard2.lookup" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<action android:name="colordict.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data android:mimeType="text/plain" />
</intent-filter>

</activity>

<activity-alias
Expand Down Expand Up @@ -17517,12 +17520,15 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout"
android:label="@string/title_activity_file_select" >
</activity>
<uses-library android:required="false" android:name="com.sec.android.app.multiwindow"> </uses-library>

<uses-library android:required="false" android:name="com.sec.android.app.multiwindow" />

<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:resource="@dimen/app_defaultsize_w" />
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:resource="@dimen/app_defaultsize_h" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:resource="@dimen/app_minimumsize_w" />
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:resource="@dimen/app_minimumsize_h" />

</application>

</manifest>
3 changes: 3 additions & 0 deletions src/itkach/aard2/ArticleCollectionActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ private ArticleCollectionPagerAdapter createFromIntent(Application app, Intent i
if (lookupKey == null) {
lookupKey = intent.getStringExtra(SearchManager.QUERY);
}
if (lookupKey == null) {
lookupKey = intent.getStringExtra("EXTRA_QUERY");
}
String preferredSlobId = null;
if (lookupKey == null) {
Uri uri = intent.getData();
Expand Down

0 comments on commit 5637152

Please sign in to comment.