Questions tagged [android-gravity]

64 questions
0
votes
0 answers

Android - calculating device position

I'm currently in the process of creating an Android application that tracks templates using template matching, and then stores coordinates in a file. The next step is to also draw trajectories of this object. However, because the device is…
user3186023
0
votes
1 answer

Android layout gravity center horizontally

I have a problem with android:layout_gravity="center" in LinearLayout. I put text in the top and when I want to move it to the top center he moves it to the center of the phone and not to the up center.
Hanan Sabag
  • 29
  • 2
  • 8
0
votes
1 answer

Listview item text gravity

I am using Arrayadapter with android.R.layout.simple_list_item_1 child here is the getView function @NonNull @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) convertView =…
Raafat Alhmidi
  • 1,106
  • 12
  • 18
0
votes
1 answer

android How to set Gravity in RecyclerView

I'm trying to make a chat app, and having a trouble with setting gravity of custom view in the RecyclerView. I've been searching and trying a whole day, but i couldn't make, it always shows like this(ScreenShot).It should be located right of screen…
MWP
  • 35
  • 2
  • 8
0
votes
1 answer

Display notifications correctly in Android Wear

My notifications display correctly when paired with an Android Wear square device - they are just sent to the device (watch) for automatic display to keep the code simple. However, they are in the default center of the screen on Wear round watches…
ChiralCode
  • 31
  • 1
  • 6
0
votes
1 answer

Android changes "spinner text"'s gravity after selecting from "listitem"

In my scenario, when I click on the spinner the values dropdown will pop with listview text items aligned to left. Now what I wanted is after selecting from the list item when it sets to the spinner value the text item should be right…
hari86
  • 659
  • 2
  • 16
  • 28
0
votes
2 answers

Difference between Gravity.END and Gravity.RIGHT in android?

I am trying to show a dialog at the right top corner of the screen with the following line in my Activity class: dialog.getWindow().getAttributes().gravity= Gravity.RIGHT|Gravity.TOP This works fine. But when i checked the code for any…
Alvi
  • 767
  • 8
  • 20
0
votes
1 answer

How can I move the first column on the right side without using gravity property?

At the table I tried to move the red columns from the right side to the left side with the possibility of rotation. I tried using the android:gravity="right", but it did without results. How can I move the green column to the far right side and move…
0
votes
2 answers

How to attach ImageView to right border of RelativeLayout

I want to attach ImageViews to each other. I tried to set gravity and alignParentRight/alignParentLeft but can`t achieve my goal. For simplicity I have set color backgrounds for ViewGroups. Do you have any ideas how to make it done?
0
votes
1 answer

Android gravity values appended by "|" : What is the difference between, say "top|left" and "left|top"?

The android doc here and here says: "Must be one or more (separated by '|') of the following constant values." How does android process multiple gravity values like "top|center_horizontal"? Is it that it first places the object at the top and then…
A Nice Guy
  • 2,676
  • 4
  • 30
  • 54
0
votes
1 answer

How to align Relative layout in Linear layout to bottom?

I have the following Relative layout which is containing 2 button. I would like to ask how can i align Relative layout to bottom? Relative Layout has as a parent Linear layout.
redrom
  • 11,502
  • 31
  • 157
  • 264
0
votes
0 answers

How to fix the keyboard hides my custom Edit Text issue without removing the gravity set for my edit text?

I am also running into the same problem as discussed in this post. As they mentioned in the comment, this issue was reported to google. I searched over the net and I am not any finding any answer for the same. Help me to fix the keyboard hides…
0
votes
4 answers

Set gravity to two different texts in one textview Android

I need to set two texts(Text1 and Text2) in one single TextView.Following are my requirements. Text1 should be bigger than Text2 in font size. Text2 would below Text1. Both are centrally aligned. Text1 should be given gravity: center so that it…
0
votes
3 answers

Why is TextView wrapping when gravity is set to left?

I'm having an issue where my textview is wrapping a word when the gravity is set to left. I want it to just display the word without any wrapping. A visual of what I want: Currency Balance Held Value But this is what I'm getting: C …
Seslyn
  • 807
  • 10
  • 19
-2
votes
3 answers

Center ProgressBar

I want to full center a progressbar with a full height/width webview, and i'm not able to. Here is my xml code: