cleanup Activity

This commit is contained in:
Alexander Mahr 2025-02-16 12:33:30 +01:00
parent 6823e67e1a
commit 30c751bd0e

View file

@ -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);
@ -87,27 +89,12 @@ 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);
}