Skip to content

Commit 9dc3dfd

Browse files
authored
Merge pull request #23 from vknow360/beta
Merge beta branch
2 parents 0523448 + c8f0abd commit 9dc3dfd

File tree

7 files changed

+2096
-1779
lines changed

7 files changed

+2096
-1779
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
99
liberapay: # Replace with a single Liberapay username
1010
issuehunt: # Replace with a single IssueHunt username
1111
otechie: # Replace with a single Otechie username
12-
custom: https://paypal.me/maaayur
12+
custom: https://paypal.me/PremwatiGupta?country.x=IN&locale.x=en_GB
-67 KB
Binary file not shown.

aix/com.sunny.CustomWebView.aix

9.33 KB
Binary file not shown.
Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
package com.sunny.CustomWebView;
2-
import android.app.Activity;
3-
import android.content.Intent;
4-
import android.net.Uri;
5-
import com.google.appinventor.components.annotations.androidmanifest.*;
6-
import com.google.appinventor.components.runtime.*;
7-
import com.google.appinventor.components.annotations.*;
8-
import com.google.appinventor.components.common.ComponentCategory;
9-
@DesignerComponent(version = 1,
10-
versionName = "1.2",
11-
description ="Helper class of CustomWebView extension to add app to browsers list<br> Developed by Sunny Gupta",
12-
category = ComponentCategory.EXTENSION,
13-
nonVisible = true,
14-
iconName = "https://res.cloudinary.com/andromedaviewflyvipul/image/upload/c_scale,h_20,w_20/v1571472765/ktvu4bapylsvnykoyhdm.png",
15-
helpUrl="https://github.com/vknow360/CustomWebView",
16-
androidMinSdk = 21)
17-
@UsesActivities(activities = {@ActivityElement(intentFilters = {@IntentFilterElement(actionElements = {@ActionElement(name = "android.intent.action.VIEW")}, categoryElements = {@CategoryElement(name = "android.intent.category.DEFAULT"), @CategoryElement(name = "android.intent.category.BROWSABLE")}, dataElements = {@DataElement(scheme = "http"), @DataElement(scheme = "https")}), @IntentFilterElement(actionElements = {@ActionElement(name = "android.intent.action.VIEW")}, categoryElements = {@CategoryElement(name = "android.intent.category.DEFAULT"), @CategoryElement(name = "android.intent.category.BROWSABLE")}, dataElements = {@DataElement(scheme = "http"), @DataElement(scheme = "https"), @DataElement(mimeType = "text/html"), @DataElement(mimeType = "text/plain"), @DataElement(mimeType = "application/xhtml+xml")})},name="appinventor.ai_vknow360.CustomWebView.Screen1",launchMode = "singleTop")})
18-
@SimpleObject(external=true)
19-
public class BrowserPromptHelper extends AndroidNonvisibleComponent implements OnNewIntentListener {
20-
public Activity activity;
21-
public BrowserPromptHelper(ComponentContainer container){
22-
super(container.$form());
23-
activity = container.$context();
24-
form.registerForOnNewIntent(this);
25-
}
26-
public String getUrl(Intent intent){
27-
Uri uri = intent.getData();
28-
if (uri != null && uri.toString() != null){
29-
return uri.toString();
30-
}
31-
return "";
32-
}
33-
@SimpleFunction(description = "Returns the url which started the current activity")
34-
public String GetStartUrl(){
35-
return getUrl(activity.getIntent());
36-
}
37-
38-
@SimpleEvent(description = "Event raised when app gets resumed and gives the url which started this activity/screen if there is any else empty string")
39-
public void OnResume(String url){
40-
EventDispatcher.dispatchEvent(this,"OnResume",url);
41-
}
42-
43-
@Override
44-
public void onNewIntent(Intent intent) {
45-
OnResume(getUrl(intent));
46-
}
47-
}
1+
package com.sunny.CustomWebView;
2+
import android.app.Activity;
3+
import android.content.Intent;
4+
import android.net.Uri;
5+
import com.google.appinventor.components.annotations.androidmanifest.*;
6+
import com.google.appinventor.components.runtime.*;
7+
import com.google.appinventor.components.annotations.*;
8+
import com.google.appinventor.components.common.ComponentCategory;
9+
@DesignerComponent(version = 1,
10+
versionName = "1.2",
11+
description ="Helper class of CustomWebView extension to add app to browsers list<br> Developed by Sunny Gupta",
12+
category = ComponentCategory.EXTENSION,
13+
nonVisible = true,
14+
iconName = "https://res.cloudinary.com/andromedaviewflyvipul/image/upload/c_scale,h_20,w_20/v1571472765/ktvu4bapylsvnykoyhdm.png",
15+
helpUrl="https://github.com/vknow360/CustomWebView",
16+
androidMinSdk = 21)
17+
@UsesActivities(activities = {@ActivityElement(intentFilters = {@IntentFilterElement(actionElements = {@ActionElement(name = "android.intent.action.VIEW")}, categoryElements = {@CategoryElement(name = "android.intent.category.DEFAULT"), @CategoryElement(name = "android.intent.category.BROWSABLE")}, dataElements = {@DataElement(scheme = "http"), @DataElement(scheme = "https")}), @IntentFilterElement(actionElements = {@ActionElement(name = "android.intent.action.VIEW")}, categoryElements = {@CategoryElement(name = "android.intent.category.DEFAULT"), @CategoryElement(name = "android.intent.category.BROWSABLE")}, dataElements = {@DataElement(scheme = "http"), @DataElement(scheme = "https"), @DataElement(mimeType = "text/html"), @DataElement(mimeType = "text/plain"), @DataElement(mimeType = "application/xhtml+xml")})},exported="true",name=".Screen1",launchMode = "singleTop")})
18+
@SimpleObject(external=true)
19+
public class BrowserPromptHelper extends AndroidNonvisibleComponent implements OnNewIntentListener {
20+
public Activity activity;
21+
public BrowserPromptHelper(ComponentContainer container){
22+
super(container.$form());
23+
activity = container.$context();
24+
form.registerForOnNewIntent(this);
25+
}
26+
public String getUrl(Intent intent){
27+
Uri uri = intent.getData();
28+
if (uri != null && uri.toString() != null){
29+
return uri.toString();
30+
}
31+
return "";
32+
}
33+
@SimpleFunction(description = "Returns the url which started the current activity")
34+
public String GetStartUrl(){
35+
return getUrl(activity.getIntent());
36+
}
37+
38+
@SimpleEvent(description = "Event raised when app gets resumed and gives the url which started this activity/screen if there is any else empty string")
39+
public void OnResume(String url){
40+
EventDispatcher.dispatchEvent(this,"OnResume",url);
41+
}
42+
43+
@Override
44+
public void onNewIntent(Intent intent) {
45+
OnResume(getUrl(intent));
46+
}
47+
}

0 commit comments

Comments
 (0)