android-viewgroup

ViewGroup that wrap its children with line breaking if there is no space in the current line

 ̄綄美尐妖づ 提交于 2019-12-12 03:24:11
问题 I have tried old solutions here: Line-breaking widget layout for Android Is there a new proper way to implement this functionality? 回答1: New FlexboxLayout library by Google do this. <com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" app:flexWrap="wrap" app:alignItems="stretch" app:alignContent="stretch" > <TextView

parent.getContext within RecyclerView.Adapter's onCreateViewHolder method

依然范特西╮ 提交于 2019-12-10 14:11:46
问题 I have a custom fragment which is attached to my MainActivity. The layout file of the fragment contains the recyclerview widget. fragment_main.xml: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.RecyclerView android:id="@+id/recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars=

Measure Recyclerview before it appears

前提是你 提交于 2019-12-10 03:52:29
问题 I am currently experiencing an issue when measuring a recyclerView before it appears. I need the measuredHeight in order to start an "expand" animation. This was previously done for a gridView in the code I'm working on and I am trying to migrate it to a RecyclerView with GridLayoutManager final int widthSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED); final int heightSpec = View.MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK, View.MeasureSpec.AT_MOST); mGridView

Application throws java.lang.StackOverflowError Exception in Activity

元气小坏坏 提交于 2019-12-07 06:46:33
问题 I am working on one Android application. in my one activity i am using PullToRefreshListView. sometime i am getting java.lang.StackOverflowError Exception on my activity. i have tried to fix it and i also searched on google too but not getting perfect solution. i have two activity with same functionality with PullToRefreshListView with same data. but i am getting this Exception on only one activity. other activity is working fine. Here is my full StakeTrace. Please help me. Sorry for my poor

How can ExpandableListView's default list item press behavior be preserved when supplying a group view that contains more than just a TextView?

£可爱£侵袭症+ 提交于 2019-12-05 18:44:08
Is it possible to preserve ExpandableListView's default list item press behavior when supplying a group view that contains more than just a TextView. The behavior I'm referring to is where the item being pressed changes background color to yellow. Every time I supply a group view that contains e.g. a TextView and a Button, I lose the behavior. Another option is setting your root ViewGroup to block focus for child views. Example: <LinearLayout ... android:descendantFocusability="blocksDescendants" /> Including any view that is focusable within a custom list item layout will cause the list item

BadgeView and SlidingTabStrip clicking error

自古美人都是妖i 提交于 2019-12-05 07:48:43
问题 i am using sliding tab from: https://developer.android.com/samples/SlidingTabsBasic/src/com.example.android.common/view/SlidingTabLayout.html and BadgeView from: https://github.com/jgilfelt/android-viewbadger i just add these lines of code to SlidingTabLayout to access each tab: public SlidingTabStrip getTabStrip() { return mTabStrip; } so in fragmenta i can use below code to add badgeview to each tab: public class FragmentA extends Fragment { @Override public View onCreateView(LayoutInflater

How to fix 'android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5035)' error in android

人走茶凉 提交于 2019-12-04 14:57:37
问题 I have layout with child (NOT as root) element RelativeLayout and then i create ViewPager and insert it as child of my Relative layout, so it's like +Relative Layout (root) | +-- Relative Layout (child) | +-- -- ViewPager For now moment - all ok. But then i try add some view item to ViewPager with own layout then i got error 10-12 15:32:46.777: E/AndroidRuntime(6031): FATAL EXCEPTION: main 10-12 15:32:46.777: E/AndroidRuntime(6031): java.lang.StackOverflowError 10-12 15:32:46.777: E

How to fix 'android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5035)' error in android

我的未来我决定 提交于 2019-12-03 09:19:22
I have layout with child (NOT as root) element RelativeLayout and then i create ViewPager and insert it as child of my Relative layout, so it's like +Relative Layout (root) | +-- Relative Layout (child) | +-- -- ViewPager For now moment - all ok. But then i try add some view item to ViewPager with own layout then i got error 10-12 15:32:46.777: E/AndroidRuntime(6031): FATAL EXCEPTION: main 10-12 15:32:46.777: E/AndroidRuntime(6031): java.lang.StackOverflowError 10-12 15:32:46.777: E/AndroidRuntime(6031): at android.view.ViewGroup.jumpDrawablesToCurrentState(ViewGroup.java:5035) How do that

ViewPager: java.lang.IllegalArgumentException: pointerIndex out of range

六眼飞鱼酱① 提交于 2019-12-01 00:36:07
I am writing an code to handle touch event based on what suggested here . I am using ViewPager as an ViewGroup and ListView(I know #thisbad ) as child view of Fragment. This is what I wanted to achieve: Detect multitouch event on child view then pass touch control to parent but While passing listener event from child View to Parent view it giving following error: E/AndroidRuntime(11414): java.lang.IllegalArgumentException:pointerIndex out of range E/AndroidRuntime(11414): at android.view.MotionEvent.nativeGetAxisValue(Native Method) E/AndroidRuntime(11414): at android.view.MotionEvent.getX

Loop through all subviews of an Android view?

…衆ロ難τιáo~ 提交于 2019-11-28 04:56:11
I’m working on a game for Android. To help implement it, my idea is to create a subclass of a view. I would then insert several instances of this class as children of the main view. Each instance would handle detecting when it was pressed (via OnTouchListener). The problem I’m having now is how do I loop through all these sub-views so I can read their statuses and process them? (I.e. when they all reach a certain state something should happen). Or is there a better way to have several objects on the screen that respond to touch and whose status I can check? Romain Guy @jqpubliq Is right but if