ActionsContentView is an standalone library implements actions/content swiping view (AKA Side Navigation UI Pattern, AKA Facebook side menu). The library doesn't use any specific code introduced in new Android SDK versions. This allows develop an application with an action/content swiping view for every version of Android from 2.2 and up.

Overview

ActionsContentView

ActionsContentView is an standalone library implements actions/content swiping view.

The library doesn't use any specific code introduced in new Android SDK versions. This allows develop an application with an action/content swiping view for every version of Android from 2.2 and up.

Some advantages of this library:

  • ability to slide view by touch
  • it is easy to adjust size of actions bar in XML
  • support of all Android SDK versions, starting from 2.0 and up

There is one limitation:

  • all horizontal scrolling views will not work at bounds of this view, except you will use swipe from the bezel mode (read Useful hints for more information).

Screenshots

Example application looks on phoneExample application looks on phone

Example application looks on tablet

Features included

  • Slide view by touch.
  • Shadow dropped by content view to actions one.
  • Offset for content view to show part actions view. Useful to hint user that there are actions under content.
  • Add shading for actions view while scrolling content.
  • Swipe from the bezel to the screen so horizontal scrolling is possible
  • Effects for Action and Content views. See the example below.

Feature to be implemented in future

  • Left, right or both side sliding support

Examples

Here is an example of ActionsContentView as an element of an XML layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    ...

    <shared.ui.actionscontentview.ActionsContentView
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/divider"
        app:actions_layout="@layout/actions"
        app:actions_spacing="0dp"
        app:content_layout="@layout/content"
        app:shadow_drawable="@drawable/shadow"
        app:shadow_width="8dip"
        app:spacing="64dip"
        app:spacing_type="right_offset" />
    
    ...
   
</RelativeLayout>

Example application

Try out the example application on the Android Play Store: ActionsContentView Example.

Useful hints

Enable horizontal scrolling

To enable horizontal scrolling at content view, you should set swipe from bezel mode. It is easy to do this by adding next row to XML layout:

<shared.ui.actionscontentview.ActionsContentView
    ...
    app:swiping_type="edge"
    ...
    />

or by next line(s) of code:

viewActionsContentView.setSwipingType(ActionsContentView.SWIPING_EDGE);

Parallax effect for actions layout

To create parallax effect we should create a translate animation and use it as the effect for the actions layout. Here are steps to get it done:

Create <project_path>/res/anim/actions.xml and put next code into it:

<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:fromXDelta="0"
    android:interpolator="@android:anim/accelerate_decelerate_interpolator"
    android:toXDelta="-200" />

Add the next line to the XML layout of ActionsContentView:

<shared.ui.actionscontentview.ActionsContentView
    ...
    app:effect_actions="@anim/actions"
    ...
    />

Parallax demo can be seen here.

How to use

Please follow next instruction to import library project into your Eclipse workspace:

  1. Clone GitHub somewhere
  2. Open Eclipse workspace
  3. Press menu File->Import->Android->Existing Android code into workspace
  4. Import ActionsContentViewLib project
  5. Select your project and press menu Project->Properties
  6. Select Android.
  7. Press Add at Library section. Select ActionsContentViewLib.
  8. Apply->OK

If you have got error like this one: "Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties" use next steps to resolve it:

  1. Open workspace with project
  2. Select project
  3. Press menu: Project->Properties
  4. Goto tab Java Compiler
  5. Check 'Enable project specific settings'
  6. Set 'Compiler compliance level' to 1.6
  7. Apply->OK

Do this for all Android projects or workspace setting and problem should be resolved.


Developed By

License

Copyright 2013 Steven Rudenko

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
  • Error in Library

    Error in Library

    Got this error when i opened example.xml (ActionsContentView Example)

    The following classes could not be instantiated:

    • shared.ui.actionscontentview.ActionsContentView (Open Class, Show Error Log) See the Error Log (Window > Show View) for more details. Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

    android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F060000. at android.content.res.BridgeResources.throwException(BridgeResources.java:693) at android.content.res.BridgeResources.getDimensionPixelSize(BridgeResources.java:406) at shared.ui.actionscontentview.ActionsContentView.(ActionsContentView.java:169) at shared.ui.actionscontentview.ActionsContentView.(ActionsContentView.java:157) at sun.reflect.NativeConstructorAccessorImpl.newInstance0( at sun.reflect.NativeConstructorAccessorImpl.newInstance( at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( at java.lang.reflect.Constructor.newInstance( at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422) at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:746) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:718) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:372)

    question 
    opened by puneetverma05 15
  • Sliding menu with fragmentactivity

    Sliding menu with fragmentactivity

    Hi!

    How should I coding about sliding menu with fragmentactivity without change page like facebook?

    your code have what I thought, but that is fragment.

    Your fragmentactivity will change the page, but fragment won't.

    So, how should I do like fragment won't change the page? Cuz my code is fragmentactivity.

    I mean call a different fragmentactivity in one activity from slidemenu..

    question 
    opened by z5947878 10
  • The ImageButton open or close menu bug... when you click it

    The ImageButton open or close menu bug... when you click it

    Here is my log:

    01-15 16:42:37.479: D/memalloc(7779): /dev/pmem: Mapped buffer base:0x4be0a000 size:9216000 offset:7680000 fd:58 01-15 16:42:37.559: E/dalvikvm(7779): GC_FOR_ALLOC freed 123K, 8% free 9970K/10787K, paused 2ms+2ms 01-15 16:42:37.879: D/memalloc(7779): /dev/pmem: Mapped buffer base:0x4d4d7000 size:16465920 offset:14929920 fd:61 01-15 16:42:38.659: D/memalloc(7779): /dev/pmem: Mapped buffer base:0x4ccd3000 size:4608000 offset:3072000 fd:64 01-15 16:42:39.739: E/TAG(7779): ___ 01-15 16:42:39.739: E/TAG(7779): viewActionsContentView.showActions()_ 01-15 16:42:50.429: E/TAG(7779): ___ 01-15 16:42:50.429: E/TAG(7779): viewActionsContentView.isActionsShown()_true 01-15 16:42:54.089: E/TAG(7779): ___ 01-15 16:42:54.089: E/TAG(7779): _viewActionsContentView.showActions() 01-15 16:42:57.189: E/TAG(7779): ___ 01-15 16:42:57.189: E/TAG(7779): viewActionsContentView.isActionsShown()_true 01-15 16:42:58.449: E/TAG(7779): ___ 01-15 16:42:58.449: E/TAG(7779): _viewActionsContentView.showActions() 01-15 16:42:59.549: E/TAG(7779): ___ 01-15 16:42:59.549: E/TAG(7779): viewActionsContentView.isActionsShown()_true 01-15 16:43:00.649: E/TAG(7779): ___ 01-15 16:43:00.649: E/TAG(7779): _viewActionsContentView.showActions() 01-15 16:43:01.669: E/TAG(7779): ___ 01-15 16:43:01.669: E/TAG(7779): viewActionsContentView.isActionsShown()_true 01-15 16:43:02.549: E/TAG(7779): ___ 01-15 16:43:02.549: E/TAG(7779): __viewActionsContentView.isActionsShown()_true 01-15 16:45:31.479: E/TAG(7779): ___ 01-15 16:45:31.479: E/TAG(7779): _viewActionsContentView.showActions()

    OK . the last : 01-15 16:43:01.669: E/TAG(7779): __viewActionsContentView.isActionsShown()_true 01-15 16:43:02.549: E/TAG(7779): ___ 01-15 16:43:02.549: E/TAG(7779): __viewActionsContentView.isActionsShown()_true

    so . i should click the button twice and then it can show left menu here is you code: public void onActionsButtonClick(View view) { if (viewActionsContentView.isActionsShown()) viewActionsContentView.showContent(); else viewActionsContentView.showActions(); }

    what's wrong? tell me please .. Thanks !

    bug 
    opened by liufsd 8
  • Disable Swipe

    Disable Swipe

    How can i disable swipe? I tried viewActionsContentView.setSwipingEnabled(false); but that has no effect. On the res file I couldn't find an attribute to disable swipe.

    enhancement invalid 
    opened by rnselv1 5
  • How in the world do you add a category?

    How in the world do you add a category?

    Hey!

    After going through your code numerous times, I can't for the life of me figure out how the heck you added categories. ('Bookmarks').

    If you could please show me how, or give me a link to where I could find my answer, I'd really appreciate it.

    Thank you so much for such an awesome library. Use it in nearly all the apps I create.

    • Kyler
    question 
    opened by MBQ- 5
  • Improve performance

    Improve performance

    Hi,

    First of all, congrats for the library. This is the one that suits most kinds of app menus due to its many setting options.

    The problem is that after mergin the last changes (since two or three of months ago) the scrolling performance dropped a lot.

    Is this issue on the 'coming soon' roadmap?

    Thanks.

    opened by guillermolechuga 4
  • webview hardware back button closes app

    webview hardware back button closes app

    In you example ActionsContentViewExample if one is navigating trough the webview pages and uses the hardware back button it closes the app instead of navigating back in the browsing history on the webpage. fixed #9

    opened by moviecityes 4
  • action content view with underline

    action content view with underline

    How to creat underline like facebook on action content view?

    please check the pic.

    The last category hasn't underline and the action title has the blank which is above it.

    tjczk 1

    invalid question 
    opened by z5947878 3
  • ActionsContentView with googlemaps

    ActionsContentView with googlemaps

    I am trying to implement the menu with google maps as my main fragment activity. Although when I have both the actionscontentview and mapfragment in the layout xml the map displays but I am not able to swipe the menu in from the left. When I increase the margin on the left side of the map I can see the menu partially, but only to the edge of the map.

    Is this maybe because the map is picking up the swipe?

    Any help appreciated.

    question 
    opened by conbon 2
  • Unfortunately, ActionsContentView stopped,

    Unfortunately, ActionsContentView stopped,

    I tried to add another three itmes under setting category, but then the apps stopped working, the second question where I can find the setting file to create more categories. finally. I created a new login.xml layout and I want to link item settings://login item to login.xml.( we need an example) I see that many needs that

    I use ActionsContentViewExample. please don't forward me to read any thing else I need your answer thanks,.

    question 
    opened by hdamis 2
  • Would you able to show me how to implement or include your library in Eclipse?

    Would you able to show me how to implement or include your library in Eclipse?

    I have done both ways a) only using and include the jar file as the library on my codings b) include the whole folder called "ActionsContentViewLib" as the library in the workplace.

    There are errors found from the runtime testing.

    1. Source not found..

    2. [2013-06-27 15:41:50 - ActionsContentViewLib] Could not find ActionsContentViewLib.apk! the apk file located in the bin was not found.

    What is the correct way to include your library in the workplace??

    question 
    opened by jjhesk 2
  • how to implementing right  side sliding support

    how to implementing right side sliding support

    this library layout direction is LEFT by default and i try to find some document to change options to set this layout to RIGHT but i can't find.

    this quote is library document:

    Feature to be implemented in future

    Left, right or both side sliding support

    is anybody use this library and can help me to change default layout? thanks

    look this screen shot

    opened by pishguy 2
  • Fatal Exception: java.lang.NullPointerException

    Fatal Exception: java.lang.NullPointerException

    In the meantime I've added a try/catch to keep my app from crashing. I'm not sure how to add that to the git project or I would.

    Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.Boolean.booleanValue()' on a null object reference
           at shared.ui.actionscontentview.ActionsContentView$ContentScrollController.onFling(ActionsContentView.java:993)
           at android.view.GestureDetector.onTouchEvent(GestureDetector.java:620)
           at shared.ui.actionscontentview.ActionsContentView.onInterceptTouchEvent(ActionsContentView.java:612)
           at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2214)
           at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
           at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
           at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
           at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
           at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
           at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
           at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2687)
           at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2362)
           at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2740)
           at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1832)
           at android.app.Activity.dispatchTouchEvent(Activity.java:2944)
           at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2701)
           at android.view.View.dispatchPointerEvent(View.java:9360)
           at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4978)
           at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4739)
           at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4271)
           at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4324)
           at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4290)
           at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4416)
           at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4298)
           at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4473)
           at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4271)
           at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4324)
           at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4290)
           at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4298)
           at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4271)
           at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6866)
           at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6747)
           at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6718)
           at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6956)
           at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
           at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
           at android.os.MessageQueue.next(MessageQueue.java:143)
           at android.os.Looper.loop(Looper.java:130)
           at android.app.ActivityThread.main(ActivityThread.java:6837)
           at java.lang.reflect.Method.invoke(Method.java)
           at java.lang.reflect.Method.invoke(Method.java:372)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
    
    opened by jacksonkr 0
  • Feature to be implemented in future - right side sliding support!

    Feature to be implemented in future - right side sliding support!

    I just came across your library and I like it. I'm wondering if you're going to add right side sliding support because that'll make it a lot better?

    Thanks.

    opened by ghost 1
  • Shadow blocks nav items in Android 5.0(L)

    Shadow blocks nav items in Android 5.0(L)

    When the menu button is pressed my content slides right. The shadow that is to the left of the content and thus above the menu items covers the menu items and therefore the menu items are not selectable. This has only become an issue as of Android 5.0. I'll will report back if I find a solution before you do.

    opened by jacksonkr 0
  • ViewPager on content view doesn't show anything

    ViewPager on content view doesn't show anything

    Hello, i am trying to add a ViewPager to content view but it doesn't show anything and i can even see the action view behind content. Here is a picture of what i got untitled1

    Could you tell me what is the problem and how can i fix that? Thanks you!

    opened by vuongggg 2
A dual-function menu button that offers a default action as well as the possibility of choosing a different action by selecting from a set of alternatives.

A dual-function menu button that offers a default action as well as the possibility of choosing a different action by selecting from a set of alternatives.

Kojo Fosu Bempa Edue 114 Nov 29, 2022
Floating Action Menu for Android. Inspired by the Google Plus floating menu

android-floating-action-menu Floating Action Menu for Android. Inspired by the Google Plus floating menu. Demo Setup The simplest way to use this libr

Alessandro Crugnola 242 Nov 10, 2022
An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.

AndroidPullMenu AndroidPullMenu is an Open Source Android library that allows developers to easily create applications with pull menu. The aim of this

Armando TBA 181 Nov 29, 2022
Kai Liao 2.2k Jan 3, 2023
🚀 A very customizable library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.

SlidingUpMenu A library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet. Gradle Dependency

Rasheed Sulayman 26 Jul 17, 2022
Side menu with some categories to choose.

Side Menu Side menu with some categories to choose. Check this project on dribbble. Check this project on Behance. God bless Ukraine! Sample Sample &

Yalantis 5.2k Dec 23, 2022
Classic Power Menu is a Power Menu Replacement for Android 11+

Classic Power Menu is a Power Menu Replacement for Android 11+, with the main aim being restoring power menu options (Device Controls & Quick Access Wallet) on Android 12.

Kieron Quinn 385 Dec 31, 2022
A simple Floating Action Button that shows an anchored Navigation View

Floating Navigation View A simple Floating Action Button that shows an anchored Navigation View and was inspired by Menu Material Fixed created by Tom

André Mion 1.3k Dec 29, 2022
Navigation menu for Android (based off Google+ app)

RibbonMenu Navigation menu for Android (based on Google+ app). Usage Menus are created in xml as normal, adding text and an icon. In the layout you wa

David Scott 487 Nov 24, 2022
** A slide-out menu implementation, which allows users to navigate between views in your app.

MenuDrawer A slide-out menu implementation, which allows users to navigate between views in your app. Most commonly the menu is revealed by either dra

Simon Vig Therkildsen 2.6k Dec 8, 2022
Simple and easy to use circular menu widget for Android.

Deprecated This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to

Anup Cowkur 420 Nov 25, 2022
A new way to implement navigation in your app 🏎

ExpandableBottomBar A new way to improve navigation in your app Its really easy integrate to your project take it, faster, faster Important: library w

Alexander Dadukin 692 Dec 29, 2022
A customizable and easy to use BottomBar navigation view with sleek animations, with support for ViewPager, ViewPager2, NavController, and badges.

AnimatedBottomBar A customizable and easy to use bottom bar view with sleek animations. Examples Playground app Download the playground app from Googl

Joery 1.2k Dec 30, 2022
Space Navigation is a library allowing easily integrate fully customizable Google Spaces like navigation to your app.

Space-Navigation-View Introduction Space Navigation is a library allowing easily integrate fully customizable Google [Spaces][1] like navigation to yo

Arman 2k Dec 23, 2022
An android custom view which looks like the menu in Path 2.0 (for iOS).

ArcMenu & RayMenu ArcMenu An android custom view which looks like the menu in Path 2.0 (for iOS). RayMenu About The user experience in Path 2.0 (for i

daCapricorn 1.3k Nov 29, 2022
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html

Material Bottom Navigation Library Lightweight Bottom Navigation library component inspired by the Google Material Design Guidelines at https://www.go

Alessandro Crugnola 1.4k Dec 18, 2022
Android library that provides the floating action button to sheet transition from Google's Material Design.

MaterialSheetFab Library that implements the floating action button to sheet transition from Google's Material Design documentation. It can be used wi

Gordon Wong 1.6k Dec 13, 2022
Bottom Sheet fragment with a sticky header and a content recycler view

Sticky Header Bottom Sheet A simple library to create a Bottom Sheet with a sticky header and a content recycler view. The bottom sheet expands on scr

Kshitij Kumar 12 Sep 21, 2022