viewgroup

setMargins method is not working on custom ViewGroup

北城余情 提交于 2019-12-06 04:25:50
I am working on a project where my portion of work is to create a sliding layout on main screen which will partially appear at bottom when the app will start and we can scroll that layout. And then I have to add child views inside of it which will be cards. Now for that I have created a custom ViewGroup and I will add them programmatically. I have succeed in making most of the portion of the task. I have created a custom FrameLayout for sliding layout. Then I used it and added in XML. <?xml version="1.0" encoding="utf-8"?> <com.dhrumil.airhockey.OverflowView xmlns:android="http://schemas

Android: Using FEATURE_NO_TITLE with custom ViewGroup leaves space on top of the window

不问归期 提交于 2019-12-05 07:42:52
I am trying to create a custom ViewGroup, and I want to use it with a full screen application. I am using the "requestWindowFeature(Window.FEATURE_NO_TITLE)" to hide the title bar. The title bar is not showing, but it still consuming space on top of the window. The image above was generated with the following code: public class CustomLayoutTestActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); Button b = new Button(this); b.setText("Hello"); CustomLayout layout = new

Android, How to set animation listener for view group?

[亡魂溺海] 提交于 2019-12-05 05:54:41
问题 I have an image view which acts as menu. When user click it a view group (including 5 other image view) will slide from left to right. When user click on menu again view group slides from right to left. I can simulate this behavior but after sliding right to left I expect to not see view group however view group will put on its place. I tried to use LinearLayout.setVisibiliy(View.Invisible) but at that moment i couldn't see sliding right to left animation. This is my code, any suggestion

Android StackOverflowError in ViewGroup.resetResolvedTextDirection

谁说我不能喝 提交于 2019-12-05 05:27:21
I just went to android market to publish an update to my app and noticed there a few new errors reported from existing installs. While I can understand (and attempt to do something about) most of them, this one leaves me rather puzzled: java.lang.StackOverflowError at android.view.ViewGroup.resetResolvedTextDirection(ViewGroup.java:5131) at android.view.ViewGroup.resetResolvedTextDirection(ViewGroup.java:5131) at android.view.ViewGroup.resetResolvedTextDirection(ViewGroup.java:5131) at android.view.ViewGroup.resetResolvedTextDirection(ViewGroup.java:5131) at android.view.ViewGroup

how to fold view from middle in android?

你离开我真会死。 提交于 2019-12-05 05:03:43
问题 I am learning android and trying to create an effect of folding the view from middle like one in the linked video. http://vimeo.com/37254322 Can anybody give some guidance or point to the right resource. Current android allows to flip the complete view on Z axis to create a view flip effect as shown in video below. http://www.youtube.com/watch?v=a5b0EKUU3h4 Code found here for flip effect http://www.inter-fuser.com/2009/08/android-animations-3d-flip.html But the effect in first video folds it

Custom ViewGroup focus handling

試著忘記壹切 提交于 2019-12-04 22:35:41
Let's say I have a custom ViewGroup which is focusable and has some child views which are focusable as well (A custom vertical menu for Android set-top-boxes which should react on remote controller). I need to pass a focus to some of the child views whenever the custom ViewGroup gains the focus. I set descendantFocusability to beforeDescendants and set OnFocusChangeListener to the custom ViewGroup but OnFocusChangeListener.onFocusChanged() is never called. It looks like beforeDescendants does not work as I expected. Actually setting the beforeDescendants works the same as setting the

Android — Hiding Views

∥☆過路亽.° 提交于 2019-12-04 14:32:12
Okay, so I've done some looking around and I see how you are SUPPOSED to do it, but for me, it is just not working. I need to be able to set the alpha of a RelativeLayout both in XML and in code. For my XML, I have the following <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/player_controls" android:layout_height="match_parent" android:layout_width="match_parent" android:alpha="0.0"> <RelativeLayout android:layout_height="match_parent" android:layout_width="match_parent" android:id="@+id/player_controls_touch

How to create custom gridview (Like matrix structure ) in Android

筅森魡賤 提交于 2019-12-04 12:09:21
I want to create a matrix like gridview say 10x20 matrix we want to specify the number of rows and column of the View ie 10x20 if the screen is low it should scroll to horizontally and vertically for example the image below describe the Matrix Gridview Each cell represent (0,0) (0,1) etc... (1,0) (1,1) etc.. How can generate this type of view? Advance Thanks ....!!! try this: GridViewCustomAdapter import java.util.ArrayList; import android.app.Activity; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android

Android, How to set animation listener for view group?

断了今生、忘了曾经 提交于 2019-12-03 22:17:17
I have an image view which acts as menu. When user click it a view group (including 5 other image view) will slide from left to right. When user click on menu again view group slides from right to left. I can simulate this behavior but after sliding right to left I expect to not see view group however view group will put on its place. I tried to use LinearLayout.setVisibiliy(View.Invisible) but at that moment i couldn't see sliding right to left animation. This is my code, any suggestion would be appreciated. menu_open.xml <layoutAnimation xmlns:android="http://schemas.android.com/apk/res

Using <include> with <merge> in ConstraintLayout

大城市里の小女人 提交于 2019-12-03 04:48:16
问题 I am having trouble using tags <include> and <merge> inside a ConstraintLayout. I want to create a flat view hierarchy (hence Constraints) but still have elements that are reusable. So I use <include> in my layout and <merge> in the included layouts to avoid having nested layouts (especially avoiding nested ConstraintLayouts) So I wrote this: Parent layout <android.support.constraint.ConstraintLayout android:layout_width="match_parent" android:layout_height="match_parent"> <include android:id