All Projects → justasm → Bugstick

justasm / Bugstick

Licence: mit
Joystick widget for Android.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bugstick

Sliding Panel
Android sliding panel that is part of the view hierarchy, not above it.
Stars: ✭ 433 (+409.41%)
Mutual labels:  viewgroup
View shaper
A library to help create shaped views and layouts in Android
Stars: ✭ 42 (-50.59%)
Mutual labels:  viewgroup
Calendarview
Calendar View Library
Stars: ✭ 71 (-16.47%)
Mutual labels:  viewgroup
Nestedtouchscrollinglayout
🎱处理子 View,父 View 嵌套滚动,成本比 support v4 NestedScrolling 低,放心食用~
Stars: ✭ 557 (+555.29%)
Mutual labels:  viewgroup
Tagviewgroup
Android 仿小红书图片标签Group
Stars: ✭ 891 (+948.24%)
Mutual labels:  viewgroup
Segacontroller
Arduino library to read Sega Genesis (Mega Drive) and Master System (Mark III) controllers.
Stars: ✭ 55 (-35.29%)
Mutual labels:  joystick
Swipedelmenulayout
The most simple SwipeMenu in the history, 0 coupling, support any ViewGroup. Step integration swipe (delete) menu, high imitation QQ, iOS. ~史上最简单侧滑菜单,0耦合,支持任意ViewGroup。一步集成侧滑(删除)菜单,高仿QQ、IOS。~
Stars: ✭ 3,376 (+3871.76%)
Mutual labels:  viewgroup
Gilrs
Game Input Library for Rust - Mirror of https://gitlab.com/gilrs-project/gilrs
Stars: ✭ 81 (-4.71%)
Mutual labels:  joystick
Openpsx2amigapadadapter
Playstation to Commodore Amiga/CD32 Controller Adapter
Stars: ✭ 35 (-58.82%)
Mutual labels:  joystick
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (-21.18%)
Mutual labels:  joystick
Unswitch
🕹 A tiny event handler for Switch controllers!
Stars: ✭ 574 (+575.29%)
Mutual labels:  joystick
Chips Input Layout
A customizable Android ViewGroup for displaying Chips (specified in the Material Design Guide).
Stars: ✭ 591 (+595.29%)
Mutual labels:  viewgroup
Dragranksquare
edit personal information which enables users to drag and rank image order
Stars: ✭ 1,115 (+1211.76%)
Mutual labels:  viewgroup
Kotlinextensions.com
A handy collection of most commonly used Kotlin extensions to boost your productivity.
Stars: ✭ 522 (+514.12%)
Mutual labels:  viewgroup
Unijoystick
It is a powerful joystick component for UGUI.
Stars: ✭ 75 (-11.76%)
Mutual labels:  joystick
Ucr
Universal Control Remapper [Alpha]
Stars: ✭ 399 (+369.41%)
Mutual labels:  joystick
Flowchooselayout
一个基于流体布局的单选 多选控件
Stars: ✭ 51 (-40%)
Mutual labels:  viewgroup
Rc transmitter
An Arduino 2.4GHz and IR remote controller
Stars: ✭ 83 (-2.35%)
Mutual labels:  joystick
Zzbeelayout
A nice Image ViewGroup like honeycomb.
Stars: ✭ 76 (-10.59%)
Mutual labels:  viewgroup
Wireless Rc Adapter
🎮 Arduino USB-Joystick adapter for RC receivers with PWM and PPM modulations up to 8 channels.
Stars: ✭ 62 (-27.06%)
Mutual labels:  joystick

Bugstick

Flexible joystick widget for Android.

Sample animated.

Why Bugstick?

Other joystick widgets are a hassle to include in modern Gradle-based Android projects, support only limited visual customization, and suffer from overly prescriptive output.

So how does Bugstick solve these issues?

  • Painless Dependency - try it out quickly with a simple Gradle dependency.

  • Configurable Look - the joystick base and stick are a completely decoupled, standard ViewGroup - View pair. Use an ImageView, Button, LinearLayout, or any other View as the stick, and use standard Drawables to theme Bugstick so it looks at home in your app.

  • Unopinionated Output - the widget reports proportional offset of the stick from its center as well as the current angle via a standard listener interface. Choose to interpret these raw outputs in the way that suits your use case.

Usage

Add it to your project using Gradle:

compile 'com.jmedeisis:bugstick:0.2.2'

Example XML layout file:

<com.jmedeisis.bugstick.Joystick
    android:id="@+id/joystick"
    android:layout_width="@dimen/base_size"
    android:layout_height="@dimen/base_size"
    android:background="@drawable/bg_base">

    <!-- You may use any View here. -->
    <Button
        android:layout_width="@dimen/stick_size"
        android:layout_height="@dimen/stick_size"
        android:background="@drawable/bg_stick" />

</com.jmedeisis.bugstick.Joystick>

Note that the Joystick ViewGroup supports only one direct child, but that child can be another ViewGroup such as a FrameLayout with multiple children.

After inflating the layout, you will typically listen for joystick events using a JoystickListener:

Joystick joystick = (Joystick) findViewById(R.id.joystick);
joystick.setJoystickListener(new JoystickListener() {
    @Override
    public void onDown() {
        // ..
    }

    @Override
    public void onDrag(float degrees, float offset) {
        // ..
    }

    @Override
    public void onUp() {
        // ..
    }
});

Please refer to the included sample project for a thorough example.

Configuration

You can configure the following attributes for the Joystick class:

  • start_on_first_touch - If true (default), the stick activates immediately on the initial touch. If false, the user must begin to drag their finger across the joystick for the stick to activate.

  • force_square - If true (default), the joystick always measures itself to force a square layout.

  • radius - If specified, this is the maximum physical offset from the center that the stick is allowed to move. If not specified (default), the radius is determined based on the dimensions of the base and the stick.

  • motion_constraint - One of None (default), Horizontal, or Vertical. Specifies whether the stick motion should be constrained to a particular direction. If None, the stick is allowed to move freely around the center of the base.

Example configuration:

<com.jmedeisis.bugstick.Joystick
    android:id="@+id/joystick"
    android:layout_width="@dimen/base_width"
    android:layout_height="match_parent"
    android:background="@drawable/bg_base"
    app:start_on_first_touch="false"
    app:force_square="false"
    app:radius="@dimen/stick_offset_max_radius"
    app:motion_constraint="Vertical">

    <!-- Any View here. -->

</com.jmedeisis.bugstick.Joystick>

Development

Pull requests are welcome and encouraged for bugfixes and features such as:

  • accessibility support
  • more powerful motion constraints, e.g. constrain to arbitrary path

License

Bugstick is licensed under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].