From 30c751bd0efb826a65e23a7982dd4f36fc969245 Mon Sep 17 00:00:00 2001 From: Alexander Mahr Date: Sun, 16 Feb 2025 12:33:30 +0100 Subject: [PATCH] cleanup Activity --- app/src/calender/app/AppActivity.java | 37 +++++++++------------------ 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/app/src/calender/app/AppActivity.java b/app/src/calender/app/AppActivity.java index be931cb..e0b6859 100644 --- a/app/src/calender/app/AppActivity.java +++ b/app/src/calender/app/AppActivity.java @@ -49,11 +49,13 @@ public class AppActivity extends Activity { // this removes the title bar (a ~1cm big strip at the top of the app showing its name this.requestWindowFeature(Window.FEATURE_NO_TITLE); // we create the webview (at least on the android 14 that is a webview that features avif + websockets etc....) + // determin why the checking of this did not work // int PERMISSION_GRANTED=0; // if( checkSelfPermission( Manifest.permission.POST_NOTIFICATIONS) == PERMISSION_GRANTED) // { + try { requestPermissions( new String[] {Manifest.permission.POST_NOTIFICATIONS},1); -// } + } catch (Exception e) { } ; WebView myWebView = new WebView(this);//activityContext); // MyJavascriptInterface myJavaScriptInterface = new MyJavascriptInterface(this,myWebView); // we create a webview (there is also setwebviewclient-vs-setwebchromeclient @@ -63,11 +65,11 @@ public class AppActivity extends Activity { myWebView.setWebChromeClient(myWebChromeClient); setupNotificationChannelShit(); - // bitmap = Bitmap.createBitmap(16, 16, Bitmap.Config.ARGB_8888); // to setup settings WebSettings myWebSettings = myWebView.getSettings(); + // enable/disable debugging myWebView.setWebContentsDebuggingEnabled(true); myWebSettings.setBuiltInZoomControls(true); myWebSettings.setDisplayZoomControls(false); @@ -86,29 +88,14 @@ public class AppActivity extends Activity { } public void setupNotificationChannelShit(){ - NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); - - // The id of the channel. - String id = "my_channel_01"; - - - - int importance = NotificationManager.IMPORTANCE_LOW; - - NotificationChannel mChannel = new NotificationChannel(id, "calender app channel",importance); - - // Configure the notification channel. - mChannel.setDescription("description"); - - mChannel.enableLights(true); - // Sets the notification light color for notifications posted to this - // channel, if the device supports this feature. - mChannel.setLightColor(Color.RED); - - mChannel.enableVibration(true); - mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); - - mNotificationManager.createNotificationChannel(mChannel); + NotificationManager mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); + String id = "my_channel_01"; + int importance = NotificationManager.IMPORTANCE_LOW; + NotificationChannel mChannel = new NotificationChannel(id, "calender app channel",importance); + mChannel.setDescription("description"); + mChannel.enableVibration(true); + mChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400}); + mNotificationManager.createNotificationChannel(mChannel); }