Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Embed static serach.html in assests (close #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
sh1r0 committed Oct 23, 2016
1 parent 6a9c5e2 commit 0e04f76
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 13 deletions.
19 changes: 10 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import groovy.swing.SwingBuilder

apply plugin: 'com.android.application'

android {
Expand All @@ -10,10 +8,10 @@ android {

defaultConfig {
applicationId "com.sh1r0.noveldroid"
minSdkVersion 10
minSdkVersion 14
targetSdkVersion 22
versionCode 53
versionName "1.5.0"
versionCode 54
versionName "1.5.1"
}

signingConfigs {
Expand All @@ -24,7 +22,11 @@ android {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

debug {
applicationIdSuffix ".debug"
}
}
}
Expand All @@ -34,9 +36,8 @@ dependencies {
compile 'com.android.support:preference-v7:23.3.0'
compile 'com.android.support:preference-v14:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.0'
compile 'org.jsoup:jsoup:1.7.3'
compile 'com.squareup:otto:1.3.5'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'org.jsoup:jsoup:1.9.2'
compile 'com.nononsenseapps:filepicker:2.5.2'
compile 'com.github.medyo:android-about-page:1.0.7'
}
Expand Down
25 changes: 25 additions & 0 deletions app/src/main/assets/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>

<html>
<head>
<meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">
<title>Search</title>
<head>
<body>
<div>
<script>
(function() {
var cx = '007892500683958105092:oqxggbpybf4';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion app/src/main/java/com/sh1r0/noveldroid/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ private void popupSearchDialog() {

final WebView wv = (WebView) searchDialogView.findViewById(R.id.wv_search);
wv.getSettings().setJavaScriptEnabled(true);
wv.loadUrl("https://googledrive.com/host/0By9mvBCbgqrycV9naFJSYm5mbjQ");
wv.loadUrl("file:///android_asset/search.html");
wv.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:2.2.2'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Apr 25 20:17:03 CST 2016
#Thu Oct 20 22:50:13 CST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

0 comments on commit 0e04f76

Please sign in to comment.