Android Open Source - android-sliding-panel-layout Main Activity






From Project

Back to project page android-sliding-panel-layout.

License

The source code is released under:

Apache License

If you think the Android project android-sliding-panel-layout listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.demondevelopers.slidingpanelexample;
/*  www  .  j a v a2s .co  m*/
import com.demondeveloprs.slidingpanellayout.SlideUpPanelLayout;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;


public class MainActivity extends FragmentActivity
{
  @Override
  protected void onCreate(Bundle savedInstanceState)
  {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    final SlideUpPanelLayout layout = (SlideUpPanelLayout)findViewById(R.id.slide_layout);
    findViewById(R.id.content).setOnClickListener(new View.OnClickListener()
    {
      @Override
      public void onClick(View v)
      {
        if(layout.getPanelState() == SlideUpPanelLayout.PanelState.HIDDEN){
          layout.showHandle();
        }
        else{
          layout.hideHandle();
        }
      }
    });
  }
}




Java Source Code List

com.demondevelopers.slidingpanelexample.MainActivity.java
com.demondeveloprs.slidingpanellayout.SlideUpPanelLayout.java