Skip to content

Commit

Permalink
Add the ability to change the gravity of the query input view
Browse files Browse the repository at this point in the history
  • Loading branch information
mars885 committed Mar 9, 2019
1 parent bb3f0be commit 27a9b24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1877,6 +1877,16 @@ public final void setQueryInputTextColor(@ColorInt int textColor) {
}


/**
* Sets the gravity of the query input view.
*
* @param gravity The gravity to set
*/
public final void setQueryInputGravity(int gravity) {
mInputEt.setGravity(gravity);
}




/**
Expand Down
2 changes: 2 additions & 0 deletions sample/src/main/java/com/paulrybitskyi/sample/DemoActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import android.view.animation.LinearInterpolator
Expand Down Expand Up @@ -98,6 +99,7 @@ class DemoActivity : AppCompatActivity(), View.OnClickListener {
setVoiceInputButtonEnabled(true)
setClearInputButtonEnabled(true)
setSuggestionsDisabled(mMode == DemoModes.WITHOUT_SUGGESTIONS)
setQueryInputGravity(Gravity.START or Gravity.CENTER)
}
}

Expand Down

0 comments on commit 27a9b24

Please sign in to comment.