relativelayout

How to show/hide grouped views in Android?

匆匆过客 提交于 2019-12-03 06:59:32
I want to create an activity such as mentioned in photo... as soon as I press the maximize button I want it to become full screen for the activity and part 1 become minimize, and again when I press the restore button I want it to become in a first state: to be able to see part 1 and part 2 ... I think if we put two layouts it is possible? Isn't it? Please refer me to a resource to help me about this, or show me the code to achieve a solution. Part one and two should be in their own layout. After, play with the visilibity property of each layout. Specifically to hide any view without it

Android 相对布局 RelativeLayout

左心房为你撑大大i 提交于 2019-12-03 05:05:00
<!-- 在main元素的上方 --> android:layout_above="@+id/main" <!-- 在main元素的下方 --> android:layout_below="@+id/main" <!-- 在main元素的左边 --> android:layout_toLeftOf="@+id/main" <!-- 在main元素的右边 --> android:layout_toRightOf="@+id/main" <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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android

Android - Two buttons in same line filling the whole width

依然范特西╮ 提交于 2019-12-03 03:52:22
I have a little problem defining a Relative Layout. I have a List View with scroll and two buttons always visible at the bottom of the list view. I just would like my two button have 50% of the width, filling the line. This is my code: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <Button android:id="@+id/testbutton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom=

How to align 8 little circles around of a centered big circle, like attached image shows?

偶尔善良 提交于 2019-12-03 03:22:31
I have to do this layout: I was trying to align the views, using RelativeLayout and layout_toRightOf, layout_below, etc, but the best that I achieved was this: Here are the xml: <?xml version="1.0" encoding="utf-8"?> <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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop=

requestLayout() improperly called by android.widget.RelativeLayout android

匿名 (未验证) 提交于 2019-12-03 03:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i have implemented listview customadapter when displaying listview it showing below warring how to reslove it . requestLayout() improperly called by android.widget.RelativeLayout{b42acc20 V.E..... ......ID 0,-52-480,0 #7f0700ec app:id/ptr_id_header} during layout: running second layout pass java code public View getView(int position, View convertView, ViewGroup parent) { View view = convertView; if (view == null) { LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = vi.inflate(R.layout

How to align 8 little circles around of a centered big circle, like attached image shows?

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have to do this layout: I was trying to align the views, using RelativeLayout and layout_toRightOf, layout_below, etc, but the best that I achieved was this: Here are the xml: <?xml version="1.0" encoding="utf-8"?> <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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="

Android Material Design profile page [closed]

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm new to android and material design. Could some one please help me point to any websites that help me build a profile screen as below as per Google's material design guidelines? 回答1: I was about to write a blog on this screen briefing about CoordinatorLayout . Anyways.. You can have my fully working code.: activity_scrolling.xml: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools=

Android - How to make an progressBar touching a bottom screen border

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want a ProgressBar that is touching a bottom border of screen but with this piece of code, I am getting an little space between bar and screen border: <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=".Whatever" > <ProgressBar android:id="@+id/progressBar1" style="?android:attr/progressBarStyleHorizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"

position view in relativelayout runtime

匿名 (未验证) 提交于 2019-12-03 02:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: i want to add a view to a relativelayout. this view must be added to a specified position. i have this: int x = ...; int y = ...; button.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { int x = (int) event.getRawX(); int y = (int) event.getRawY(); v.layout(x, y, x + v.getWidth(), y + v.getHeight()); return true; } }); relativelayout.addView(button); button.layout(x, y, x + button.getWidth(), y + button.getHeight()); the ontouchlistener works great.. the view stays with my finger. however the

android: onDraw is called constantly

匿名 (未验证) 提交于 2019-12-03 02:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem with a custom button. onDraw() gets called again and again, and I can't figure out why. public class CircleButton extends Button { static final int StateDefault = 0; static final int StateFocused = 1; static final int StatePressed = 2; @Override protected void onDraw(Canvas canvas) { Log.v("Button","onDraw()"); switch (mState) { case StateDefault: canvas.drawBitmap(this.getDefaultBitmap(), 0, 0, null); break; case StateFocused: canvas.drawBitmap(this.getFocusedBitmap(), 0, 0, null); break; case StatePressed: /*this.setWidth