Program: 164046
Project: 164046
Buggy source:
public WndTextInput(String title,String initialValue,int maxLength,final boolean multiLine,String posTxt,String negTxt){
  super();
  if (ShatteredPixelDungeon.landscape()) {
    offset(multiLine ? -45 : -45);
  }
 else {
    offset(multiLine ? -60 : -45);
  }
  final int width;
  if (ShatteredPixelDungeon.landscape() && multiLine) {
    width=W_LAND_MULTI;
  }
 else {
    width=WIDTH;
  }
  RenderedTextMultiline txtTitle=PixelScene.renderMultiline(title,9);
  txtTitle.maxWidth(width);
  txtTitle.hardlight(Window.TITLE_COLOR);
  txtTitle.setPos((width - txtTitle.width()) / 2,0);
  add(txtTitle);
  float pos=txtTitle.bottom() + MARGIN;
  textInput=new EditText(ShatteredPixelDungeon.instance);
  textInput.setText(initialValue);
  textInput.setTypeface(RenderedText.getFont());
  textInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)});
  textInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
  final float scaledZoom;
  scaledZoom=camera.zoom * (Game.dispWidth / (float)Game.width);
  final float inputHeight;
  if (multiLine) {
    textInput.setSingleLine(false);
    textInput.setTextSize(TypedValue.COMPLEX_UNIT_PX,6 * scaledZoom);
    inputHeight=9 * textInput.getLineHeight() / scaledZoom;
  }
 else {
    textInput.setSingleLine();
    textInput.setOnEditorActionListener(new EditText.OnEditorActionListener(){
      @Override public boolean onEditorAction(      TextView v,      int actionId,      KeyEvent event){
        onSelect(true);
        hide();
        return true;
      }
    }
);
    textInput.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    textInput.setGravity(Gravity.CENTER);
    textInput.setTextSize(TypedValue.COMPLEX_UNIT_PX,9 * scaledZoom);
    inputHeight=2 * textInput.getLineHeight() / scaledZoom;
  }
  pos+=inputHeight + MARGIN;
  RedButton positiveBtn=new RedButton(posTxt){
    @Override protected void onClick(){
      onSelect(true);
      hide();
    }
  }
;
  if (negTxt != null)   positiveBtn.setRect(MARGIN,pos,(width - MARGIN * 3) / 2,BUTTON_HEIGHT);
 else   positiveBtn.setRect(MARGIN,pos,width - MARGIN * 2,BUTTON_HEIGHT);
  add(positiveBtn);
  if (negTxt != null) {
    RedButton negativeBtn=new RedButton(negTxt){
      @Override protected void onClick(){
        onSelect(false);
        hide();
      }
    }
;
    negativeBtn.setRect(positiveBtn.right() + MARGIN,pos,(width - MARGIN * 3) / 2,BUTTON_HEIGHT);
    add(negativeBtn);
  }
  pos+=BUTTON_HEIGHT + MARGIN;
  resize(width,(int)pos);
  final int inputTop=(int)(camera.cameraToScreen(0,txtTitle.bottom() + MARGIN).y * (Game.dispWidth / (float)Game.width));
  ShatteredPixelDungeon.instance.runOnUiThread(new Runnable(){
    @Override public void run(){
      FrameLayout.LayoutParams layout=new FrameLayout.LayoutParams((int)((width - MARGIN * 2) * scaledZoom),(int)(inputHeight * scaledZoom),Gravity.CENTER_HORIZONTAL);
      layout.setMargins(0,inputTop,0,0);
      ShatteredPixelDungeon.instance.addContentView(textInput,layout);
    }
  }
);
}

Fixed version (ground truth):
public WndTextInput(final String title,final String initialValue,final int maxLength,final boolean multiLine,final String posTxt,final String negTxt){
  super();
  if (ShatteredPixelDungeon.landscape()) {
    offset(multiLine ? -45 : -45);
  }
 else {
    offset(multiLine ? -60 : -45);
  }
  final int width;
  if (ShatteredPixelDungeon.landscape() && multiLine) {
    width=W_LAND_MULTI;
  }
 else {
    width=WIDTH;
  }
  ShatteredPixelDungeon.instance.runOnUiThread(new Runnable(){
    @Override public void run(){
      RenderedTextMultiline txtTitle=PixelScene.renderMultiline(title,9);
      txtTitle.maxWidth(width);
      txtTitle.hardlight(Window.TITLE_COLOR);
      txtTitle.setPos((width - txtTitle.width()) / 2,0);
      add(txtTitle);
      float pos=txtTitle.bottom() + MARGIN;
      textInput=new EditText(ShatteredPixelDungeon.instance);
      textInput.setText(initialValue);
      textInput.setTypeface(RenderedText.getFont());
      textInput.setFilters(new InputFilter[]{new InputFilter.LengthFilter(maxLength)});
      textInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
      final float scaledZoom;
      scaledZoom=camera.zoom * (Game.dispWidth / (float)Game.width);
      final float inputHeight;
      if (multiLine) {
        textInput.setSingleLine(false);
        textInput.setTextSize(TypedValue.COMPLEX_UNIT_PX,6 * scaledZoom);
        inputHeight=9 * textInput.getLineHeight() / scaledZoom;
      }
 else {
        textInput.setSingleLine();
        textInput.setOnEditorActionListener(new EditText.OnEditorActionListener(){
          @Override public boolean onEditorAction(          TextView v,          int actionId,          KeyEvent event){
            onSelect(true);
            hide();
            return true;
          }
        }
);
        textInput.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
        textInput.setGravity(Gravity.CENTER);
        textInput.setTextSize(TypedValue.COMPLEX_UNIT_PX,9 * scaledZoom);
        inputHeight=2 * textInput.getLineHeight() / scaledZoom;
      }
      pos+=inputHeight + MARGIN;
      RedButton positiveBtn=new RedButton(posTxt){
        @Override protected void onClick(){
          onSelect(true);
          hide();
        }
      }
;
      if (negTxt != null)       positiveBtn.setRect(MARGIN,pos,(width - MARGIN * 3) / 2,BUTTON_HEIGHT);
 else       positiveBtn.setRect(MARGIN,pos,width - MARGIN * 2,BUTTON_HEIGHT);
      add(positiveBtn);
      if (negTxt != null) {
        RedButton negativeBtn=new RedButton(negTxt){
          @Override protected void onClick(){
            onSelect(false);
            hide();
          }
        }
;
        negativeBtn.setRect(positiveBtn.right() + MARGIN,pos,(width - MARGIN * 3) / 2,BUTTON_HEIGHT);
        add(negativeBtn);
      }
      pos+=BUTTON_HEIGHT + MARGIN;
      resize(width,(int)pos);
      final int inputTop=(int)(camera.cameraToScreen(0,txtTitle.bottom() + MARGIN).y * (Game.dispWidth / (float)Game.width));
      FrameLayout.LayoutParams layout=new FrameLayout.LayoutParams((int)((width - MARGIN * 2) * scaledZoom),(int)(inputHeight * scaledZoom),Gravity.CENTER_HORIZONTAL);
      layout.setMargins(0,inputTop,0,0);
      ShatteredPixelDungeon.instance.addContentView(textInput,layout);
    }
  }
);
}