티스토리 뷰

android

Navigation - Part 1

구름나드리 2018. 9. 28. 10:47


part 1 - Menu & Activity Theme 





Video:

youtube.com/watch?v=fGcMLu1GJEc

Design Support Library:


developer.android.com/topic/libraries/support-library/packages.html#design


AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kr.co.devatom.myapplication">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:theme="@style/AppTheme.NoAction">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>

: theme  설정 



styles.xml

<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoAction">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
</resources>


--> styles.xml 에 AppThem.NoAction  생성 androidManifest.xml  에 MainActvity에 정의 




메뉴폴더 생성 




menu/drawer_menu.xml 

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:showIn="">
<group android:checkableBehavior="single">

<item
android:id="@+id/nav_message"
android:title="Message"
android:icon="@drawable/ic_message" />

<item
android:id="@+id/nav_chat"
android:title="chat"
android:icon="@drawable/ic_chat" />

<item
android:id="@+id/nav_folder"
android:title="folder"
android:icon="@drawable/ic_folder" />

<item
android:id="@+id/nav_wc"
android:title="wc"
android:icon="@drawable/ic_wc_black_24dp" />
</group>


<item android:title="Communicate">
<menu>
<item
android:id="@+id/nav_send"
android:icon="@drawable/ic_send_black_24dp"
android:title="send"></item>
<item
android:id="@+id/nav_ondemand"
android:icon="@drawable/ic_ondemand"
android:title="ondemand"></item>
</menu>
</item>
</menu>


아이콘 생성 방법 



'android' 카테고리의 다른 글

BottomNavigationView  (0) 2018.10.04
Navigation - Part 2  (0) 2018.09.28
21 RelativeLayout  (0) 2018.08.16
20. permission 활용(소스)  (0) 2018.08.16
19. permission 개념  (0) 2018.08.16
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
글 보관함