Search in sources :

Example 1 with BaseScene

use of com.hippo.ehviewer.ui.scene.BaseScene in project EhViewer by seven332.

the class MainActivity method onSceneViewCreated.

@Override
public void onSceneViewCreated(SceneFragment scene, Bundle savedInstanceState) {
    super.onSceneViewCreated(scene, savedInstanceState);
    if (scene instanceof BaseScene && mRightDrawer != null && mDrawerLayout != null) {
        BaseScene baseScene = (BaseScene) scene;
        mRightDrawer.removeAllViews();
        View drawerView = baseScene.createDrawerView(baseScene.getLayoutInflater2(), mRightDrawer, savedInstanceState);
        if (drawerView != null) {
            mRightDrawer.addView(drawerView);
            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, Gravity.RIGHT);
        } else {
            mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, Gravity.RIGHT);
        }
    }
}
Also used : BaseScene(com.hippo.ehviewer.ui.scene.BaseScene) View(android.view.View) LoadImageView(com.hippo.widget.LoadImageView) TextView(android.widget.TextView) NavigationView(com.google.android.material.navigation.NavigationView)

Example 2 with BaseScene

use of com.hippo.ehviewer.ui.scene.BaseScene in project EhViewer by seven332.

the class MainActivity method onSceneViewDestroyed.

@Override
public void onSceneViewDestroyed(SceneFragment scene) {
    super.onSceneViewDestroyed(scene);
    if (scene instanceof BaseScene) {
        BaseScene baseScene = (BaseScene) scene;
        baseScene.destroyDrawerView();
    }
}
Also used : BaseScene(com.hippo.ehviewer.ui.scene.BaseScene)

Aggregations

BaseScene (com.hippo.ehviewer.ui.scene.BaseScene)2 View (android.view.View)1 TextView (android.widget.TextView)1 NavigationView (com.google.android.material.navigation.NavigationView)1 LoadImageView (com.hippo.widget.LoadImageView)1