How to make linearLayout scroll without putting it inside scrollview - scrollview

I have a linearlayout containing
textView
imageView
Horizontal recyclerview
TextView
Horizontal Recyclerview
Webview
How to make it scrollable without putting it inside scrollview?

According to the android developers site, it is recommended not to have RecyclerView / ListView in the ScrollView.
Never add a RecyclerView or ListView to a scroll view. Doing so
results in poor user interface performance and a poor user experience.
For reference
https://developer.android.com/reference/android/widget/ScrollView
Also, use of NestedScrollView is advised.

Make Linearlayout scrollable without using Scrollview
If you are only using a listview inside a linear layout, then you don't need to use scrollview.Because ListView is scrollable by default.But if you have other components as well then you can separate those in another scrollview.Make sure that ScrollView only uses one direct child layout. Below is a sample code.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="#ffffff">
<ListView
android:id="#android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="#b5b5b5"
android:dividerHeight="1dp"
android:cacheColorHint="#00000000"/>
</LinearLayout>

You can't. Linear layouts are not designed to have their contents scrollable - only by embedding it inside a FrameLayout (or a ScrollView, which is a subclass) you can scroll/pan. Why isn't ScrollView an option?
btw, horizontal scroll containers inside vertical scroll containers don't give a good UI/UX, but there are other ways to achieve what you're after. Please give us more details and I'm sure we'll be able to help you

Related

Scroll through the contents of a RecyclerView using an outer ScrollView

I have a RecyclerView located at the bottom of the inside of a vertical ScrollView. Now each RecyclerView item has an OnClickListener which "expands" the item's layout so that more details are shown. Now i noticed that when i have multiple item layouts expanded and i try to scroll up and down, logically the scroll is happening inside of the RecyclerView first thus :
Scrolling at a lower speed than it would be if it was scrolling outside of the RecyclerView and inside of the ScrollView
When you scroll upwards , the scrolling comes at a stop as you reach the top of the RecyclerView and then you need to scroll again to scroll through the rest of the ScrollView layout.
Furthermore, since the bottom part of the whole layout is occupied by the RecyclerView, in order to scroll upwards within the parent scrollview, you need to scroll to the top of the RecyclerView first, hit the top (where the indicator lights up) and then scroll upwards again.
Is there any way that i can use the outer ScrollView to scroll through the RecyclerView items and their expanded layouts? Can i scroll through the main layout when i'm scrolling from within the recyclerview?
A NestedScrollView should be used instead of ScrollView, that is if you want to stick with scroll views in general.
This approach is also explained here.
Or you can replace the entire scroll view with a large RecyclerView. It can be vanilla or with Epoxy.

Animations on Splash-Screen

How to add the animations on the Splash-Screen in react-native. I have an ImageView on the Splash-Screen. I want to add the pulse effect on the ImageView or any other animations. I don't find any solution. please help me to do this. thanks in Advance.
code -
<ProgressBar
android:id="#+id/progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_alignParentTop="true"
android:indeterminate="true"
android:theme="#style/progress"
/>
<ImageView
android:id="#+id/splashlogo"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:src="#mipmap/myihalogo" />
Try using react-native-lottie for your animations in Splashscreen. Ive achieved that and it renders quite beautifully. Basically a JSON file which is the animations and that needs to be rendered.
Hope it helps. Feel free for doubts.
At first, I have searched many articles about changing ios's LaunchScreen.storyboard with lottie animation. However, Xcode enforces that LaunchScreen.storyboard should be static screen. So, I inserted animation code after static launch screen loading. Maybe, launch screen is essential, because it is loading screen for initial loading resource in ios. If you remove the launch screen, then ios app shows black or white screen at first loading.
Remove launch screen, Xcode 7
If you looking for animation launch screen in react native, i would suggest looking into this package.
https://www.npmjs.com/package/react-native-lottie-splash-screen
It implements animation splash screen using airbnb lottie files. Also, I apply this for multiple react native projects and it worked well.
Have a nice day!

RecyclerView within NestedScrollView issue

I add a RecyclerView inside a NestedScrollView and recycler view has multiple Textinputlayout. Scrollview jumps when keyboard comes up and goes down. I have tried adjustPan and adjustResize in AndroidManifest and android:nestedScrollingEnabled="false" in xml but nothing works. Please help me to resolve this issue

Curved scrollbar in ScrollView on Android Wear 2.0

Is it possible to have a curved scrollbar like on WearableRecyclerView on ScrollView? How is it done?
Here is a reference to get you started.
To create a curved layout for scrollable items in your wearable app:
Use WearableRecyclerView as your main container in the relevant XML layout.
Set the setEdgeItemsCenteringEnabled(boolean) method to true. This will align the first and last items on the list vertically
centered on the screen.
Use the WearableRecyclerView.setLayoutManager() method to set layout of the items on the screen.
If you explore the document, you will be able to get in touch with the code snippet for customization of the scrolling.
For Circular Scrolling Gesture:
By default, circular scrolling is disabled in the
WearableRecyclerView. If you want to enable a circular
scrolling gesture in your child view, use the WearableRecyclerView’s
setCircularScrollingGestureEnabled() method.

How do I make a RecyclerView horizontal scroll to have page boundaries similar to ViewPager

I am having trouble with this. I've been trying to use RecyclerView to have a page boundaries like ViewPager but prove to be difficult to do. Is there a way to overcome this problem?