Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0d5ccd3 authored by Matthew Ng's avatar Matthew Ng
Browse files

Remove plugin logical from NavigationBarView (1/2)

Fixes: 129860064
Test: manual
Change-Id: I8cfa77cf40f62ab1e5f1ad8d1957107aca1557f2
parent cd58d5a5
Loading
Loading
Loading
Loading
+0 −56
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * 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.
 */

package com.android.systemui.plugins.statusbar.phone;

import android.annotation.Nullable;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;

import com.android.systemui.plugins.Plugin;
import com.android.systemui.plugins.annotations.ProvidesInterface;

@ProvidesInterface(action = NavBarButtonProvider.ACTION, version = NavBarButtonProvider.VERSION)
public interface NavBarButtonProvider extends Plugin {

    public static final String ACTION = "com.android.systemui.action.PLUGIN_NAV_BUTTON";

    public static final int VERSION = 2;

    /**
     * Returns a view in the nav bar.  If the id is set "back", "home", "recent_apps", "menu",
     * or "ime_switcher", it is expected to implement ButtonInterface.
     */
    public View createView(String spec, ViewGroup parent);

    /**
     * Interface for button actions.
     */
    interface ButtonInterface {

        void setImageDrawable(@Nullable Drawable drawable);

        void abortCurrentGesture();

        void setVertical(boolean vertical);

        default void setCarMode(boolean carMode) {
        }

        void setDarkIntensity(float intensity);

        void setDelayTouchFeedback(boolean shouldDelay);
    }
}
+0 −54
Original line number Diff line number Diff line
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * 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.
 */

package com.android.systemui.plugins.statusbar.phone;

import android.graphics.Canvas;
import android.view.MotionEvent;
import android.view.View;

import com.android.systemui.plugins.Plugin;
import com.android.systemui.plugins.annotations.ProvidesInterface;
import java.io.PrintWriter;

@ProvidesInterface(action = NavGesture.ACTION, version = NavGesture.VERSION)
public interface NavGesture extends Plugin {

    public static final String ACTION = "com.android.systemui.action.PLUGIN_NAV_GESTURE";

    public static final int VERSION = 1;

    public GestureHelper getGestureHelper();

    public interface GestureHelper {
        public boolean onTouchEvent(MotionEvent event);

        public boolean onInterceptTouchEvent(MotionEvent event);

        public void setBarState(boolean isRtl, int navBarPosition);

        public void onDraw(Canvas canvas);

        public void onDarkIntensityChange(float intensity);

        public void onLayout(boolean changed, int left, int top, int right, int bottom);

        public void onNavigationButtonLongPress(View v);

        public default void destroy() { }

        public default void dump(PrintWriter pw) { }
    }

}
+0 −27
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2016 The Android Open Source Project

     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.
-->
<com.android.systemui.tuner.PreviewNavInflater
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:systemui="http://schemas.android.com/apk/res-auto"
    android:background="@android:color/black"
    android:layout_width="match_parent"
    android:layout_height="@dimen/navigation_bar_size">

    <include android:id="@+id/horizontal" layout="@layout/navigation_layout" />

    <include android:id="@+id/vertical" layout="@layout/navigation_layout_vertical" />

</com.android.systemui.tuner.PreviewNavInflater>
+0 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.animation.ValueAnimator;
import android.view.View;
import android.view.View.AccessibilityDelegate;

import com.android.systemui.plugins.statusbar.phone.NavBarButtonProvider.ButtonInterface;
import com.android.systemui.statusbar.policy.KeyButtonDrawable;

import java.util.ArrayList;
+33 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * 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
 */

package com.android.systemui.statusbar.phone;

import android.annotation.Nullable;
import android.graphics.drawable.Drawable;

public interface ButtonInterface {

    void setImageDrawable(@Nullable Drawable drawable);

    void abortCurrentGesture();

    void setVertical(boolean vertical);

    void setDarkIntensity(float intensity);

    void setDelayTouchFeedback(boolean shouldDelay);
}
Loading