Java Code Examples for com.sothree.slidinguppanel.SlidingUpPanelLayout#PanelState

The following examples show how to use com.sothree.slidinguppanel.SlidingUpPanelLayout#PanelState . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ScannerActivity.java    From attendee-checkin with Apache License 2.0 6 votes vote down vote up
@Override
public void onGlobalLayout() {
    SlidingUpPanelLayout.PanelState state = mPanelLayout.getPanelState();
    if (state == SlidingUpPanelLayout.PanelState.COLLAPSED) {
        for (int i = 1; i < mTabs.length; i++) {
            mTabs[i].setAlpha(0.f);
        }
        mTabs[0].setTextColor(mColorTabSelected);
        mTabs[0].setTranslationX(TIMELINE_TRANSLATION_X);
        ViewCompat.setTranslationZ(mTabLayout, 0);
        mTabLayout.setEnabled(false);
        mTabLayout.setTabIndicatorColor(Color.TRANSPARENT);
    } else if (state == SlidingUpPanelLayout.PanelState.EXPANDED) {
        for (int i = 1; i < mTabs.length; i++) {
            mTabs[i].setAlpha(1.f);
        }
        mTabs[0].setTranslationX(0.f);
        ViewCompat.setTranslationZ(mTabLayout, mToolbarElevation);
        mTabLayout.setEnabled(true);
        mTabLayout.setTabIndicatorColor(mColorTabIndicator);
    }
    mTabLayout.getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
 
Example 2
Source File: BaseActivity.java    From SkyTube with GNU General Public License v3.0 6 votes vote down vote up
private SlidingUpPanelLayout.PanelSlideListener getOnPanelDisplayed(final int position, final int duration) {
	return new SlidingUpPanelLayout.PanelSlideListener() {
		@Override
		public void onPanelSlide(View view, float v) {

		}

		@Override
		public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
			if (newState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
				chromecastMiniControllerFragment.setDuration(duration);
				chromecastMiniControllerFragment.setProgress(position);
				chromecastControllerFragment.setDuration(duration);
				chromecastControllerFragment.setProgress(position);
				slidingLayout.removePanelSlideListener(this);
			}
		}
	};
}
 
Example 3
Source File: CardPlayerFragment.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case ANCHORED:
            slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 4
Source File: EspressoTestUtils.java    From Kore with Apache License 2.0 5 votes vote down vote up
/**
 * Waits for 10 seconds till panel has given state.
 *
 * @param panelState desired state of panel
 */
public static void waitForPanelState(final SlidingUpPanelLayout.PanelState panelState) {
    onView(isRoot()).perform(ViewActions.waitForView(R.id.now_playing_panel, new ViewActions.CheckStatus() {
        @Override
        public boolean check(View v) {
            return ((SlidingUpPanelLayout) v).getPanelState() == panelState;
        }
    }, 10000));
}
 
Example 5
Source File: CardPlayerFragment.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case ANCHORED:
            slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 6
Source File: AbsSlidingMusicPanelActivity.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case EXPANDED:
            onPanelExpanded(panel);
            break;
        case ANCHORED:
            collapsePanel(); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 7
Source File: CardPlayerFragment.java    From VinylMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case ANCHORED:
            slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 8
Source File: AbsSlidingMusicPanelActivity.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case EXPANDED:
            onPanelExpanded(panel);
            break;
        case ANCHORED:
            collapsePanel(); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 9
Source File: CardPlayerFragment.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case ANCHORED:
            slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 10
Source File: FlatPlayerFragment.java    From Orin with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case ANCHORED:
            //noinspection ConstantConditions
            slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 11
Source File: SlidingUpPanelLayoutAdapter.java    From android-transition with Apache License 2.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    if (newState == SlidingUpPanelLayout.PanelState.COLLAPSED) {
        getAdapterState().setState(AdapterState.CLOSE);
    } else if (newState == SlidingUpPanelLayout.PanelState.EXPANDED) {
        getAdapterState().setState(AdapterState.OPEN);
    }
    stopTransition();
    mListener.onPanelStateChanged(panel, previousState, newState);
}
 
Example 12
Source File: AbsSlidingMusicPanelActivity.java    From Phonograph with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case EXPANDED:
            onPanelExpanded(panel);
            break;
        case ANCHORED:
            collapsePanel(); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 13
Source File: AbsSlidingMusicPanelActivity.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case EXPANDED:
            onPanelExpanded(panel);
            break;
        case ANCHORED:
            collapsePanel(); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 14
Source File: FlatPlayerFragment.java    From Music-Player with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    switch (newState) {
        case COLLAPSED:
            onPanelCollapsed(panel);
            break;
        case ANCHORED:
            //noinspection ConstantConditions
            slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED); // this fixes a bug where the panel would get stuck for some reason
            break;
    }
}
 
Example 15
Source File: AbsSlidingMusicPanelActivity.java    From Orin with GNU General Public License v3.0 4 votes vote down vote up
public SlidingUpPanelLayout.PanelState getPanelState() {
    return slidingUpPanelLayout == null ? null : slidingUpPanelLayout.getPanelState();
}
 
Example 16
Source File: MainActivity.java    From redgram-for-reddit with GNU General Public License v3.0 4 votes vote down vote up
@Override
public SlidingUpPanelLayout.PanelState getPanelState() {
    return getSlidingUpPanelLayout().getPanelState();
}
 
Example 17
Source File: DialogPanelSlideListener.java    From android-transition with Apache License 2.0 4 votes vote down vote up
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState, SlidingUpPanelLayout.PanelState newState) {
    if (newState == SlidingUpPanelLayout.PanelState.EXPANDED) {
        mActivity.getPreferences(0).edit().putBoolean("dialog", false).commit();
    }
}
 
Example 18
Source File: AbsSlidingMusicPanelActivity.java    From RetroMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
public SlidingUpPanelLayout.PanelState getPanelState() {
    return mSlidingUpPanelLayout == null ? null : mSlidingUpPanelLayout.getPanelState();
}
 
Example 19
Source File: AbsSlidingMusicPanelActivity.java    From Phonograph with GNU General Public License v3.0 4 votes vote down vote up
public SlidingUpPanelLayout.PanelState getPanelState() {
    return slidingUpPanelLayout == null ? null : slidingUpPanelLayout.getPanelState();
}
 
Example 20
Source File: SlidingPanelControllerInterface.java    From redgram-for-reddit with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Panel State
 *
 * @return
 */
public SlidingUpPanelLayout.PanelState getPanelState();