An Android layout for arranging children along a circle

Related tags

Layout CircleLayout
Overview

Android Gems

Android Arsenal

CircleLayout

An Android layout for arranging children along a circle

You can customize the following options:

  • cl_centerView: Set a specific view ID to be in the center of the circle
  • cl_angle: Choose a specific angle between the children or arrange them equally (default: 0)
  • cl_angleOffset: Start the circle at an offset in degrees relative to the horizontal axis (default: 0)
  • cl_radius: Choose a specific radius for the circle or a preset. fitsSmallestChild and fitsLargestChild will automatically pick a radius that will place either the smallest or the largest child view at the outer boundary (minus any padding) and layout the rest along the same radius (default: fitsLargestChild)
  • cl_direction: Either clockwise or counterClockwise (default: counterClockwise)

Installation

Standard installation via Gradle:

dependencies {
    compile 'io.github.francoiscampbell:circlelayout:0.3.0'
}

Examples

Random widgets and a center view:

<?xml version="1.0" encoding="utf-8"?>
<io.github.francoiscampbell.circlelayout.CircleLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:cl="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    cl:cl_angleOffset="90"
    cl:cl_direction="clockwise"
    cl:cl_centerView="@+id/centerView">

    <Switch
        android:id="@+id/centerView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="12"
        android:textColor="@color/testTextColor"
        android:textSize="@dimen/clockTestSize" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="1"
        android:textColor="@color/testTextColor"
        android:textSize="@dimen/clockTestSize" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="2"
        android:textColor="@color/testTextColor"
        android:textSize="@dimen/clockTestSize" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="3"
        android:textColor="@color/testTextColor"
        android:textSize="@dimen/clockTestSize" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"/>

    <CheckBox
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <SeekBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</io.github.francoiscampbell.circlelayout.CircleLayout>

A very easy clock layout:

<?xml version="1.0" encoding="utf-8"?>
<io.github.francoiscampbell.circlelayout.CircleLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:cl="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    cl:cl_angleOffset="90"
    cl:cl_direction="clockwise">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="12"
        android:textColor="@color/testTextColor"
        android:textSize="@dimen/clockTestSize" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="1"
        android:textColor="@color/testTextColor"
        android:textSize="@dimen/clockTestSize" />

    ...

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="11"
        android:textColor="@color/testTextColor"
        android:textSize="@dimen/clockTestSize" />


</io.github.francoiscampbell.circlelayout.CircleLayout>
You might also like...
It's an Android library that allows you to use Layout as RadioButton or CheckBox.
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

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!
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

Easy, flexible and powerful Swipe Layout for Android
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

[UNMAINTAINED]: AndroidMosaicLayout is android layout to display group of views as grid consists of different asymmetric patterns (90 different patterns).
[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

Scalable Layout For Android
Scalable Layout For Android

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

Circular layout for android
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

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 Shadow Layout
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

An android layout to re-arrange child views via dragging
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

Comments
  • Resizing child views programatically makes them dissapear

    Resizing child views programatically makes them dissapear

    In my design patterns, I always build my interfaces to scale to different screen sizes, but with this CircleLayout there is no way to make the children sizes scale up or down along with their parent (CircleLayout) via xml or Java. Attempting to resize an individual child programatically causes that particular view to disappear.

    is there a solution to this?

    opened by kcochibili 0
  • Unable to update or refresh circle view

    Unable to update or refresh circle view

    Thanks was nice and awesome example My question is : I am unable to update or refresh circle view.

    What i want i have 2 buttons and update the views value based on button selection but before this i need to reference the view before do anythings with view. Please help me for same!! awaiting for you reply

    opened by ArbazIn 0
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • gradle.properties (gradle)
    • settings.gradle (gradle)
    • build.gradle (gradle)
    • circlelayout/build.gradle (gradle)
    • testapp/build.gradle (gradle)
    • gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 8 Pull Requests:

    Update dependency com.android.tools.build:gradle to v2.3.3
    • Schedule: ["at any time"]
    • Branch name: renovate/com.android.tools.build-gradle-2.x
    • Merge into: master
    • Upgrade com.android.tools.build:gradle to 2.3.3
    Update dependency com.jfrog.bintray.gradle:gradle-bintray-plugin to v1.8.5
    • Schedule: ["at any time"]
    • Branch name: renovate/com.jfrog.bintray.gradle-gradle-bintray-plugin-1.x
    • Merge into: master
    • Upgrade com.jfrog.bintray.gradle:gradle-bintray-plugin to 1.8.5
    Update dependency junit:junit to v4.13.2
    • Schedule: ["at any time"]
    • Branch name: renovate/junit-junit-4.x
    • Merge into: master
    • Upgrade junit:junit to 4.13.2
    Update dependency org.jetbrains.dokka:dokka-gradle-plugin to v0.10.1
    Update kotlin monorepo to v1.7.21
    Update dependency com.github.dcendents:android-maven-gradle-plugin to v2
    Update dependency gradle to v7
    • Schedule: ["at any time"]
    • Branch name: renovate/gradle-7.x
    • Merge into: master
    • Upgrade gradle to 7.5.1
    Update dependency org.jetbrains.dokka:dokka-gradle-plugin to v1

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ⚠ Dependency Lookup Warnings ⚠

    Please correct - or verify that you can safely ignore - these lookup failures before you merge this PR.

    • Failed to look up maven dependency com.android.support:appcompat-v7

    Files affected: testapp/build.gradle


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Owner
Francois Campbell
Francois Campbell
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
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
A layout that creates a loading-like progress around it's child ( circle ) on touch, inspired from Destiny's ( PS4 ) accept mechanism

HoldToLoadLayout HoldToLoadLayout is a view group that can contain a single child. It draws your child to middle of layout, and performs loading wheel

Melih Aksoy 79 Feb 8, 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
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