Dev::Android

SlidingMenu Library Setup

bluemong 2013. 10. 10. 21:47
반응형

1. https://github.com/jfeinstein10/slidingmenu 에서 Project Download (Download ZIP )


2. http://actionbarsherlock.com/ 에서 ActionBarSerock Project Download (Download ZIP)


3. 각 Project 압축 해제


4. Import actionbarsherock

     ex. \JakeWharton-ActionBarSherlock-4.4.0-0-g4a79d53\JakeWharton-ActionBarSherlock-5a15d92\actionbarsherlock


5. Import SlideMenu

     ex. \SlidingMenu-master\SlidingMenu-master\library


6. SlideMenu Project Setting

     - library Project > Properties > Android > Library > Add > actionbarsherlock 추가

     - library Project > Properties > Java Build Path > Add External JARs... > android-support-v4.jar 추가

          Path Ex. C:\Program Files (x86)\Android\android-sdk\extras\android\support\v4\android-support-v4.jar


7. com.jeremyfeinstein.slidingmenu.lib.app 아래에 있는 다음 Activity들 수정

     7.1 SlidingActivity.java

          import com.actionbarsherlock.app.*;

          extends Activity -> extends SherlockActivity


     7.2 SlidingFragmentActivity.java

          import com.actionbarsherlock.app.*;

          extends FragmentActivity -> extends SherlockFragmentActivity


     7.3 SlidingListActivity.java

          import com.actionbarsherlock.app.*;

          extends ListActivity -> extends SherlockListActivity


     7.4 SlidingPreferenceActivity.java

          import com.actionbarsherlock.app.*;

          extends PreferenceActivity -> extends SherlockPreferenceActivity


8. SlideMenu Sample 설치

     8.1 Import \SlidingMenu-master\SlidingMenu-master\example

     

     8.2 ExampleListActivity Project Setting

          8.2.1 Properties > Android > Library 에서 Add Button 선택해서 actionbarsherlock, library(SlidingMenu library - 설정이 되어 있지 않은 경우) 추가

          8.2.2 Properties > Java Build Path > Add External JARs... > android-support-v4.jar 추가

                    Path Ex. C:\Program Files (x86)\Android\android-sdk\extras\android\support\v4\android-support-v4.jar

          8.2.3 Properties > Java Build Path > Order and Export > android-support-v4.jar CheckBox Check


9.  Project에 적용

     9.1 Properties > Android > Library

          - actionbarsherlock 추가

          - library (SlidingMenu library) 추가

     9.2 Properties > Java Build Path > Add External JARs... > android-support-v4.jar 추가

          Path Ex. C:\Program Files (x86)\Android\android-sdk\extras\android\support\v4\android-support-v4.jar

     9.3 Properties > Java Build Path > Order and Export > android-support-v4.jar CheckBox Check


# 주의사항

     - SlidingMenu 적용 Activity는 Manifest에 theme를 지정해야 한다.

       theme를 지정하지 않으면 2.3.3 Gingerbread에서는 Activity가 정상 동작하지 않는다.

       ex. <activity android:name="TestActivity" android:theme="@style/Theme.Sherlock.Light" />

               Theme.Sherlock, Theme.Sherlock.Light, Theme.Sherlock.Light.DarkActionBar



'Dev::Android' 카테고리의 다른 글

SlidingMenu Library Setup  (3) 2013.10.10
키보드 완료/확인/다음 버튼에 이벤트 설정  (0) 2013.10.07
Activity 시작 시 키보드 표시  (0) 2013.10.07
Activity 타이틀바 제거  (0) 2013.09.27
Activity 전환  (0) 2013.09.27
Vibrator.vibrate  (0) 2013.08.08