From 27d7d21dbe2e6b8133cd1245d26dfc143f39eaa2 Mon Sep 17 00:00:00 2001
From: Gersbacher Pirmin <pg045@hdm-stuttgart.de>
Date: Fri, 11 Dec 2020 20:08:44 +0100
Subject: [PATCH] *info panel style - html formatter - bold text

---
 .../com/example/accessibilityserviceappv2/CustomButton.java | 6 ++++++
 .../accessibilityserviceappv2/MyAccessibilityServiceV2.java | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/app/src/main/java/com/example/accessibilityserviceappv2/CustomButton.java b/app/src/main/java/com/example/accessibilityserviceappv2/CustomButton.java
index 8515a8d..9271232 100644
--- a/app/src/main/java/com/example/accessibilityserviceappv2/CustomButton.java
+++ b/app/src/main/java/com/example/accessibilityserviceappv2/CustomButton.java
@@ -109,4 +109,10 @@ public class CustomButton extends androidx.appcompat.widget.AppCompatButton /*im
         return this.contentDescription;
     }
 
+    public String showInformation(){
+        String InformationString = "<b>Element Nummer:</b> " + btnCounter + "<br><b>View Text: </b>" + viewText + "<br><b>Inhaltslabel:  </b>" + contentDescription + "<br><b>Hint: </b>" + hintText;
+
+        return InformationString;
+    }
+
 }
diff --git a/app/src/main/java/com/example/accessibilityserviceappv2/MyAccessibilityServiceV2.java b/app/src/main/java/com/example/accessibilityserviceappv2/MyAccessibilityServiceV2.java
index 270bac0..5ee6dd0 100644
--- a/app/src/main/java/com/example/accessibilityserviceappv2/MyAccessibilityServiceV2.java
+++ b/app/src/main/java/com/example/accessibilityserviceappv2/MyAccessibilityServiceV2.java
@@ -3,6 +3,7 @@ package com.example.accessibilityserviceappv2;
 import android.accessibilityservice.AccessibilityService;
 import android.graphics.drawable.ShapeDrawable;
 import android.graphics.drawable.shapes.RectShape;
+import android.text.Html;
 import android.util.Log;
 import android.view.ViewGroup;
 import android.view.accessibility.AccessibilityEvent;
@@ -259,7 +260,7 @@ public class MyAccessibilityServiceV2 extends AccessibilityService {
 
         testBtn.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
-                buttonClickTextTest = testBtn.showContent();
+                buttonClickTextTest = testBtn.showInformation();
                 showFloatingWindow(buttonClickTextTest);
             }
         });
@@ -311,7 +312,7 @@ public class MyAccessibilityServiceV2 extends AccessibilityService {
 
         TextView item = (TextView) view.findViewById(R.id.textView2);
 
-        item.setText(initText);
+        item.setText(Html.fromHtml(initText));
 
         lLayout.setLayoutParams(llParameters);
 
-- 
GitLab