Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Fixed size of documentation popup
Browse files Browse the repository at this point in the history
Closes #1341
  • Loading branch information
M66B committed Feb 15, 2014
1 parent 8151c2a commit 1fd6026
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Changelog

**Next release**

* Fixed size of documentation popup ([issue](/../../issues/1341))
* Added restriction for connecting to the internet (experimental)
* Added restriction for *system/getPreferredActivities*
* Added documentation for sensors, overlay, system and view thanks @[jpeg729](https://github.com/jpeg729) ([issue](/../../issues/838))
Expand Down
4 changes: 2 additions & 2 deletions res/layout/popup.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
Expand All @@ -9,7 +9,7 @@
android:paddingTop="@dimen/activity_vertical_margin" >

<LinearLayout
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/background_tutorial"
android:orientation="vertical" >
Expand Down
6 changes: 4 additions & 2 deletions src/biz/bokhorst/xprivacy/ActivityApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -1257,9 +1257,11 @@ public void onClick(View view) {
tvInfo.setText(Html.fromHtml(text));
tvInfo.setMovementMethod(LinkMovementMethod.getInstance());

View parent = ActivityApp.this.findViewById(android.R.id.content);

final PopupWindow popup = new PopupWindow(layout);
popup.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
popup.setWidth(WindowManager.LayoutParams.WRAP_CONTENT);
popup.setWidth(90 * parent.getWidth() / 100);

Button btnOk = (Button) layout.findViewById(R.id.btnOk);
btnOk.setOnClickListener(new View.OnClickListener() {
Expand All @@ -1269,7 +1271,7 @@ public void onClick(View v) {
}
});

popup.showAtLocation(view, Gravity.CENTER_HORIZONTAL | Gravity.CENTER_VERTICAL, 0, 0);
popup.showAtLocation(parent, Gravity.CENTER, 0, 0);
}
});
}
Expand Down

0 comments on commit 1fd6026

Please sign in to comment.