Skip to content

Commit

Permalink
Merge pull request #23 from vknow360/beta
Browse files Browse the repository at this point in the history
Merge beta branch
  • Loading branch information
vknow360 authored Mar 9, 2023
2 parents 0523448 + c8f0abd commit 9dc3dfd
Show file tree
Hide file tree
Showing 7 changed files with 2,096 additions and 1,779 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://paypal.me/maaayur
custom: https://paypal.me/PremwatiGupta?country.x=IN&locale.x=en_GB
Binary file removed aix/com.sunny.CustomWebView-Kodular.aix
Binary file not shown.
Binary file modified aix/com.sunny.CustomWebView.aix
Binary file not shown.
94 changes: 47 additions & 47 deletions com/sunny/CustomWebView/BrowserPromptHelper.java
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
package com.sunny.CustomWebView;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import com.google.appinventor.components.annotations.androidmanifest.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.common.ComponentCategory;
@DesignerComponent(version = 1,
versionName = "1.2",
description ="Helper class of CustomWebView extension to add app to browsers list<br> Developed by Sunny Gupta",
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = "https://res.cloudinary.com/andromedaviewflyvipul/image/upload/c_scale,h_20,w_20/v1571472765/ktvu4bapylsvnykoyhdm.png",
helpUrl="https://github.com/vknow360/CustomWebView",
androidMinSdk = 21)
@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")})
@SimpleObject(external=true)
public class BrowserPromptHelper extends AndroidNonvisibleComponent implements OnNewIntentListener {
public Activity activity;
public BrowserPromptHelper(ComponentContainer container){
super(container.$form());
activity = container.$context();
form.registerForOnNewIntent(this);
}
public String getUrl(Intent intent){
Uri uri = intent.getData();
if (uri != null && uri.toString() != null){
return uri.toString();
}
return "";
}
@SimpleFunction(description = "Returns the url which started the current activity")
public String GetStartUrl(){
return getUrl(activity.getIntent());
}

@SimpleEvent(description = "Event raised when app gets resumed and gives the url which started this activity/screen if there is any else empty string")
public void OnResume(String url){
EventDispatcher.dispatchEvent(this,"OnResume",url);
}

@Override
public void onNewIntent(Intent intent) {
OnResume(getUrl(intent));
}
}
package com.sunny.CustomWebView;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import com.google.appinventor.components.annotations.androidmanifest.*;
import com.google.appinventor.components.runtime.*;
import com.google.appinventor.components.annotations.*;
import com.google.appinventor.components.common.ComponentCategory;
@DesignerComponent(version = 1,
versionName = "1.2",
description ="Helper class of CustomWebView extension to add app to browsers list<br> Developed by Sunny Gupta",
category = ComponentCategory.EXTENSION,
nonVisible = true,
iconName = "https://res.cloudinary.com/andromedaviewflyvipul/image/upload/c_scale,h_20,w_20/v1571472765/ktvu4bapylsvnykoyhdm.png",
helpUrl="https://github.com/vknow360/CustomWebView",
androidMinSdk = 21)
@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")})
@SimpleObject(external=true)
public class BrowserPromptHelper extends AndroidNonvisibleComponent implements OnNewIntentListener {
public Activity activity;
public BrowserPromptHelper(ComponentContainer container){
super(container.$form());
activity = container.$context();
form.registerForOnNewIntent(this);
}
public String getUrl(Intent intent){
Uri uri = intent.getData();
if (uri != null && uri.toString() != null){
return uri.toString();
}
return "";
}
@SimpleFunction(description = "Returns the url which started the current activity")
public String GetStartUrl(){
return getUrl(activity.getIntent());
}

@SimpleEvent(description = "Event raised when app gets resumed and gives the url which started this activity/screen if there is any else empty string")
public void OnResume(String url){
EventDispatcher.dispatchEvent(this,"OnResume",url);
}

@Override
public void onNewIntent(Intent intent) {
OnResume(getUrl(intent));
}
}
Loading

0 comments on commit 9dc3dfd

Please sign in to comment.