From 6d0120e3c1e062592d989e3bfc7e1a8fc1414803 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 30 Aug 2014 17:07:36 +0200 Subject: [PATCH] Improved function help layout Refs #1947 --- CHANGELOG.md | 2 +- res/layout/help.xml | 20 +++++++++++++++++- src/biz/bokhorst/xprivacy/ActivityApp.java | 24 ++++++++++------------ 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 872ce3a0f..65aa93215 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ Version 3.x will be available with a [pro license](http://www.xprivacy.eu/) only **Next release** * Improved settings layout ([pull request](/../../issues/1946)) -* Show function help in a dialog ([pull request](/../../issues/1947)) +* Improved function help layout ([pull request](/../../issues/1947)) [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) diff --git a/res/layout/help.xml b/res/layout/help.xml index 73b3e78b8..836e1bd0b 100644 --- a/res/layout/help.xml +++ b/res/layout/help.xml @@ -1,5 +1,6 @@ + android:layout_marginTop="6dip" /> + + + + \ No newline at end of file diff --git a/src/biz/bokhorst/xprivacy/ActivityApp.java b/src/biz/bokhorst/xprivacy/ActivityApp.java index 3ae2d9866..b58fd2295 100644 --- a/src/biz/bokhorst/xprivacy/ActivityApp.java +++ b/src/biz/bokhorst/xprivacy/ActivityApp.java @@ -1783,25 +1783,23 @@ public static void showHelp(ActivityBase context, View parent, Hook hook) { dlgHelp.setFeatureDrawableResource(Window.FEATURE_LEFT_ICON, context.getThemed(R.attr.icon_launcher)); dlgHelp.setCancelable(true); - // Set text title + // Set title TextView tvTitle = (TextView) dlgHelp.findViewById(R.id.tvTitle); tvTitle.setText(hook.getName()); - // Set text content - String text = hook.getAnnotation(); - String[] permissions = hook.getPermissions(); - if (permissions != null && permissions.length > 0) { - text += "

" + context.getString(R.string.title_permissions) + "

"; - if (permissions[0].equals("")) - text += "-"; - else - text += TextUtils.join("
", permissions); - } - + // Set info TextView tvInfo = (TextView) dlgHelp.findViewById(R.id.tvInfo); - tvInfo.setText(Html.fromHtml(text)); + tvInfo.setText(Html.fromHtml(hook.getAnnotation())); tvInfo.setMovementMethod(LinkMovementMethod.getInstance()); + // Set permissions + String[] permissions = hook.getPermissions(); + if (permissions != null && permissions.length > 0) + if (!permissions[0].equals("")) { + TextView tvPermissions = (TextView) dlgHelp.findViewById(R.id.tvPermissions); + tvPermissions.setText(Html.fromHtml(TextUtils.join("
", permissions))); + } + dlgHelp.show(); } }