0

I have an EditText and when clicked a numberpad slides up via android:inputType="number". When this happens though it pushes the TextViews above off of the screen. I was wondering if there was a way for the numberpad to always be shown (then I can have fixed positions for everything)?

(I do not have a lot on the activity, so it is not like I am trying to save space.) I want the user to be able to see the TextViews that get pushed off the screen because they are updated based on the input. Here is what it looks like:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Name" >

// TextViews that get pushed off

<EditText
    android:id="@+id/editText"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_marginBottom="71dp"
    android:layout_toLeftOf="@+id/enter_input"
    android:ems="10"
    android:inputType="number" >

    <requestFocus />
</EditText>

</RelativeLayout>

Is this possible? Or is there a better way so everything is shown on the screen and so nothing is hidden?

lord_sneed
  • 794
  • 3
  • 12
  • 25
  • Have you tried adding `android:windowSoftInputMode="adjustPan"` to the AndroidManifest? Based on [this](http://stackoverflow.com/questions/4114132/android-soft-keyboard-pushes-layout-of-my-activity-out-of-screen) SO question. – A--C Dec 16 '12 at 21:02
  • Oops, my bad. I used the wrong keywords to search. I call it a numberpad and not a softkeyboard. I will try it now. Give me a minute. – lord_sneed Dec 16 '12 at 21:07
  • That still pushes the TextView off of the screen. – lord_sneed Dec 16 '12 at 21:09

1 Answers1

1

You can add android:windowSoftInputMode="stateAlwaysVisible" to your activity in AndroidManifest.xml so it forces the keyboard to always show.

<activity android:name="[activity_path]" android:windowSoftInputMode="stateAlwaysVisible"/>
alexghr
  • 96
  • 2
  • This pretty much has the behavior I am looking for. Out of curiosity though, is it possible for it to not do it's sliding animation when the activity first starts up? Currently the activity starts up, shows the elements, then the softkey pad appears and slides up. Is there a way for it to just be there without all of that? – lord_sneed Dec 16 '12 at 21:25
  • That is the keyboards animation and I don't think it can be overridden. – alexghr Dec 16 '12 at 21:56
  • Why don't you put everything in a ScrollView? – alexghr Dec 17 '12 at 07:04
  • I want everything to remain on the screen. I want the user to be able to see everything while typing without having to scroll up and down all the time. – lord_sneed Dec 17 '12 at 18:55