android-coordinatorlayout

How to put admob banner to bottom of the screen using CoordinatorLayout

跟風遠走 提交于 2019-12-03 16:16:06
I use CoordinatorLayout to make sliding tabs in activity_main.xml file. I want to put admob banner to bottom of the screen. But I have a problem, When I try to code below(activity_main.xml) Admob banner is shown of the top of the screen not bottom of the screen. In fact, I think this admob is shown bottom of the Toolbar(Seen in the picture). But I want to show bottom of the whole screen <android.support.design.widget.CoordinatorLayout 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

android setAlpha on imageView into CollapsingToolbarLayout does not work

谁都会走 提交于 2019-12-03 15:24:58
inside of CollapsingToolbarLayout imageview and i need setAlpha(float) When that scroll up and down: this is method for get Offset and calculate float by offset: AppBarLayout.OnOffsetChangedListener: @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { float offsetAlpha = (float) (verticalOffset / appBarLayout.getTotalScrollRange()); imageView.setAlpha(offsetAlpha); } xml layout: <android.support.design.widget.CollapsingToolbarLayout android:id="@+id/collapsingToolbarLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android

Detecting when AppBarLayout/CollapsingToolbarLayout is completely expanded

只愿长相守 提交于 2019-12-03 15:20:21
问题 I have a fragment that uses the new CoordinatorLayout/AppBarLayout/CollapsingToolbarLayout paradigm, and I'd like to be able to detect when the collapsing toolbar is fully expanded so that I can perform an operation on the entire fragment it's in, e.g. popping the fragment off the stack and going to a new one, dismissing the fragment. I have the dismissing code working, I just need to know when and when not to use it. I've experimented a bit with AppBarLayout.OnOffsetChangedListener, but didn

onNestedScroll called only once

こ雲淡風輕ζ 提交于 2019-12-03 14:52:56
I have a class public class ScrollAwareFABBehavior extends FloatingActionButton.Behavior { public ScrollAwareFABBehavior(Context context, AttributeSet attrs) { super(); } public ScrollAwareFABBehavior() { super(); } @Override public boolean onStartNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,final View directTargetChild, final View target, final int nestedScrollAxes) { return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL; } @Override public void onNestedScroll(final CoordinatorLayout coordinatorLayout, final FloatingActionButton child,final

Customizing Persistent Bottom Sheet STATE_EXPANDED height or offset

泄露秘密 提交于 2019-12-03 14:47:01
问题 Like the titles said, is there anyway to customize the size/height/offset of the official bottomSheet (Support library 23.x.x) when it is in STATE_EXPANDED state? There is a class BottomSheetBehavior but I can't find anything about height or offset. What I want is get a similar behavior like Google Maps: 回答1: After digging on Android code and searching I got it: You can do it modifying default BottomSheetBehavior adding one more stat with following steps: Create a Java class and extend it

AdView and FloatingActionButton overlap while using CoordinatorLayout

ε祈祈猫儿з 提交于 2019-12-03 12:13:34
问题 After incorporating the new CoordinatorLayout in one of my layouts, I have an issue with Adview s overlapping with FloatingActionButton . <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width=

CoordinatorLayout leaves empty space at the bottom after scrolling

╄→尐↘猪︶ㄣ 提交于 2019-12-03 11:11:17
问题 I am trying to implement Google's newest design tricks with CoordinatorLayout and have problems with scrolling and parallax effect. After Activity is displayed, everything looks ok but the problem occurs when I try to scroll. It seems the bottom View is not expanded correctly and after it's scrolled up, empty space appears below. Bottom View seems to be big only how much it has on initial display between top View and nav bar. It looks something like this: Relevant code: <FrameLayout xmlns

Panning google map in CoordinatorLayout causes recyclerview to scroll in android design support library 23.0.1

时间秒杀一切 提交于 2019-12-03 09:08:09
问题 The map is in a collapsingToolbarLayout which is nested in an appBarLayout. In versions 22.2.0 and 22.2.1 of the android design support library, I could pan around the map independently of the coordinatorLayout but in 23.0.1, if i try to pan across the map in the north/south axis, it causes the recyclerview to scroll up/down. Is this a bug or is there a way to pass the touch events from the appBarLayout to the mapFragment? <android.support.design.widget.AppBarLayout android:id="@+id/app_bar

CoordinatorLayout children are not fullscreen

↘锁芯ラ 提交于 2019-12-03 08:12:51
I have an Activity which is displayed fullscreen. This works perfectly with many layouts I have tried, except for when the CoordinatorLayout is the root ViewGroup . The CoordinatorLayout itself has both width and height set to match_parent and it takes the whole screen as it should. But the child views that should have the same size as the CoordinatorLayout are laid as if the navigation bar was still visible. Is there a way to make the child views resize with the CoordinatorLayout ? Obviously fitSystemWindows does not change a thing as this is probably caused by the CoordinatorLayout

How to put RecyclerView below Toolbar and above TabLayout and ViewPager also handling responses to scrolls in a custom manner?

◇◆丶佛笑我妖孽 提交于 2019-12-03 08:02:10
问题 I want to create a layout like the below image: A CoordinatorLayout which contain : CollapsingToolbarLayout( contain ImageView & Toolbar) RecyclerView TabLayout ViewPager( that each fragment of it contain a RecyclerView) I wanna responding to scroll events in this way: CollapsingToolbarLayout expand and collapse by scrolling Toolbar sticks to the top until TabLayout reach to the top After that toolbar scroll up and TabLayout stick to the top I'm having trouble with the RecyclerView between