Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,18 @@ protected void onDismiss() {

@Override
public void show(@ShowFlags int aShowFlags) {
show(aShowFlags);
super.show(aShowFlags);
for (int i = 0; i < mListItems.length; i++) {
mList.setItemChecked(i, mListItems[i].mChoice.selected);
}
mAdapter.notifyDataSetChanged();
}

@Override
public int getMinHeight() {
return WidgetPlacement.dpDimension(getContext(), R.dimen.prompt_min_height);
}

public void setDelegate(GeckoSession.PromptDelegate.ChoiceCallback delegate) {
mCallback = delegate;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ protected void initializeWidgetPlacement(WidgetPlacement aPlacement) {
public void show(@ShowFlags int aShowFlags) {
mLayout.measure(View.MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
mWidgetPlacement.height = (int)(mLayout.getMeasuredHeight()/mWidgetPlacement.density);
mWidgetPlacement.height = (getMinHeight() == 0) ?
(int)(mLayout.getMeasuredHeight()/mWidgetPlacement.density) :
getMinHeight();
super.show(aShowFlags);

mWidgetManager.pushWorldBrightness(this, WidgetManagerDelegate.DEFAULT_DIM_BRIGHTNESS);
Expand Down Expand Up @@ -99,4 +101,8 @@ public void onGlobalFocusChanged(View oldFocus, View newFocus) {
}
}

public int getMinHeight() {
return 0;
}

}
1 change: 1 addition & 0 deletions app/src/main/res/values/dimen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
<dimen name="prompt_content_max_height">450dp</dimen>
<dimen name="prompt_choice_min_height">300dp</dimen>
<dimen name="prompt_choice_max_height">520dp</dimen>
<dimen name="prompt_min_height">400dp</dimen>

<!-- Crash Dialog prompt -->
<dimen name="crash_dialog_width">640dp</dimen>
Expand Down