Skip to content

Commit 289b6fe

Browse files
multidynamic13rac1
authored andcommitted
Fixed Issue #2 Refine back stack
Refactored refine into a new activity Sub-classed Refine and Explore under a common class with two ancestors (may consider removing RwServiceWebActivity ancestory for explore) Removed singleInstance property from Activities, it causes issues and does not appear to benefit us any Fixed a non-reported issue where refine would not modify stream Added cull method to remove non-web applicable tags from taglist
1 parent b90a358 commit 289b6fe

File tree

14 files changed

+403
-245
lines changed

14 files changed

+403
-245
lines changed

app-starter/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
android:allowBackup="true">
66
<activity android:name=".MainActivity"
77
android:label="@string/app_name"
8-
android:launchMode="singleInstance"
98
android:configChanges="keyboardHidden|orientation|screenSize"
109
android:screenOrientation="portrait">
1110
<intent-filter>

rwapp/src/main/AndroidManifest.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<activity
3030
android:name=".RwListenActivity"
3131
android:label="@string/title_activity_listen"
32-
android:launchMode="singleInstance"
3332
android:configChanges="keyboardHidden|orientation|screenSize"
3433
android:screenOrientation="portrait"
3534
android:theme="@style/AppTheme" >
@@ -38,7 +37,6 @@
3837
<activity
3938
android:name=".RwSpeakActivity"
4039
android:label="@string/title_activity_speak"
41-
android:launchMode="singleInstance"
4240
android:configChanges="keyboardHidden|orientation|screenSize"
4341
android:screenOrientation="portrait"
4442
android:theme="@style/AppTheme" >
@@ -52,12 +50,20 @@
5250
<activity
5351
android:name=".RwExploreActivity"
5452
android:label= "@string/title_activity_explore"
55-
android:launchMode="singleInstance"
5653
android:configChanges="keyboardHidden|orientation|screenSize"
5754
android:screenOrientation="portrait"
5855
android:theme="@style/AppTheme" >
5956
</activity>
6057

58+
<activity
59+
android:name=".RwRefineActivity"
60+
android:label= "@string/title_activity_refine"
61+
android:configChanges="keyboardHidden|orientation|screenSize"
62+
android:screenOrientation="portrait"
63+
android:theme="@style/AppTheme" >
64+
</activity>
65+
66+
6167
<service android:label="RoundwareService" android:name="org.roundware.service.RWService">
6268
<meta-data android:name="com.google.android.gms.version" android:value="3265130" />
6369
</service>

rwapp/src/main/java/org/roundware/rwapp/RwApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void onCreate() {
2929
ClassRegistry.register("RwSpeakActivity", RwSpeakActivity.class);
3030
ClassRegistry.register("RwListenActivity", RwListenActivity.class);
3131
ClassRegistry.register("RwExploreActivity", RwExploreActivity.class);
32+
ClassRegistry.register("RwRefineActivity", RwRefineActivity.class);
3233
}
3334

3435
// Src: http://stackoverflow.com/questions/2002288/static-way-to-get-context-on-android

rwapp/src/main/java/org/roundware/rwapp/RwExploreActivity.java

Lines changed: 4 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,16 @@
44
*/
55
package org.roundware.rwapp;
66

7-
import android.app.Activity;
8-
import android.net.Uri;
9-
import android.os.Bundle;
10-
import android.util.Log;
11-
import android.view.Window;
12-
import android.webkit.WebSettings;
13-
import android.webkit.WebView;
14-
import android.webkit.WebViewClient;
15-
167
/**
17-
*
8+
* Explore activity
189
*/
19-
public class RwExploreActivity extends Activity {
10+
public class RwExploreActivity extends RwServiceWebActivity {
2011
public static final String LOGTAG = RwExploreActivity.class.getSimpleName();
2112
private final static boolean D = true;
2213

2314
@Override
24-
protected void onCreate(Bundle savedInstanceState) {
25-
if (D) { Log.d(LOGTAG, "+++ onCreate +++"); }
26-
super.onCreate(savedInstanceState);
27-
28-
getWindow().requestFeature(Window.FEATURE_PROGRESS);
29-
setContentView(R.layout.activity_explore);
30-
WebView webView = (WebView) findViewById(R.id.exploreWebView);
31-
32-
webView.loadUrl(getString(R.string.explore_url));
33-
34-
WebSettings webSettings = webView.getSettings();
35-
36-
webSettings.setAppCachePath(this.getFilesDir().getAbsolutePath());
37-
webSettings.setAppCacheEnabled(true);
38-
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
39-
40-
webSettings.setJavaScriptEnabled(true);
41-
webSettings.setJavaScriptCanOpenWindowsAutomatically(false);
42-
webSettings.setSupportMultipleWindows(false);
43-
webSettings.setSupportZoom(false);
44-
webSettings.setSavePassword(false);
45-
webSettings.setGeolocationDatabasePath(this.getFilesDir().getAbsolutePath());
46-
webSettings.setGeolocationEnabled(false);
47-
webSettings.setDatabaseEnabled(false);
48-
webSettings.setDomStorageEnabled(false);
49-
50-
webView.setWebViewClient(new WebViewClient() {
51-
@Override
52-
public boolean shouldOverrideUrlLoading(WebView view, String url) {
53-
Log.d(LOGTAG, "shouldOverrideUrlLoading");
54-
Uri uri = Uri.parse(url);
55-
if (uri.getScheme().equals("roundware")) {
56-
Log.d(LOGTAG, "Processing roundware uri: " + url);
57-
String schemeSpecificPart = uri.getSchemeSpecificPart(); // everything from : to #
58-
if ("//webview_done".equalsIgnoreCase((schemeSpecificPart))) {
59-
finish();
60-
}
61-
return true;
62-
}
63-
// open link in external browser
64-
return super.shouldOverrideUrlLoading(view, url);
65-
}
66-
67-
});
15+
protected String getUrl() {
16+
return getString(R.string.explore_url);
6817
}
69-
7018
}
7119

0 commit comments

Comments
 (0)