diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index ff7bba3aa93797005a0618055bba1ba6b4baacd7..3c18f34c187419630b3f327faa44e3b23c9c634d 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/.idea/caches/gradle_models.ser b/.idea/caches/gradle_models.ser index 40b5cc298d3adf7da7285dcd11cdf9242af5f85e..3e38f7d0f2d8229a84af2a1ebe6ae4f568781ecf 100644 Binary files a/.idea/caches/gradle_models.ser and b/.idea/caches/gradle_models.ser differ diff --git a/README.md b/README.md index bccc60b6e559aa1020b4103b31b8f9b25f532731..d7074b58347c8ba578a6b85cf5f148db52ab4a23 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Volume Control Features
Yuki Push Service
## Current Version -2.1.1-git-20190823
+2.1.1-git-20190921
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) diff --git a/app/src/main/java/jp/ruby/rubylibrary/MainActivity.java b/app/src/main/java/jp/ruby/rubylibrary/MainActivity.java index cf4dafe6cc451421663434b090c8e5d097dc84cb..e6d53d1374c171f1f867d5e82ca1c241aa883fb7 100644 --- a/app/src/main/java/jp/ruby/rubylibrary/MainActivity.java +++ b/app/src/main/java/jp/ruby/rubylibrary/MainActivity.java @@ -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 pis=pm.GetPermissions(getApplicationContext()); String data=""; for (PermissionInfo Pi: diff --git a/io/src/main/java/yuki/msg/extended/NotificationController.java b/io/src/main/java/yuki/msg/extended/NotificationController.java index 38dbaf59f3406911c8ae3584e5721bc81e84e0e9..692f014ce113b8131e0ae4c8e8c55f86fedb0ac5 100644 --- a/io/src/main/java/yuki/msg/extended/NotificationController.java +++ b/io/src/main/java/yuki/msg/extended/NotificationController.java @@ -1,21 +1,40 @@ 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); + } } } diff --git a/io/src/main/java/yuki/msg/extended/YukiPushService.java b/io/src/main/java/yuki/msg/extended/YukiPushService.java index b9921c33528d100beab4bbcc0833e119effadc4e..29bec1f00513b412901a75b37f6188472d40f8c6 100644 --- a/io/src/main/java/yuki/msg/extended/YukiPushService.java +++ b/io/src/main/java/yuki/msg/extended/YukiPushService.java @@ -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); } diff --git a/pm/build.gradle b/pm/build.gradle index f343a353de17b2abb65bb01d18548339274bb879..dc18bdc515ea988d7c65e7ae1a12a67fdf1887d2 100644 --- a/pm/build.gradle +++ b/pm/build.gradle @@ -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' } diff --git a/webviewex/build.gradle b/webviewex/build.gradle index 88a2c003c087c7d10f82f6bbf1b1a687a53c50c8..39c87925b99a46d9ccafbbfcf6c83701a94f11d2 100644 --- a/webviewex/build.gradle +++ b/webviewex/build.gradle @@ -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" diff --git a/webviewex/src/main/java/yuki/control/extended/WebViewEx.java b/webviewex/src/main/java/yuki/control/extended/WebViewEx.java index fa8af071a2db647f50b9e556a717517eaafeb478..cf316b17d47ea75094b612b4748417133ef4439c 100644 --- a/webviewex/src/main/java/yuki/control/extended/WebViewEx.java +++ b/webviewex/src/main/java/yuki/control/extended/WebViewEx.java @@ -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);