Git Product home page Git Product logo

hover's Introduction

Hover

Hover is a floating menu implementation for Android.

Goals

The goals of Hover are to:

  1. Provide an easy-to-use, out-of-the-box floating menu implementation for Android developers, and

  2. Provide common tools for Android developers to create their own floating menu.

Beta Notice

Hover is still under heavy development. There is still a lot of code cleanup to do, so expect breaking API changes over time.

That said, Hover should be in a usable state at this time.

0.9.8 Major Breaking Changes

Version 0.9.8 introduces major breaking changes to Hover. This refactor was done to simplify the code structure to make it easier to fix existing bugs and further extend behavior.

0.9.8 also introduces a number of bug fixes, behavior improvements, and Android O alterations:

Feature Updates:

  • Added Android O support for application overlay.
  • Added support for HoverMenuService as foreground Service (important for Android O).
  • Added acceptance criteria as hover.feature file.
  • Added Checkstyle support (no git hooks yet).
  • Added many Hello World demos to show Hover versatility.
  • Added ability to switch out HoverMenus at any time.
  • Much more robust support for adding/removing/changing menu content in HoverView.

Hover Code Alterations:

  • Moved Hover implementation from 'defaultmenu' package to 'hover' package.
  • Can now instantiate a HoverView directly (no Builder required).
  • Replaced HoverMenuAdapter interface with HoverMenu base class.
  • Added HoverMenuView XML attributes for initial dock position.
  • Added 'Closed' menu state (in addition to 'Collapsed' and 'Expanded')
  • Clients can now provide initial dock when constructing HoverMenuView.
  • Hover collapsed position now saved with menu ID to avoid clobbering multiple menus saved state.
  • HoverView is now based on state pattern.

There is still code to clean, but hopefully no further refactor of this scale will be necessary.

Demo Hover Menu

A demo app (called Kitchen Sink) is included with the Hover repo. Here are some screenshots of the demo in action.

Demo Hover Menu - Launching Demo Hover Menu - Launching

Demo Hover Menu - Launching Demo Hover Menu - Launching Demo Hover Menu - Launching

Getting Started

Subclass HoverMenuService

To get started with Hover, create a subclass of HoverMenuService to host your Hover menu. Implement onHoverMenuLaunched(Intent, HoverView) to take control of your HoverView. You'll want to set it's HoverMenu, and also start it in the collapsed or expanded state:

public class MyHoverMenuService extends HoverMenuService {

    @Override
    protected void onHoverMenuLaunched(@NonNull Intent intent, @NonNull HoverView hoverView) {
        // Configure and start your HoverView.
        HoverMenu menu = ...;
        hoverView.setMenu(menu);
        hoverView.collapse();
    }
    
}

Implement A HoverMenu

A HoverMenu is the content that appears within a HoverView. A HoverMenu is divided into an ordered list of Sections. Each Section has a tab as well as Content that appear in your HoverView.

public class MyHoverMenu extends HoverMenu {
 
    private Context mContext;
    private Section mSection;
 
    private SingleSectionHoverMenu(@NonNull Context context) {
        mContext = context;
 
        mSection = new Section(
                new SectionId("1"),
                createTabView(),
                createScreen()
        );
    }
 
    private View createTabView() {
        ImageView imageView = new ImageView(mContext);
        imageView.setImageResource(R.drawable.tab_background);
        imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
        return imageView;
    }
 
    private Content createScreen() {
        return new MyContent(mContext, "Screen 1");
    }
 
    @Override
    public String getId() {
        return "singlesectionmenu";
    }
 
    @Override
    public int getSectionCount() {
        return 1;
    }
 
    @Nullable
    @Override
    public Section getSection(int index) {
        if (0 == index) {
            return mSection;
        } else {
            return null;
        }
    }
 
    @Nullable
    @Override
    public Section getSection(@NonNull SectionId sectionId) {
        if (sectionId.equals(mSection.getId())) {
            return mSection;
        } else {
            return null;
        }
    }
 
    @NonNull
    @Override
    public List<Section> getSections() {
        return Collections.singletonList(mSection);
    }
 
}

Working Directly With A HoverView

If you want to create your own Hover Service from scratch, or if you want to experiment with a HoverView directly, you can instantiate one yourself.

// Create a HoverView to display in a Window:
HoverView hoverView = HoverView.createForWindow(
        context,
        new WindowViewController(
            (WindowManager) getSystemService(Context.WINDOW_SERVICE)
        )
);
hoverView.setOnExitListener(onExitListener);
hoverView.addToWindow();
hoverView.setMenu(...);
hoverView.collapse();
 
// Create a HoverView to display in a View hierarchy:
HoverView hoverView = HoverView.createForView(context);
viewGroup.addView(hoverView);
hoverView.setOnExitListener(onExitListener);
hoverView.setMenu(...);
hoverView.collapse();
 
// Create a HoverView in XML:
<io.mattcarroll.hover.HoverView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:hover="http://schemas.android.com/apk/res-auto"
    android:id="@+id/hovermenu"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    hover:dockSide="right"
    hover:dockPosition="70%"
    />

Download

Hover is available through jCenter:

implementation 'io.mattcarroll.hover:hover:0.9.8'

Issues

When Hover is used within a Window, there is always a fullscreen View - even when nothing is visible. This is done to dramatically simplify the layout logic. However, this causes problems when apps request runtime permissions because the Android OS complains that an overlay is visible.

There is no built-in solution for this problem at this time. You should take care to destroy your Hover Service when the HoverView is closed. You may also want to inform the users of your app that issues with runtime permission dialogs might occur, and that those users should exit your Hover menu if problems occur.

Disclaimer

This is not an official Google product.

License

Copyright (C) 2016 Nest Labs

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.

hover's People

Contributors

ardacebi avatar fitzpasd avatar matthew-carroll avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hover's Issues

[HELP] Issue with SurfaceView

I'm using a GLSurfaceView for an overlay. When collapse it causes issue with attached photo
29366018_2039016319645209_2304923362226339840_o

With LayoutInspector
screen shot 2018-03-17 at 9 26 07 am

I'm not sure it's because of Android or Hover

Cannot close a single active session

Currently Hover does not provide the support to close a single active section. If only a single section exists, then dismiss the Hover when the section is closed.

ObjectAnimator in FloatingTab makes RTL unsupported

Please test it on RTL language only one tab will be showen, others will stay hidded and you can see it for seconds at the time you close or open the menu after hours of trying it turns out that the animation cuz other views to be hidden if i commented it and just used setVisibility(VISIBLE) it will work.
Pluse there is large space around each tab how to reduse it please

Hover Menu can't click and move after I rotate a screen

  • Like the title, I can not do how to be able to click and move it after I rotate the phone screen. I am looking forward to you can fix this, thank you very much!
    Video description: https://www.youtube.com/watch?v=FeowYjSBv_M
    (Sorry about my English)
There is another problem, I hope this feature you will add in the future
  • When in landscape mode, it seems that the content display is relatively small, when the keyboard is displayed, it will cover the content. So, I'm really looking forward to you doing the content display like Messenger, thank you very much.

1. Hover Menu

image

2. Messenger
image

I got a NPE when i tap the hoverView after drag as soon as i can

09-04 15:32:42.129 8157-8157/io.mattcarroll.hover.hoverdemo E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.mattcarroll.hover.hoverdemo, PID: 8157
java.lang.NullPointerException: Attempt to read from field 'io.mattcarroll.hover.HoverMenu$SectionId io.mattcarroll.hover.HoverView.mSelectedSectionId' on a null object reference
at io.mattcarroll.hover.HoverViewStateExpanded.onTabSelected(HoverViewStateExpanded.java:516)
at io.mattcarroll.hover.HoverViewStateExpanded.access$300(HoverViewStateExpanded.java:39)
at io.mattcarroll.hover.HoverViewStateExpanded$2.onClick(HoverViewStateExpanded.java:152)
at android.view.View.performClick(View.java:4909)
at android.view.View$PerformClick.run(View.java:20390)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5869)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1020)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:815)

removing selected section causes invisible FAB (still draggable)

If mycustomHoverMenu removes a selected Section from mSections (the ArrayList<Section>) while it is expanded, then calling notifyMenuChanged() causes a crash. To demonstrate, change 1 to 0 on line 123 of MutatingSectionsHoverMenuService.java of the hoverdemo-helloworld app. And manually expand the FAB after starting the "Launch Changing Sections".

removeTab(0);

That change just targets the currently selected section/tab for removal instead of a non-selected section. If I collapse the hoverView first, I can avoid the crash, but then I've seen the FAB ends up invisible (still referring to the removed section if it is at the end of the list), or sometimes crash after manually clicking the FAB, but I wonder if there's a better/safer procedure to removing sections.

I realize this is unsupported. But just in case there's a community using this cool library, I thought I'd post this question. And hopefully, my workaround shortly.

The crash details:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.codecanon.hover.hoverdemo.helloworld, PID: 27913
    java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
        at java.util.ArrayList.get(ArrayList.java:439)
        at io.mattcarroll.hover.hoverdemo.helloworld.MutatingSectionsHoverMenuService$MutatingHoverMenu.getSection(MutatingSectionsHoverMenuService.java:179)
        at io.mattcarroll.hover.HoverViewStateExpanded.removeSection(HoverViewStateExpanded.java:492)
        at io.mattcarroll.hover.HoverViewStateExpanded.removeSections(HoverViewStateExpanded.java:466)
        at io.mattcarroll.hover.HoverViewStateExpanded.access$600(HoverViewStateExpanded.java:39)
        at io.mattcarroll.hover.HoverViewStateExpanded$6.onRemoved(HoverViewStateExpanded.java:327)
        at android.support.v7.util.BatchingListUpdateCallback.dispatchLastEvent(BatchingListUpdateCallback.java:62)
        at android.support.v7.util.DiffUtil$DiffResult.dispatchUpdatesTo(DiffUtil.java:729)
        at io.mattcarroll.hover.HoverMenu.notifyMenuChanged(HoverMenu.java:76)
        at io.mattcarroll.hover.hoverdemo.helloworld.MutatingSectionsHoverMenuService$MutatingHoverMenu.removeTab(MutatingSectionsHoverMenuService.java:224)
        at io.mattcarroll.hover.hoverdemo.helloworld.MutatingSectionsHoverMenuService$MutatingHoverMenu.access$100(MutatingSectionsHoverMenuService.java:59)
        at io.mattcarroll.hover.hoverdemo.helloworld.MutatingSectionsHoverMenuService$MutatingHoverMenu$10.run(MutatingSectionsHoverMenuService.java:123)
        at io.mattcarroll.hover.hoverdemo.helloworld.MutatingSectionsHoverMenuService$MutatingHoverMenu$12.run(MutatingSectionsHoverMenuService.java:142)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

non-fullscreen demo crash

launch menu and drag to X to close it
repeat this a few times
then crash

03-30 19:40:49.267 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/WindowDragWatcher: ACTION_MOVE. motionX: 721.19806, motionY: 1896.4106
03-30 19:40:49.267 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: Setting collapsed position - x: 583, y: 1686
03-30 19:40:49.284 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/WindowDragWatcher: ACTION_MOVE. motionX: 718.56714, motionY: 1914.4631
03-30 19:40:49.285 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: Setting collapsed position - x: 580, y: 1704
03-30 19:40:49.291 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: Menu released at - x: 580.56714, y: 1704.4631
03-30 19:40:49.291 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: stopDragMode()
03-30 19:40:49.292 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: Hover menu dropped in exit region. Requesting exit.
03-30 19:40:49.292 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuService: Menu exit requested.
03-30 19:40:49.365 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuService: onDestroy()
03-30 19:40:49.999 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuService: onCreate()
03-30 19:40:50.000 375-1058/? D/audio_hw_primary: out_set_parameters: enter: usecase(1: low-latency-playback) kvpairs: routing=2
03-30 19:40:50.001 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/CollapsedMenuAnchor: setAnchorAt() - side: 2, normalized Y: 0.49870017
03-30 19:40:50.001 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: init()
03-30 19:40:50.005 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: setAdapter()
03-30 19:40:50.006 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: Setting tab ID to: 48
03-30 19:40:50.006 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: Adding first tab: 0
03-30 19:40:50.010 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuService: onStartCommand() - showing Hover menu.
03-30 19:40:50.018 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: animateActiveTabToAnchorPosition()
03-30 19:40:50.018 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuView: Active tab location - left: 0.0, top: 0.0
03-30 19:40:50.018 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/HoverMenuWindowSidePuller: Pulling to side. Anchor - side: 2, normalized Y: 0.49870017
03-30 19:40:50.018 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/CollapsedMenuAnchor: Creating a new anchor position on the RIGHT side at a normalized vertical position: 0.49870017
03-30 19:40:50.019 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/CollapsedMenuAnchor: Anchoring bounds with height: 0
03-30 19:40:50.019 21848-21848/io.mattcarroll.hoverdemonon_fullscreen D/AndroidRuntime: Shutting down VM
beginning of crash
03-30 19:40:50.020 21848-21848/io.mattcarroll.hoverdemonon_fullscreen E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.mattcarroll.hoverdemonon_fullscreen, PID: 21848
java.lang.NullPointerException: Attempt to read from field 'int android.graphics.Rect.right' on a null object reference
at io.mattcarroll.hover.defaulthovermenu.CollapsedMenuAnchor.anchor(CollapsedMenuAnchor.java:165)
at io.mattcarroll.hover.defaulthovermenu.MagnetPositioner.pullToAnchor(MagnetPositioner.java:76)
at io.mattcarroll.hover.defaulthovermenu.HoverMenuView.animateActiveTabToAnchorPosition(HoverMenuView.java:944)
at io.mattcarroll.hover.defaulthovermenu.HoverMenuView.access$2200(HoverMenuView.java:65)
at io.mattcarroll.hover.defaulthovermenu.HoverMenuView$10.run(HoverMenuView.java:400)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-30 19:40:50.021 937-1841/? W/ActivityManager: Force finishing activity io.mattcarroll.hoverdemonon_fullscreen/.MainActivity

Expo.io && Hover

Hello, I'm trying to use a hover with Expo.io and the application stuck before loading the Expo published app.

MainActivity.java

`import io.mattcarroll.hover.overlay.OverlayPermission;

public class MainActivity extends DetachActivity {`

...
`private static final int REQUEST_CODE_HOVER_PERMISSION = 1000;

private boolean mPermissionsRequested = false;

protected void onCreate(Bundle expBundle) {
super.onCreate(expBundle);
setContentView(R.layout.activity_main);

findViewById(R.id.button_launch_menu).setOnClickListener(new View.OnClickListener() {
  public void onClick(View v) {
    DemoHoverMenuService.showFloatingMenu(getApplication().getApplicationContext());
  }
});

// On Android M and above we need to ask the user for permission to display the Hover
// menu within the "alert window" layer.  Use OverlayPermission to check for the permission
// and to request it.
if (!mPermissionsRequested && !OverlayPermission.hasRuntimePermissionToDrawOverlay(this)) {
  @SuppressWarnings("NewApi")
  Intent myIntent = OverlayPermission.createIntentToRequestOverlayPermission(this);
  startActivityForResult(myIntent, REQUEST_CODE_HOVER_PERMISSION);
}

}`
...

When I remove it the app loads fine but if I apply that my app stuck's and the hover works fine.
I'm new with Android Studio and Detached App, can you help me? THANKS!!!

crash on runtime FATAL EXCEPTION: main

whats problem?

java.lang.RuntimeException: Cannot obtain HoverThemeManager before calling init().

FATAL EXCEPTION: main Process: com.izigaaps.myapplication, PID: 29811 java.lang.RuntimeException: Unable to start service com.izigaaps.myapplication.DemoHoverMenuService@41d70530 with Intent { cmp=com.izigaaps.myapplication/.DemoHoverMenuService }: java.lang.RuntimeException: Cannot obtain HoverThemeManager before calling init(). at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2883) at android.app.ActivityThread.access$2100(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5421) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:979) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.RuntimeException: Cannot obtain HoverThemeManager before calling init(). at com.izigaaps.myapplication.theming.HoverThemeManager.getInstance(HoverThemeManager.java:19) at com.izigaaps.myapplication.DemoHoverMenuFactory.createDemoMenuFromCode(DemoHoverMenuFactory.java:49) at com.izigaaps.myapplication.DemoHoverMenuService.createHoverMenu(DemoHoverMenuService.java:51) at com.izigaaps.myapplication.DemoHoverMenuService.onHoverMenuLaunched(DemoHoverMenuService.java:45) at io.mattcarroll.hover.window.HoverMenuService.initHoverMenu(HoverMenuService.java:118) at io.mattcarroll.hover.window.HoverMenuService.onStartCommand(HoverMenuService.java:88) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2866) at android.app.ActivityThread.access$2100(ActivityThread.java:151)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5421)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:979)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:795)  at dalvik.system.NativeStart.main(Native Method) 

Bug problem with the management of screen spaces

Hi @matthew-carroll, As you can see from the video a strange thing happens. The one with the image is messager it does not go beyond the spaces provided to it the behavior is correct. In the case of when I use Google hover, something strange happens, it goes out of space but you do not know where and it does not come back anymore, you can not take it anymore. The instance is not released, as you can see when I try to call another from within app.

Link:
https://drive.google.com/file/d/17ipKg4q-I8WnO_Z0cGscWKeNzcR32wdS/view?usp=drivesdk

Empty Packages on Dependency Download

When adding this library to my android project, gradle finishes the building and syncing tasks, but when I go to use the library, no classes are actually available. My IDE can see the packages and the R class, but everything else is missing. Any reason why this might occur?

Improvement: Play nicely with runtime permission dialogs

Currently Hover displays a full screen View even when nothing is visible. This ever present overlay leads to conflicts with runtime permission dialogs because Android won't allow runtime permissions to be granted when covered by an overlay.

Hover should be altered to collapse the overlay area when collapsed and closed. This way no overlap needs to occur with the permission dialogs and no conflict will arise.

create new tab programmatically after menu had been created with a tab

I'm useing kitchensink sample to make something like facebook messenger, so when Cloud notification recived i fire
DemoHoverMenuService.showFloatingMenu(getBaseContext(),user_id);
and there will be

private HoverMenu createHoverMenu() {
        try {
            mDemoHoverMenu = new DemoHoverMenuFactory().createDemoMenuFromCode(uid, getContextForHoverMenu(), Bus.getInstance());
        }
}

but its like nothing hapen i think the menu being created again instead of update it with the new id tap. so how this should be done
BS: Tons of thank for making this

[Help wanted] Different layout in landscape, similar Messenger

When in landscape mode, it seems that the content display is relatively small, when the keyboard is displayed, it will cover the content. So, I'm really looking forward to you doing the content display like Messenger, thank you very much.

Layout of Messenger

image

catched a crash.

E/AndroidRuntime: FATAL EXCEPTION: main
Process: io.mattcarroll.hover.hoverdemo, PID: 15843
java.lang.IllegalArgumentException: View=io.mattcarroll.hover.defaulthovermenu.HoverMenuView{42e09eb0 V.E..... ......ID 0,0-1080,1845} not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:389)
at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:304)
at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:74)
at io.mattcarroll.hover.defaulthovermenu.window.WindowViewController.makeTouchable(WindowViewController.java:93)
at io.mattcarroll.hover.defaulthovermenu.window.WindowHoverMenu$1.onExpanded(WindowHoverMenu.java:69)
at io.mattcarroll.hover.defaulthovermenu.HoverMenuView$11.run(HoverMenuView.java:445)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5335)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)

NavigatorContent showing behind tinted overlay

I succeeded in having my menu pop up, and having navigator content appear. However, my NavigatorContent appears behind the tinted overlay, instead of on top of it at the same level as the tab. Any reason why this might occur? I am using a HoverMenuView within an activity, and create the HoverMenuView programmatically, adding it to the end of my android.R.id.content ViewGroup from my Activity.

just a suggest

it would be exetremly useful and pretty if there was two method for creating hover menu
first one is already there
second one would be something like ramotion's circlemenu for specific situations where there's no need for a full screen menu
the circle menu is currently not supporting overlay and can only be used in an activity so if you can implement something like that to use in overlay and service mode that would be so nice
i already appreciate your hard work and i'm going to implement this beautiful library into one of my big projects
regards

Transition to AndroidX

We are transitioning our app to AndroidX and I think because we have forked and are using it as a project instead of a library, hover is having issues.

Would you accept a PR that moves hover over to use AndroidX?

EditText in content, keyboeard overlaying layout, params.softInputMode not affect

if i use edittext in content layout it is not adjusting when keyboard open, which is not usable at all in a chat head particulary. I tried to edit WindowViewController with
params.softInputMode = WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN
with and without FLAG_NOT_FOCUSABLE ..... with TYPE_PHONE and TYPE_SYSTEM_ALERT
on addView and showView
and in the content custom view
but nothing worked
can you please suggest what should i do
and thanks

Hover Menu elevation not working

Hi

I have built this library from the source from here, without any modifications, and the Hover Menu elevation seems not to work.

I found a line in the code that, if I'm not wrong, is supposed to set the elevation to the menu, but it doesn't seem to work.

This is how the Hover Menu looks like:

screenshot_20170122-120806 01

I'm using a device with Android 7.1.1 so the elevation should be properly set/viewed.

I hope you can fix it. Thanks in advance.

CoordinatorLayout inside content

Is it possible to use CoordinatorLayout inside content Im passing to HoverView?
As of now it is giving me an error that I should use Theme.AppCompat.

I tried setting without success

  @Override
    protected Context getContextForHoverMenu() {
        return new ContextThemeWrapper(this, R.style.AppTheme);
    }

Issue when running demo

How can i fix the issue below:

java.lang.RuntimeException: Cannot obtain HoverThemeManager before calling init().

How to increase hover tab size

Hello sir, I want to know how to modify the size of the hover tab. I personally think that the default tab_size is small.
Thank you in advance.

Screen overlay detected

When the floating menu is running, other apps can not request permissions. When I request permissions on my another app, the permission dialog came up. No matter I choose deny or allow. The infamous "Screen overlay detected" appeared.

Can't compile hoverdemo apps

I get the following error when compiling the project:

Error:Could not find com.android.tools.build:gradle:3.0.0-alpha4.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.pom
file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha4/gradle-3.0.0-alpha4.jar
Required by:
project :

How to close

How to close hover menu on button click inside the hover menu. Please reply............

Can't find BaseHoverMenuAdapter

Hey there, i'm trying to implement your awesome library into my app but i can't seem to find the BaseHoverMenuAdapter superclass, is it based on an older version or am i missing something?

Thanks

image

Hard drag to bottom permanently removes hover menu.

Steps to reproduce:
Hard drag hover view to the bottom of the screen and hover view will disappear.
After that, if you try to launch hover menu, it will not be visible anywhere on the screen. One would have to clear app data to get it back

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.