PhysicsLayout alternatives and similar packages
Based on the "Layout Widget" category.
Alternatively, view PhysicsLayout alternatives based on common mentions on social networks and blogs.
-
SmartRefreshLayout
SmartRefreshLayout extended the thoughts of SwipeRefreshLayout,using a ViewGroup to include a list of Views, to maintain its low coupling and high versatility -
SmartTabLayout
A custom ViewPager title strip which gives continuous feedback to the user when scrolling -
FreeFlow
A layout engine for Android that decouples layouts from the View containers that manage scrolling and view recycling. FreeFlow makes it really easy to create custom layouts and beautiful transition animations as data and layouts change -
android-PullRefreshLayout
This component like SwipeRefreshLayout, it is more beautiful than SwipeRefreshLayout. -
android-flowlayout
Linear layout, that wrap its content to the next line if there is no space in the current line. -
ExpandableLayout
Implementation of ExpandableListview with custom header and custom content. -
SmoothRefreshLayout
A highly efficient refresh library for Android . In theory , Can support all Views.一个高效的Android刷新库,理论上支持所有的视图,比官方的SwipeRefreshLayout更强大且使用方便. -
Vorolay
VoronoiView is a view (ViewGroup) that allows you to add and display views inside Voronoi diagram regions. -
FlowLayout
Android implementation of FlowLayout. Layout arranges its children in multiple rows depending on their width. -
android_maskable_layout
A library that easily allows you to mask layouts/viewgroups -
NodeFlow
NodeFlow is an Android library that provides a simple way to visualize hierarchical content. -
Android-MosaicLayout-v0.1
Mosaiclayout is android layout to display group of views in more that 92 different patterns. -
android-linear-layout-manager
Implementation of LinearLayoutManager which wraps its contents. -
FabTransitionLayout
Provides the Floating Action Button Transition as specified in the Material Design Guide in a simple library. -
BeerSwipeRefresh
This project aims to provide a reusable Swipe to Refresh widget for Android. -
Android-RatioLayout
This is a specified proportion to the size of the Layout or View support library, with which you can easily set a fixed ratio of the size of the Layout or View, internal adaptive size calculation, completely abandon the code to calculate the size! If you have any questions in the course or suggestions, please send an e-mail to the following e-mail, thank you! -
Android-MaterialDeleteLayout
Maetrial Design Delete Concept Implement -
RearrangeableLayout
An android layout to re-arrange child views via dragging -
GooglePlusLayout
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page -
android-gridlayout
A backwards compatible implementation of GridLayout for Android -
PrismView
PrismView provides animations for your views, similar to Dragger, but with fragments! You can change the fragment of the PrismView any time. -
Android Accordion Swipe Layout
Accordion Swipe Layout for Android
Get performance insights in less than 4 minutes
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of PhysicsLayout or a related project?
README
PhysicsLayout
Android layout that simulates physics using JBox2D. Simply add views, enable physics, and watch them fall!
See it in action with the sample app:
Gradle Dependency
Add this in your root build.gradle
file (not your module build.gradle
file):
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
Then, add the library to your project build.gradle
dependencies {
implementation("com.github.Jawnnypoo:PhysicsLayout:latest.version.here")
}
Basic Usage
If you want to see what your layout looks like when physics is applied to it, simply change your root layout to a physics layout.
<com.jawnnypoo.physicslayout.PhysicsLinearLayout
android:id="@+id/physics_layout"
android:layout_width="match_parent"
android:layout_height="200dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello world, I have physics!"/>
</com.jawnnypoo.physicslayout.PhysicsLinearLayout>
Custom XML Attributes
You can also further customize the behaviour of your PhysicsLayout
<com.jawnnypoo.physicslayout.PhysicsLinearLayout
android:id="@+id/physics_layout"
android:layout_width="match_parent"
android:layout_height="200dp"
app:physics="true"
app:gravityX="0.0"
app:gravityY="9.8"
app:bounds="true"
app:boundsSize="50dp"/>
physics
boolean, Determines if physics will be applied to the layout (Default true)gravityX
float, Sets the gravity in the X direction (positive is right, negative is left) (Default 0)gravityY
float, Sets the gravity in the Y direction (positive is down, negative is up) (Default 9.8)bounds
boolean, Determines if the layout should have bounds on the edges of itself (Default true)boundsSize
dimenstion, Sets the width/height of the bounds on the edges (Default 20dp)
Custom Physics Configuration
Each view contained within the layout has a physics configuration that it uses to create itself in the Box2D world. This defines its shape, mass, restitutaion, and other physics related variables. A custom configuration can be applied to each view as well:
<TextView
android:id="@+id/text"
android:layout_width="20dp"
android:layout_height="20dp"
app:layout_shape="circle"
app:layout_circleRadius="20dp"
app:layout_bodyType="kinematic"
app:layout_fixedRotation="true"
app:layout_friction="0.8"
app:layout_restitution="0.3"
app:layout_density="0.5" />
or alternatively, the Physics definition can be made programmatically:
val circleView = findViewById<View>(R.id.circle)
val config = PhysicsConfig(
shape = Shape.CIRCLE,
fixtureDef = fixtureDef,
bodyDef = bodyDef
)
Physics.setPhysicsConfig(circleView, config)
This is useful especially if you have view that would be considered circular, as the default for all views is a RECTANGLE shape. Most of the time, if you are just dealing with rectangular views, the defaults will work for you and you will not have to worry about this.
Check out the sample app to see most of these things in action.
Making a Game?
This library was designed with the intention of allowing for playful animations within normal Android apps. It is not built to be a game engine or meant to compete with the likes. If you are looking to do more intense mobile games, we recommend libraries such as libGDX or Unity
License
Copyright 2020 John Carlson
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*Note that all licence references and agreements mentioned in the PhysicsLayout README section above
are relevant to that project's source code only.