Skip to content

Commit

Permalink
FAQ now opens the code.mendhak.com/gpslogger/index.html page
Browse files Browse the repository at this point in the history
  • Loading branch information
mendhak committed Apr 14, 2014
1 parent d2c10b5 commit 07c8574
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 126 deletions.
122 changes: 0 additions & 122 deletions gpslogger/src/main/assets/faq.html

This file was deleted.

23 changes: 19 additions & 4 deletions gpslogger/src/main/java/com/mendhak/gpslogger/Faqtivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
import android.webkit.WebView;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

public class Faqtivity extends Activity
{


WebView browser;
private static final org.slf4j.Logger tracer = LoggerFactory.getLogger(Faqtivity.class.getSimpleName());
/**
* Event raised when the form is created for the first time
Expand All @@ -42,13 +45,25 @@ public void onCreate(Bundle savedInstanceState)

setContentView(R.layout.activity_faq);

WebView browser = (WebView)findViewById(R.id.faqwebview);
browser = (WebView)findViewById(R.id.faqwebview);
WebSettings settings = browser.getSettings();
settings.setLoadWithOverviewMode(true);
settings.setUseWideViewPort(true);
settings.setBuiltInZoomControls(true);
settings.setJavaScriptEnabled(true);
browser.loadUrl("file:///android_asset/faq.html");
}

Map<String, String> noCacheHeaders = new HashMap<String, String>(2);
noCacheHeaders.put("Pragma", "no-cache");
noCacheHeaders.put("Cache-Control", "no-cache");

browser.loadUrl("http://code.mendhak.com/gpslogger/index.html", noCacheHeaders);
}


@Override
protected void onStop() {
super.onStop();
browser.clearCache(true);
browser.clearHistory();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.test.ActivityInstrumentationTestCase2;
import android.webkit.WebView;
import com.mendhak.gpslogger.senders.email.AutoEmailActivity;
import com.mendhak.gpslogger.senders.ftp.AutoFtpActivity;
import com.robotium.solo.Solo;
Expand Down Expand Up @@ -46,6 +47,8 @@ public void testCanSeeMenuItems() {
public void testHelpButtonOpensFAQPage(){
solo.clickOnView(solo.getView(R.id.imgHelp));
solo.assertCurrentActivity("FAQ Screen", Faqtivity.class);
WebView webView = (WebView)solo.getView(R.id.faqwebview);
assertTrue(solo.getWebUrl(), solo.getWebUrl().equals("http://code.mendhak.com/gpslogger/index.html"));
}

public void testSinglePointButtonDisabledWhenLoggingStarted() {
Expand Down

0 comments on commit 07c8574

Please sign in to comment.