提交 1f45e547 编写于 作者: Y Yuki Takeya

Add WeChat Pay HTML5 Support

上级 624c48bf
......@@ -12,7 +12,7 @@ Volume Control Features<br/>
Yuki Push Service<br/>
## Current Version
2.1.1-git-20190823<br/>
2.1.1-git-20190921<br/>
All-in-One Package(Depreciated): [ ![Download](https://api.bintray.com/packages/takeya-yuki-studio/maven/rubylib/images/download.svg) ](https://bintray.com/takeya-yuki-studio/maven/rubylib/_latestVersion)
AjaxLib Package: [ ![Download](https://api.bintray.com/packages/takeya-yuki-studio/maven/ajaxlib/images/download.svg) ](https://bintray.com/takeya-yuki-studio/maven/ajaxlib/_latestVersion)
......
......@@ -44,8 +44,8 @@ public class MainActivity extends Activity {
Intent srv=new Intent("AAA");
srv.setPackage(getPackageName());
startService(srv);
NotificationController.Notify(getApplicationContext(),1,R.mipmap.ic_launcher,pi,"Ticker","Title","Content",Notification.FLAG_NO_CLEAR|Notification.FLAG_AUTO_CANCEL);
NotificationController.Notify(getApplicationContext(),1,R.mipmap.ic_launcher,pi,"Ticker2","Title2","Content2",Notification.FLAG_NO_CLEAR|Notification.FLAG_AUTO_CANCEL);
NotificationController.Notify(getApplicationContext(),"APP",1,R.mipmap.ic_launcher,pi,"Ticker","Title","Content",Notification.FLAG_NO_CLEAR|Notification.FLAG_AUTO_CANCEL);
NotificationController.Notify(getApplicationContext(),"APP",1,R.mipmap.ic_launcher,pi,"Ticker2","Title2","Content2",Notification.FLAG_NO_CLEAR|Notification.FLAG_AUTO_CANCEL);
List<PermissionInfo> pis=pm.GetPermissions(getApplicationContext());
String data="";
for (PermissionInfo Pi:
......
package yuki.msg.extended;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.os.Build;
/**
* Created by Akeno on 2017/08/28.
*/
public class NotificationController {
public static void Notify(Context context,int id, int icon, PendingIntent pendingIntent,String ticker, String title, String content, int flags){
NotificationManager nm=(NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification.Builder nb=new Notification.Builder(context);
nb.setSmallIcon(icon).setContentIntent(pendingIntent).setTicker(ticker).setContentTitle(title).setContentText(content).setWhen(System.currentTimeMillis());
Notification notification=nb.build();
notification.flags=flags;
nm.notify(id,notification);
public static void Notify(Context context,String channel_id,int id, int icon, PendingIntent pendingIntent,String ticker, String title, String content, int flags){
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification.Builder nb = new Notification.Builder(context);
nb.setSmallIcon(icon).setContentIntent(pendingIntent).setTicker(ticker).setContentTitle(title).setContentText(content).setWhen(System.currentTimeMillis());
Notification notification = nb.build();
notification.flags = flags;
nm.notify(id, notification);
}
else{
String des = "101";
NotificationChannel channel = new NotificationChannel(channel_id, des, NotificationManager.IMPORTANCE_MIN);
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.createNotificationChannel(channel);
Notification notification = new Notification.Builder(context,channel_id)
.setContentTitle(title)
.setContentText(content)
.setSmallIcon(icon)
.setStyle(new Notification.MediaStyle())
.setAutoCancel((flags & Notification.FLAG_AUTO_CANCEL) == Notification.FLAG_AUTO_CANCEL)
.build();
notification.flags=flags;
nm.notify(id, notification);
}
}
}
......@@ -28,7 +28,7 @@ public abstract class YukiPushService extends Service {
public void MessagePushed(String msg){
Intent i=new Intent(Intent.ACTION_VIEW, Uri.parse("msg://msg"));
PendingIntent pi=PendingIntent.getActivity(getApplicationContext(),0,i,PendingIntent.FLAG_UPDATE_CURRENT);
NotificationController.Notify(getApplicationContext(),GetServiceID(),GetIcon(),pi,
NotificationController.Notify(getApplicationContext(),"SERV",GetServiceID(),GetIcon(),pi,
"Yuki Push Service","Yuki Push Service",msg, Notification.FLAG_NO_CLEAR|Notification.FLAG_AUTO_CANCEL);
}
......
......@@ -5,7 +5,7 @@ publish {
userOrg = 'takeya-yuki-studio' //bintray注册的用户名
groupId = 'jp.ruby.rubylib' //compile引用时的第1部分groupId
artifactId = 'packagemanager' //compile引用时的第2部分项目名
publishVersion = '2.1.0' //compile引用时的第3部分版本号
publishVersion = '2.1.1' //compile引用时的第3部分版本号
desc = 'Ruby Extended Controls - PackageManager'
website = 'https://github.com/Takeya-Yuki/RubyLib.git'
}
......
......@@ -5,7 +5,7 @@ publish {
userOrg = 'takeya-yuki-studio' //bintray注册的用户名
groupId = 'jp.ruby.rubylib' //compile引用时的第1部分groupId
artifactId = 'webviewex' //compile引用时的第2部分项目名
publishVersion = '2.1.0' //compile引用时的第3部分版本号
publishVersion = '2.1.2' //compile引用时的第3部分版本号
desc = 'Ruby Extended Controls - WebViewEx'
website = 'https://github.com/Takeya-Yuki/RubyLib.git'
}
......@@ -17,7 +17,7 @@ android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 2
versionCode 3
versionName "2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
......
......@@ -550,6 +550,9 @@ public class WebViewEx extends WebView{
externalSchemeIntent = new Intent(Intent.ACTION_SENDTO, uri);
externalSchemeIntent.setPackage("com.whatsapp");
}
else if(scheme.equals("weixin")){
externalSchemeIntent=new Intent(Intent.ACTION_VIEW,uri);
}
else {
externalSchemeIntent = null;
}
......@@ -572,6 +575,10 @@ public class WebViewEx extends WebView{
}
}
if(uri.getHost().contains("wx.tenpay.com")){
return false;
}
// route the request through the custom URL loading method
view.loadUrl(url);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册