Circular layout for android

Related tags

Layout CircleLayout
Overview

CircleLayout

Circular layout for android.

Example

Installlation

Add CircleLayout as Android Library to your project.

How to add project as Android Library

Usage

  <ru.biovamp.widget.CircleLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@android:color/white"
      app:angleOffset="90.0">

      <!-- Add here any views you want -->

  </ru.biovamp.widget.CircleLayout>

To arrange views in nice looking pie provide this property:

app:layoutMode="pie"

In pie mode some additional options available:

sliceDivider - color of divider between slices of pie
innerCircle - color or drawable that will be drawn in center of pie
dividerWidth - width of divider between slices

And here is how it will look like:

Example

License

Copyright [email protected] Dmitry Zaitsev

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
  • Inflating error

    Inflating error

    Hello Dmitry,

    First Many thanks for this important library, i really needed it .. But seems i am missing something cause i am getting an inflating error :( I followed the steps exactly, and checked your example too.. Can't find what is wrong .. I saw another issue where you replied it might be an issue in manifest file, but i can't see any special line added to the example manifest file .. Would you kindly help me?

    android.view.InflateException: Binary XML file line #29: Error inflating class ru.biovamp.widget.CircleLayout

    and that is line 29

    <ru.biovamp.widget.CircleLayout

    Thanks.

    opened by HAndroid 19
  • Error inflating class

    Error inflating class

    I am newbie of Android. I have completed this lesson http://developer.android.com/training/basics/firstapp/index.html

    and trying to change layout to the circle one. Maybe I am missing something trivial.

    I have imported the source to Eclipse, set the CircleLayout project as library and specified that as referenced library in MyProject. http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject

    In AndroidManifest.xml I have added

    <activity
         android:name="ru.biovamp.widget.CircleLayout">
    </activity>
    

    activity_main.xml

    <?xml version="1.0" encoding="utf-8"?>
    <ru.biovamp.widget.CircleLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          xmlns:app="http://schemas.android.com/apk/res/org/myproject/client/android"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@android:color/white"
          >
    
        <!-- app:angleOffset="90.0" -->
    
        <EditText android:id="@+id/edit_message"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:hint="@string/edit_message" />
    
    </ru.biovamp.widget.CircleLayout>
    

    from logcat

    02-26 21:04:11.060: E/AndroidRuntime(608): FATAL EXCEPTION: main
    02-26 21:04:11.060: E/AndroidRuntime(608): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.myproject.client.android/org.myproject.client.android.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class ru.biovamp.widget.CircleLayout
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.ActivityThread.access$600(ActivityThread.java:122)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.os.Handler.dispatchMessage(Handler.java:99)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.os.Looper.loop(Looper.java:137)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.ActivityThread.main(ActivityThread.java:4340)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at java.lang.reflect.Method.invokeNative(Native Method)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at java.lang.reflect.Method.invoke(Method.java:511)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at dalvik.system.NativeStart.main(Native Method)
    02-26 21:04:11.060: E/AndroidRuntime(608): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class ru.biovamp.widget.CircleLayout
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.view.LayoutInflater.createView(LayoutInflater.java:606)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.Activity.setContentView(Activity.java:1835)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at org.myproject.client.android.MainActivity.onCreate(MainActivity.java:16)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.Activity.performCreate(Activity.java:4465)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
    02-26 21:04:11.060: E/AndroidRuntime(608):  ... 11 more
    02-26 21:04:11.060: E/AndroidRuntime(608): Caused by: java.lang.reflect.InvocationTargetException
    02-26 21:04:11.060: E/AndroidRuntime(608):  at java.lang.reflect.Constructor.constructNative(Native Method)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
    02-26 21:04:11.060: E/AndroidRuntime(608):  at android.view.LayoutInflater.createView(LayoutInflater.java:586)
    02-26 21:04:11.060: E/AndroidRuntime(608):  ... 21 more
    02-26 21:04:11.060: E/AndroidRuntime(608): Caused by: java.lang.NoClassDefFoundError: ru.biovamp.widget.R$styleable
    02-26 21:04:11.060: E/AndroidRuntime(608):  at ru.biovamp.widget.CircleLayout.<init>(CircleLayout.java:87)
    02-26 21:04:11.060: E/AndroidRuntime(608):  ... 24 more
    02-26 21:09:11.244: I/Process(608): Sending signal. PID: 608 SIG: 9
    
    opened by nikolaykuz 7
  • Childs animations not working on

    Childs animations not working on "Pie Mode"

    Tested on Nexus 4 with Android 4.3.

    I modified the default sample project to make it easy to reproduce the issue:

    https://www.dropbox.com/s/q52su3r7lydsvfs/CircleLayoutTestCase.zip

    opened by antoni-alvarez 1
  • ImageButton can't update image resource

    ImageButton can't update image resource

    I can add image in imagebutton src but it can't be update for example: I put the image resource in layout.xml,and I set image resource in java ,it will not update button image

    opened by pauliaia 1
  • Can we change the childitem's background programmatically?

    Can we change the childitem's background programmatically?

    Hi! Thanks for your awesome lib. But I have an issue with it. In the childItem's onclicklistener event, I can't change its background, even I can show a Toast message or set text to another view. I also tried childItem.invalidate() and childItem.bringToFront() but still didn't work. Hope you can help soon.

    opened by brian56 1
  • Is there a rotation listener?

    Is there a rotation listener?

    Very nice library. I would like to ask if this layout has a rotation listener. For example, I have 4 view and I swipe my fingers on the screen, the layout should perform a form of rotation animation.

    enhancement 
    opened by GolgothSchumi 1
  • Clipping of view elements inside when they're circles

    Clipping of view elements inside when they're circles

    Thanks for this great library! Just what I needed. But, I'm facing an issue when I'm trying to place 5 circles in a circle using your CircleLayout. Have attached the screenshot. screenshot_2014-04-12-00-22-51

    My layout.xml-

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/com.styledotme.one" android:id="@+id/themepopup" android:layout_width="fill_parent" android:layout_height="fill_parent"

    <com.styledotme.one.CircleLayout
        android:id="@+id/circlecolortap"
        android:layout_width="match_parent"
        android:layout_gravity="center_horizontal|center_vertical"
        android:layout_height="match_parent"
        app:angleOffset="40.0" >
    
        <View
            android:id="@+id/pinkthemetile"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/circle_pink"
            android:tag="PinkTheme" />
    
        <View
            android:id="@+id/bluethemetile"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/circle_blue"
            android:tag="BlueTheme" />
    
        <View
            android:id="@+id/greenthemetile"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/circle_green"
            android:tag="GreenTheme" />
    
        <View
            android:id="@+id/orangethemetile"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/circle_orange"
            android:tag="OrangeTheme" />
    
        <View
            android:id="@+id/redthemetile"
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@drawable/circle_red"
            android:tag="RedTheme" />
    </com.styledotme.one.CircleLayout>
    

    One of the drawables used for the cirlces- reddrawable

    and that's about it! the rightmost child circle is clipping no matter what I tried. (margin, change size to smaller than parent, etc) Only option seems to be to reduce the size of the 5 circles but it makes them aesthetically too small to accept.

    Thanks!

    opened by ghost 3
Owner
Dmitry Zaytsev
Dmitry Zaytsev
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
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
A very simple arc layout library for Android

ArcLayout A very simple arc layout library for Android. Try out the sample application on the Play Store. Usage (For a working implementation of this

ogaclejapan 1.4k Dec 26, 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
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
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
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
An android layout to re-arrange child views via dragging

Android Rearrangeable Layout An android layout to re-arrange child views via dragging Screencast Demo Layout Usage All the child views are draggable o

Raja Sharan Mamidala 273 Nov 25, 2022
BlurView - A very fast and dynamic blur layout for Android

BlurView - A very fast and dynamic blur layout for Android

null 16 Jul 11, 2022