Giter Club home page Giter Club logo

Comments (5)

jahirfiquitiva avatar jahirfiquitiva commented on August 15, 2024

@ZetDeveloper

You can use the service

from hover.

ZetDeveloper avatar ZetDeveloper commented on August 15, 2024

@jahirfiquitiva iam usign service, but when close app, hover close and reestar hover alfer seconds.
iam keep hover open when user killed app.

from hover.

jahirfiquitiva avatar jahirfiquitiva commented on August 15, 2024

@ZetDeveloper
Well, yeah, it works like that for now (at least it does for me too). Anyways, it does work when app has been closed/killed.

from hover.

ZetDeveloper avatar ZetDeveloper commented on August 15, 2024

i'm fix mi problem:

add this code in HoverMenuService:

``Notification serviceNotification;;
NotificationManager notificationManager;

public void showNotification() {
    CharSequence tickerText = "asdads";
    CharSequence tickerContent = BuildConfig.VERSION_NAME;
    PendingIntent downloadManagerPendingIntent = PendingIntent.getActivity(this, 0, new Intent("android.intent.action.VIEW_DOWNLOADS").addFlags(1073741824).addFlags(67108864), 0);

    Application application = getApplication();
    getApplication();
    this.notificationManager = (NotificationManager) application.getSystemService(Context.NOTIFICATION_SERVICE);

    this.serviceNotification =  new NotificationCompat.Builder(this)
            .setSmallIcon(R.mipmap.ic_launcher)
            .setContentTitle("Hover active")
            .setContentText("1 tab")
            .setOngoing(false).setPriority(-2).build();
    startForeground(7524583, this.serviceNotification);
}

and call showNotification in onCreate():

    public void onCreate() {
        Log.d(TAG, "onCreate()");

        showNotification();

        mPrefs = getSharedPreferences(PREF_FILE, Context.MODE_PRIVATE);

        mHoverMenu = new HoverMenuBuilder(getContextForHoverMenu())
                .displayWithinWindow()
                .useNavigator(createNavigator())
                .useAdapter(createHoverMenuAdapter())
                .restoreVisualState(loadPreferredLocation())
                .build();
        mHoverMenu.addOnExitListener(mWindowHoverMenuMenuExitListener);
    }

from hover.

matthew-carroll avatar matthew-carroll commented on August 15, 2024

If you would like your Hover menu to live outside of your main application then what you will need to do is have your Hover menu run in its own process. That way it isn't tied to your main application process - your app can die and it won't effect your menu.

from hover.

Related Issues (20)

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.