mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 807606 - Add some padding to the inputs in the PromptService and wrap them in a Scrollview. r=wesj
This commit is contained in:
parent
0433e6c111
commit
0872349970
@ -38,6 +38,7 @@ import android.widget.DatePicker;
|
|||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.ScrollView;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.TimePicker;
|
import android.widget.TimePicker;
|
||||||
@ -64,6 +65,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
|||||||
private final int mTopBottomTextWithIconPadding;
|
private final int mTopBottomTextWithIconPadding;
|
||||||
private final int mIconTextPadding;
|
private final int mIconTextPadding;
|
||||||
private final int mIconSize;
|
private final int mIconSize;
|
||||||
|
private final int mInputPaddingSize;
|
||||||
|
|
||||||
PromptService() {
|
PromptService() {
|
||||||
sInflater = LayoutInflater.from(GeckoApp.mAppContext);
|
sInflater = LayoutInflater.from(GeckoApp.mAppContext);
|
||||||
@ -74,6 +76,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
|||||||
mTopBottomTextWithIconPadding = (int) (res.getDimension(R.dimen.prompt_service_top_bottom_text_with_icon_padding));
|
mTopBottomTextWithIconPadding = (int) (res.getDimension(R.dimen.prompt_service_top_bottom_text_with_icon_padding));
|
||||||
mIconTextPadding = (int) (res.getDimension(R.dimen.prompt_service_icon_text_padding));
|
mIconTextPadding = (int) (res.getDimension(R.dimen.prompt_service_icon_text_padding));
|
||||||
mIconSize = (int) (res.getDimension(R.dimen.prompt_service_icon_size));
|
mIconSize = (int) (res.getDimension(R.dimen.prompt_service_icon_size));
|
||||||
|
mInputPaddingSize = (int) (res.getDimension(R.dimen.prompt_service_inputs_padding));
|
||||||
|
|
||||||
GeckoAppShell.getEventDispatcher().registerEventListener("Prompt:Show", this);
|
GeckoAppShell.getEventDispatcher().registerEventListener("Prompt:Show", this);
|
||||||
}
|
}
|
||||||
@ -273,6 +276,11 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
|||||||
return promptServiceResult;
|
return promptServiceResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private View applyInputStyle(View view) {
|
||||||
|
view.setPadding(mInputPaddingSize, 0, mInputPaddingSize, 0);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
|
||||||
public void show(String aTitle, String aText, PromptListItem[] aMenuList, boolean aMultipleSelection) {
|
public void show(String aTitle, String aText, PromptListItem[] aMenuList, boolean aMultipleSelection) {
|
||||||
GeckoApp.assertOnUiThread();
|
GeckoApp.assertOnUiThread();
|
||||||
|
|
||||||
@ -324,7 +332,7 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
|||||||
}
|
}
|
||||||
} else if (length == 1) {
|
} else if (length == 1) {
|
||||||
try {
|
try {
|
||||||
builder.setView(mInputs[0].getView());
|
builder.setView(applyInputStyle(mInputs[0].getView()));
|
||||||
} catch(UnsupportedOperationException ex) {
|
} catch(UnsupportedOperationException ex) {
|
||||||
// We cannot display these input widgets with this sdk version,
|
// We cannot display these input widgets with this sdk version,
|
||||||
// do not display any dialog and finish the prompt now.
|
// do not display any dialog and finish the prompt now.
|
||||||
@ -345,7 +353,9 @@ public class PromptService implements OnClickListener, OnCancelListener, OnItemC
|
|||||||
finishDialog("{\"button\": -1}");
|
finishDialog("{\"button\": -1}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
builder.setView((View)linearLayout);
|
ScrollView view = new ScrollView(GeckoApp.mAppContext);
|
||||||
|
view.addView(linearLayout);
|
||||||
|
builder.setView(applyInputStyle(view));
|
||||||
}
|
}
|
||||||
|
|
||||||
length = mButtons == null ? 0 : mButtons.length;
|
length = mButtons == null ? 0 : mButtons.length;
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
<dimen name="prompt_service_group_padding_size">32dp</dimen>
|
<dimen name="prompt_service_group_padding_size">32dp</dimen>
|
||||||
<dimen name="prompt_service_icon_size">72dp</dimen>
|
<dimen name="prompt_service_icon_size">72dp</dimen>
|
||||||
<dimen name="prompt_service_icon_text_padding">10dp</dimen>
|
<dimen name="prompt_service_icon_text_padding">10dp</dimen>
|
||||||
|
<dimen name="prompt_service_inputs_padding">16dp</dimen>
|
||||||
<dimen name="prompt_service_left_right_text_with_icon_padding">10dp</dimen>
|
<dimen name="prompt_service_left_right_text_with_icon_padding">10dp</dimen>
|
||||||
<dimen name="prompt_service_top_bottom_text_with_icon_padding">8dp</dimen>
|
<dimen name="prompt_service_top_bottom_text_with_icon_padding">8dp</dimen>
|
||||||
<dimen name="remote_tab_child_row_height">64dp</dimen>
|
<dimen name="remote_tab_child_row_height">64dp</dimen>
|
||||||
|
Loading…
Reference in New Issue
Block a user