android.widget.SlidingDrawer Java Examples

The following examples show how to use android.widget.SlidingDrawer. 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: Setter.java    From AndroidRipper with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 * Sets the status of a given SlidingDrawer. Examples are Solo.CLOSED and Solo.OPENED.
 *
 * @param slidingDrawer the {@link SlidingDrawer}
 * @param status the status that the {@link SlidingDrawer} should be set to
 */

public void setSlidingDrawer(final SlidingDrawer slidingDrawer, final int status){
	if(slidingDrawer != null){
		Activity activity = activityUtils.getCurrentActivity(false);
		if(activity != null){
			activity.runOnUiThread(new Runnable()
			{
				public void run()
				{
					try{
						switch (status) {
						case CLOSED:
							slidingDrawer.close();
							break;
						case OPENED:
							slidingDrawer.open();
							break;
						}
					}catch (Exception ignored){}
				}
			});
		}
	}
}
 
Example #2
Source File: Solo.java    From AndroidRipper with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Sets the status of a SlidingDrawer matching the specified index. Examples of status are: {@code Solo.CLOSED} and {@code Solo.OPENED}.
 *
 * @param index the index of the {@link SlidingDrawer}
 * @param status the status to set the {@link SlidingDrawer}
 */

public void setSlidingDrawer(int index, int status){
	if(config.commandLogging){
		Log.d(config.commandLoggingTag, "setSlidingDrawer("+index+", "+status+")");
	}
	
	setSlidingDrawer(waiter.waitForAndGetView(index, SlidingDrawer.class), status);
}
 
Example #3
Source File: WrappingSlidingDrawer.java    From utexas-utilities with Apache License 2.0 5 votes vote down vote up
public WrappingSlidingDrawer(Context context, AttributeSet attrs) {
    super(context, attrs);

    int orientation = attrs
            .getAttributeIntValue("android", "orientation", ORIENTATION_VERTICAL);
    mTopOffset = attrs.getAttributeIntValue("android", "topOffset", 0);
    mVertical = (orientation == SlidingDrawer.ORIENTATION_VERTICAL);
}
 
Example #4
Source File: WrappingSlidingDrawer.java    From utexas-utilities with Apache License 2.0 5 votes vote down vote up
public WrappingSlidingDrawer(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    int orientation = attrs
            .getAttributeIntValue("android", "orientation", ORIENTATION_VERTICAL);
    mTopOffset = attrs.getAttributeIntValue("android", "topOffset", 0);
    mVertical = (orientation == SlidingDrawer.ORIENTATION_VERTICAL);
}
 
Example #5
Source File: SlidingDrawerAssert.java    From assertj-android with Apache License 2.0 4 votes vote down vote up
public SlidingDrawerAssert(SlidingDrawer actual) {
  super(actual, SlidingDrawerAssert.class);
}
 
Example #6
Source File: PlaybackActivity.java    From android-vlc-remote with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.main);
    
    // Set the control stream to STREAM_MUSIC to suppress system beeps
    // that sound even when the activity handles volume key events.
    setVolumeControlStream(AudioManager.STREAM_MUSIC);

    Preferences pref = Preferences.get(this);
    isHideDVDTab = pref.isHideDVDTabSet();
    String authority = pref.getAuthority();
    if (authority != null) {
        mMediaServer = new MediaServer(this, authority);
        setServerSubtitle(pref.isServerSubtitleSet());
    }
    
    mFlipper = (ViewFlipper) findViewById(R.id.flipper);
    mPager = (LockableViewPager) findViewById(R.id.pager);
    mTabHost = (TabHost) findViewById(android.R.id.tabhost);
    mVolumePanel = new VolumePanel(this);
    
    BrowseFragment browse = null;
    FragmentUtil fu = new FragmentUtil(getSupportFragmentManager());
    fu.findOrAddFragment(Tags.FRAGMENT_STATUS, StatusFragment.class);
    
    if(mTabHost == null) {
        fu.findOrReplaceOptionalFragment(this, R.id.fragment_navigation, Tags.FRAGMENT_NAVIGATION, NavigationFragment.class);
        fu.findOrReplaceFragment(R.id.fragment_playlist, Tags.FRAGMENT_PLAYLIST, PlaylistFragment.class);
        browse = fu.findOrReplaceFragment(R.id.fragment_browse, Tags.FRAGMENT_BROWSE, BrowseFragment.class);
        fu.findOrReplaceFragment(R.id.fragment_playback, Tags.FRAGMENT_PLAYBACK, PlaybackFragment.class);
        fu.findOrReplaceFragment(R.id.fragment_info, Tags.FRAGMENT_INFO, InfoFragment.class);
        fu.findOrReplaceOptionalFragment(this, R.id.fragment_art, Tags.FRAGMENT_ART, ArtFragment.class);
        fu.findOrReplaceFragment(R.id.fragment_buttons, Tags.FRAGMENT_BUTTONS, ButtonsFragment.class);
        VolumeFragment mVolume = fu.findOrReplaceFragment(R.id.fragment_volume, Tags.FRAGMENT_VOLUME, VolumeFragment.class);
        setVolumeFragmentVisible(mVolume != null);
    } else {
        setupTabHost();
        mPager.setOffscreenPageLimit(4);
        mPager.setAdapter(new ViewPagerAdapter(getSupportFragmentManager(), pref.isHideDVDTabSet()));
        mPager.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
            @Override
            public void onPageSelected(int position) {
                mTabHost.setCurrentTab(position);
            }
        });
        if(savedInstanceState != null) {
            fu.removeFragmentsByTag(
                Tags.FRAGMENT_PLAYBACK, Tags.FRAGMENT_INFO, Tags.FRAGMENT_BUTTONS,
                Tags.FRAGMENT_VOLUME, Tags.FRAGMENT_BOTTOMBAR, Tags.FRAGMENT_BROWSE,
                Tags.FRAGMENT_NAVIGATION, Tags.FRAGMENT_PLAYLIST
            );
        }
    }

    mDrawer = (SlidingDrawer) findViewById(R.id.drawer);
    if (mDrawer != null) {
        BrowseDrawerListener listener = new BrowseDrawerListener(this, mDrawer, browse);
        mDrawer.setOnDrawerOpenListener(listener);
        mDrawer.setOnDrawerCloseListener(listener);
    }
    
    if (savedInstanceState == null) {
        onNewIntent(getIntent());
    } else {
        notifyMediaServerListeners();
    }
}
 
Example #7
Source File: BrowseDrawerListener.java    From android-vlc-remote with GNU General Public License v3.0 4 votes vote down vote up
public BrowseDrawerListener(Activity activity, SlidingDrawer drawer, BrowseFragment browse) {
    mActivity = activity;
    mDrawer = drawer;
    mBrowse = browse;
}
 
Example #8
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void onDrawerScroll(SlidingDrawer.OnDrawerScrollListener arg) {
  return BaseDSL.attr("onDrawerScroll", arg);
}
 
Example #9
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void onDrawerOpen(SlidingDrawer.OnDrawerOpenListener arg) {
  return BaseDSL.attr("onDrawerOpen", arg);
}
 
Example #10
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void onDrawerClose(SlidingDrawer.OnDrawerCloseListener arg) {
  return BaseDSL.attr("onDrawerClose", arg);
}
 
Example #11
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void slidingDrawer(Anvil.Renderable r) {
  return BaseDSL.v(SlidingDrawer.class, r);
}
 
Example #12
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static BaseDSL.ViewClassResult slidingDrawer() {
  return BaseDSL.v(SlidingDrawer.class);
}
 
Example #13
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void onDrawerScroll(SlidingDrawer.OnDrawerScrollListener arg) {
  return BaseDSL.attr("onDrawerScroll", arg);
}
 
Example #14
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void onDrawerOpen(SlidingDrawer.OnDrawerOpenListener arg) {
  return BaseDSL.attr("onDrawerOpen", arg);
}
 
Example #15
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void onDrawerClose(SlidingDrawer.OnDrawerCloseListener arg) {
  return BaseDSL.attr("onDrawerClose", arg);
}
 
Example #16
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static Void slidingDrawer(Anvil.Renderable r) {
  return BaseDSL.v(SlidingDrawer.class, r);
}
 
Example #17
Source File: DSL.java    From anvil with MIT License 4 votes vote down vote up
public static BaseDSL.ViewClassResult slidingDrawer() {
  return BaseDSL.v(SlidingDrawer.class);
}