Поправил клавиатуру на экране покупки.
This commit is contained in:
@@ -154,6 +154,7 @@ public class ScannerActivity extends AppCompatActivity implements
|
||||
|
||||
private void initSwitchButton() {
|
||||
mButton = findViewById(R.id.cardPhoneButton);
|
||||
mButton.setOnClickListener(this);
|
||||
resetSearchType(SearchType.CARD, R.drawable.ic_card, "enter_manual");
|
||||
}
|
||||
|
||||
|
||||
@@ -64,14 +64,17 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
String bonus = '';
|
||||
List<Map> coupons = [];
|
||||
ListView listView;
|
||||
TextField bonusTextField;
|
||||
|
||||
@override
|
||||
Widget getScreenContent() {
|
||||
List<Widget> widgetList = [];
|
||||
|
||||
widgetList.add(getValueWithDescription(
|
||||
StringsLocalization.buyer(),
|
||||
user['first_name'] == null ? '' : user['first_name']
|
||||
));
|
||||
|
||||
widgetList.add(getValueWithDescription(StringsLocalization.card(), card));
|
||||
|
||||
if (app != 'crypto') {
|
||||
@@ -123,12 +126,16 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
)
|
||||
));
|
||||
|
||||
if (this.coupons.length == 0) {
|
||||
widgetList.add(new Container(height: 50.0,));
|
||||
}
|
||||
|
||||
listView = new ListView(children: widgetList, controller: scrollController);
|
||||
return listView;
|
||||
}
|
||||
|
||||
getBonusInputField() {
|
||||
var bonusTextField = new TextField(
|
||||
bonusTextField = new TextField(
|
||||
keyboardType: TextInputType.number,
|
||||
decoration: new InputDecoration.collapsed(
|
||||
hintText: (app != 'crypto') ? StringsLocalization.bonusHint() : StringsLocalization.joysHint(),
|
||||
@@ -448,6 +455,8 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
// TODO: Удалить дублирующийся код.
|
||||
void buildFocusNode() {
|
||||
|
||||
var pos = this.coupons.length > 0 ? 150.0 : 100.0;
|
||||
|
||||
sumFocusNode.addListener(() {
|
||||
setState(() {
|
||||
|
||||
@@ -456,7 +465,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
}
|
||||
|
||||
if (sumFocusNode.hasFocus) {
|
||||
scrollController.animateTo(150.0, duration: new Duration(seconds: 1), curve: Curves.ease);
|
||||
scrollController.animateTo(pos, duration: new Duration(seconds: 1), curve: Curves.ease);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -470,7 +479,7 @@ class PurchaseScreenState<T> extends BaseState<PurchaseScreen> {
|
||||
}
|
||||
|
||||
if (bonusFocusNode.hasFocus) {
|
||||
scrollController.animateTo(150.0, duration: new Duration(seconds: 1), curve: Curves.ease);
|
||||
scrollController.animateTo(pos, duration: new Duration(seconds: 1), curve: Curves.ease);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user