A very simple arc layout library for Android

Related tags

Layout ArcLayout
Overview

ArcLayout

Maven Central Android Arsenal

icon

A very simple arc layout library for Android.

Arc Layout Demo1 Arc Layout Demo2

Try out the sample application on the Play Store.

Get it on Google Play

Usage

(For a working implementation of this project see the demo/ folder.)

Add the dependency to your build.gradle.

dependencies {
    compile 'com.ogaclejapan.arclayout:library:1.1.0@aar'
}

Include the ArcLayout widget in your layout.

<com.ogaclejapan.arclayout.ArcLayout
        android:id="@id/arc_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:arc_origin="bottom"
        app:arc_color="#4D000000"
        app:arc_radius="168dp"
        app:arc_axisRadius="120dp"
        app:arc_freeAngle="false"
        app:arc_reverseAngle="false"
        >

    <Button
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:gravity="center"
        android:text="A"
        android:textColor="#FFFFFF"
        android:background="#03A9F4"
        app:arc_origin="center"
        />

    <Button
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:gravity="center"
        android:text="B"
        android:textColor="#FFFFFF"
        android:background="#00BCD4"
        app:arc_origin="center"
        />

    <Button
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:gravity="center"
        android:text="C"
        android:textColor="#FFFFFF"
        android:background="#009688"
        app:arc_origin="center"
        />

</com.ogaclejapan.arclayout.ArcLayout>

Attributes

There are several attributes you can set:

ArcLayout

attrs

attr description
arc_origin Center of the arc on layout. All of patterns that can be specified, see the demo app.
arc_color Arc Shaped color
arc_radius Radius of the layout
arc_axisRadius Radius the axis of the child views
arc_freeAngle If set to true, each child view can set the free angle, default false
arc_reverseAngle If set to true, reverse the order of the child, default false. Note: If arc_freeAngle set to true does not work

Child views in ArcLayout

attr description
arc_origin Set the origin point of arc_axisRadius as well as layout_gravity, default center
arc_angle If arc_freeAngle set to true, layout the specified angle

Apps Using ArcLayout

GIF

LICENSE

Copyright (C) 2015 ogaclejapan

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.
Comments
  • NullPointerException during Preview

    NullPointerException during Preview

    I'm getting the following NPE when Android Studio tries to render the layout in its Preview. Maybe some initialization should be done if isInEditMode.

    java.lang.NullPointerException
        at com.ogaclejapan.arclayout.ArcLayout.onMeasure(ArcLayout.java:124)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.support.v7.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:453)
        at android.view.View.measure(View.java:17547)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5535)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
        at android.view.View.measure(View.java:17547)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:875)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
        at android.view.View.measure(View.java:17547)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.measureView(RenderSessionImpl.java:640)
        at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:540)
        at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:323)
        at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
        at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:497)
        at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:485)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
        at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:485)
        at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:590)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.doRender(AndroidLayoutPreviewToolWindowManager.java:644)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager.access$1700(AndroidLayoutPreviewToolWindowManager.java:79)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7$1.run(AndroidLayoutPreviewToolWindowManager.java:586)
        at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
        at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:452)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
        at org.jetbrains.android.uipreview.AndroidLayoutPreviewToolWindowManager$7.run(AndroidLayoutPreviewToolWindowManager.java:581)
        at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
        at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
        at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
        at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
        at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
        at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
        at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
        at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:695)
    
    bug 
    opened by jush 5
  • Gradle Dependency does not work

    Gradle Dependency does not work

    Added: dependencies { ... compile 'com.ogaclejapan.arclayout:library:1.0.0@aar' } The library does not get included when synced. Looking at the demo the project was imported not added as a gradle dependency.

    question 
    opened by matthewrice345 5
  • I'm using the library in my app

    I'm using the library in my app

    Hello @ogaclejapan Im using your awesome library in my app and here is the link on google play

    https://play.google.com/store/apps/details?id=club.androidy.callcontrolfree

    and here is a small screen capture

    https://www.dropbox.com/s/hmsj1oyl8qsjkho/callcontrol.ZIP?dl=0

    you can include this in your documentation.

    Thank you very much for your effort.

    opened by EgyptianM 4
  • How to make two arcs in same view?

    How to make two arcs in same view?

    Hello friend is there any ability to make two arcs in same view? one inside the other one one in left one right and so on sorry for my poor English I don't know if I clarified it enough or not.

    question 
    opened by EgyptianM 3
  • Fixed error of ProjectScopeService

    Fixed error of ProjectScopeService

    Hi Ogaclejapan, Hope you are doing fine. Thanks for developing ArcLayout. FYI, I cloned this repository and found an error while running. The error was 'No Service of type Factory available in ProjectScopeService`. I fixed the issue. It would be appreciated if you accept the pull request and update the repository.

    I am looking forward to your response. Best regards, Azizur

    opened by azizurice 2
  • arc_origin=

    arc_origin="" doesn't work

    Hello sorry for my many questions when I imported library into my project using gradle.build dependency it worked fine but it arc is always show centered no matter which value I give in arc_origin in demo app it works great but doesn't work in my project I don't know why thank you very much for your efforts.

    I'm trying to use like a path shape.

    opened by EgyptianM 2
  • How to use this library?

    How to use this library?

    Hello,

    I am trying to use this library in my project. First I created a new project in Android Studio, and add the following statement into build.gradle: compile 'com.ogaclejapan.arclayout:library:1.0.1@aar'. but it reported parsing XML error: unbound prefix. And I didn't see the library source code in my project.

    Could you give a detailed process to add this library into a new project.

    Thanks, Wilson

    opened by wensonwang 2
  • Gradle sync failed: Plugin with id 'com.github.dcendents.android-maven' not found.

    Gradle sync failed: Plugin with id 'com.github.dcendents.android-maven' not found.

    HI I can't import the library as a module into my project it shows this error

    Gradle sync failed: Plugin with id 'com.github.dcendents.android-maven' not found.

    opened by EgyptianM 1
  • DefaultMavenFactory error

    DefaultMavenFactory error

    I tried to open the project in Android Studio but it gives me this error:

    Error:(2, 0) Cause: org/gradle/api/publication/maven/internal/DefaultMavenFactory

    Could you please help me out?

    opened by figengungor 1
  • Setting ProgressView visibility in xml throws exception

    Setting ProgressView visibility in xml throws exception

    Add a ProgressView widget in an xml with visiblity gone:

        <com.rey.material.widget.ProgressView
            android:id="@+id/progressBar1"
            android:layout_width="56dp"
            android:layout_height="56dp"
            android:layout_gravity="center"
            android:visibility="gone"
            app:pv_autostart="false"
            app:pv_circular="true"
            app:pv_progressMode="indeterminate"
            app:pv_progressStyle="@style/MultipleColorsCircularProgressStyle"/>
    

    Throws the following exception when running the app and during inflation:

    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.rey.material.drawable.LinearProgressDrawable.getProgressMode()' on a null object reference
                at com.rey.material.widget.ProgressView.getProgressMode(ProgressView.java:125)
                at com.rey.material.widget.ProgressView.onVisibilityChanged(ProgressView.java:98)
                at android.view.View.dispatchVisibilityChanged(View.java:8731)
                at android.view.View.setFlags(View.java:9774)
                at android.view.View.<init>(View.java:4159)
                at android.view.View.<init>(View.java:3645)
                at com.rey.material.widget.ProgressView.<init>(ProgressView.java:45)
                at com.rey.material.widget.ProgressView.<init>(ProgressView.java:35)
                at java.lang.reflect.Constructor.newInstance(Native Method)
                at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
    
    opened by jush 1
  • Can't gc  promptly when open and close arclayout view many times

    Can't gc promptly when open and close arclayout view many times

    Arclayout is great,i have used it for a long time. Recently,i have found an issue, the memory raised up constantly when open and close the Arclayout view many times. Every time open and close the Arclayout view,the memory will raise up about 1M,and can't fall down automatically. I need your help,thanks!

    opened by fg607 0
  • Like a path in combination with others

    Like a path in combination with others

    I am trying to implement like a path to other combos.. like left with bottom top etc. In a way i achieved it but not with the best results in some combos. Can u explain or build a way on doing this ? thanks a lot for ur code :)

    opened by mhackeras 0
  • Fatal Exception during hide menu animation,Fab like a tumblr

    Fatal Exception during hide menu animation,Fab like a tumblr

    Hello, I have created the demo like a tumblr using my icons and buttons.the menu items works and animation is ok.but if I click on the fab and then click the fab again while the menu is on,I get this error : FATAL EXCEPTION: main Process: com.dsd2016.iparked_android, PID: 5694 java.lang.NullPointerException: Attempt to invoke virtual method 'long com.android.internal.util.VirtualRefBasePtr.get()' on a null object reference at android.view.RenderNodeAnimator.applyInterpolator(RenderNodeAnimator.java:171) at android.view.RenderNodeAnimator.start(RenderNodeAnimator.java:185) at android.animation.AnimatorSet.start(AnimatorSet.java:678) at android.animation.AnimatorSet.onChildAnimatorEnded(AnimatorSet.java:807) at android.animation.AnimatorSet.-wrap1(AnimatorSet.java) at android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd(AnimatorSet.java:784) at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1149) at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1309) at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146) at android.animation.AnimationHandler.-wrap2(AnimationHandler.java) at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:869) at android.view.Choreographer.doCallbacks(Choreographer.java:683) at android.view.Choreographer.doFrame(Choreographer.java:616) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

    opened by saeedek 1
  • How to hide menu when back from another activity

    How to hide menu when back from another activity

    I follow the code to implement Tumblr menu in MainActivity, when a item click, it navigate to SettingActivity, then I press back to finish Setting activity, the menu still show . How to close the menu at OnResume of MainActivity ?

    private void hideMenu(int cx, int cy, float startRadius, float endRadius) {
            List<Animator> animList = new ArrayList<>();
    
            for (int i = arcLayout.getChildCount() - 1; i >= 0; i--) {
                animList.add(createHideItemAnimator(arcLayout.getChildAt(i)));
            }
    
            animList.add(createHideItemAnimator(centerItem));
    
            Animator revealAnim = createCircularReveal(menuLayout, cx, cy, startRadius, endRadius);
            revealAnim.setInterpolator(new AccelerateDecelerateInterpolator());
            revealAnim.setDuration(200);
            revealAnim.addListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    super.onAnimationEnd(animation);
                    menuLayout.setVisibility(View.INVISIBLE);
                }
            });
    
            animList.add(revealAnim);
    
            AnimatorSet animSet = new AnimatorSet();
            animSet.playSequentially(animList);
            animSet.start();
    
        }
    

    I found above code to close menu when fab clicked. But it not help when close menu at onResume

    opened by nguyencongbinh 0
Owner
ogaclejapan
ogaclejapan
GoolgePlusLayout is a custom layout that plays animation on the children views while scrolling as the layout in the Google Plus (android) main page

Google Plus Layout Google Plus Layout is a custom layout that support playing animation on child view(s) in a serialize manner like the the main

Ahmed Nammari 224 Nov 25, 2022
Responsive Layout Gird Configuration using Compose. An adaptive layout

ResponsiveGrid Responsive Grid is most followed layout system by the designer as it adapts to screen size and orientation, ensuring consistency across

null 4 Apr 12, 2022
It's an Android library that allows you to use Layout as RadioButton or CheckBox.

Android - CompoundLayout It's an Android library that allows you to use Layout as RadioButton or CheckBox. The librarie is Android 14+ compatible. Gra

null 483 Nov 25, 2022
Share Layout Android Library

Share any layout screenshot including any string of any Android App to any app via Intent .

Amit Maity 5 Sep 13, 2022
An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu

ResideLayout An Android Layout which has a same function like https://github.com/romaonthego/RESideMenu. Can be used on Android 1.6(I haven't try it.)

Yang Hui 392 Oct 12, 2022
Android layout that simulates physics using JBox2D

PhysicsLayout Android layout that simulates physics using JBox2D. Simply add views, enable physics, and watch them fall! See it in action with the sam

John Carlson 689 Dec 29, 2022
An Android demo of a foldable layout implementation. Engineered by Vincent Brison.

Foldable Layout This code is a showcase of a foldable animation I created for Worldline. The code is fully written with java APIs from the Android SDK

Worldline 599 Dec 23, 2022
A 3D Layout for Android,When you use it warp other view,it can became a 3D view,一秒让你的view拥有3D效果!

ThreeDLayout A 3D Layout,When you use it warp other view,it can became a 3D view 中文文档 preview USAGE 1.compile library allprojects { repositories {

androidwing 490 Oct 27, 2022
A pull to refresh layout for android, the RecyclerRefreshLayout is based on the SwipeRefreshLayout. support all the views, highly customizable, code simplicity, etc. really a practical RefreshLayout!

RecyclerRefreshLayout English | 中文版 RecyclerRefreshLayout based on the {@link android.support.v4.widget.SwipeRefreshLayout} The RecyclerRefreshLayout

dinus_developer 1.7k Nov 10, 2022
Easy, flexible and powerful Swipe Layout for Android

SwipeRevealLayout A layout that you can swipe/slide to show another layout. Demo Overview Drag mode Drag mode normal: Drag mode same_level: Features F

Chau Thai 1.5k Jan 4, 2023
[UNMAINTAINED]: AndroidMosaicLayout is android layout to display group of views as grid consists of different asymmetric patterns (90 different patterns).

AndroidMosaicLayout AndroidMosaicLayout is android layout to display group of views in more that 90 different patterns. What is AndroidMosaicLayout? I

Adham Enaya 474 Nov 12, 2022
Scalable Layout For Android

ScalableLayout for Android. Class: com.ssomai.android.scalablelayout.ScalableLayout 한글버전 README.md: https://github.com/ssomai/ScalableLayout/blob/mast

Youngmann Kim 273 Nov 21, 2022
Android implementation of FlowLayout. Layout arranges its children in multiple rows depending on their width.

FlowLayout FlowLayout is an opensource Android library that alows developers to easily integrate flow layout into their app. FlowLayout is an layout t

Blaž Šolar 754 Dec 15, 2022
Circular layout for android

CircleLayout Circular layout for android. Installlation Add CircleLayout as Android Library to your project. How to add project as Android Library Usa

Dmitry Zaytsev 244 Nov 18, 2022
An Android layout for arranging children along a circle

CircleLayout An Android layout for arranging children along a circle You can customize the following options: cl_centerView: Set a specific view ID to

Francois Campbell 374 Nov 18, 2022
Android - A layout that arranges its children in relation to a background image

ImageLayout A layout that arranges its children in relation to a background image. The layout of each child is specified in image coordinates (pixels)

Manuel Peinado Gallego 419 Nov 14, 2022
null 2.4k Dec 30, 2022
Android Shadow Layout

?? Before using this library, read information below ?? This library is not more supported. If you want to add new feature or fix a bug, grab source

Dmytro Danylyk 1.8k Jan 2, 2023