Skip to content

Commit

Permalink
Use NavigationView instead of ListView
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentaro Takiguchi committed May 29, 2015
1 parent b3cfb0a commit c4b59b0
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
android:theme="@style/AppTheme">
<activity
android:name=".activities.MainActivity"
android:theme="@style/AppTheme.NoStatusBar"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import rejasupotaro.mds.view.components.SearchView;
import rx.Subscription;
import rx.android.app.AppObservable;
import rx.functions.Action1;
import rx.subscriptions.Subscriptions;

public class MainActivity extends BaseActivity {
Expand Down
18 changes: 9 additions & 9 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->

<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
Expand All @@ -18,16 +19,15 @@
<rejasupotaro.mds.view.components.SearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_marginTop="24dp" />
</FrameLayout>
<!-- The navigation drawer -->
<ListView
android:id="@+id/left_drawer"
android:layout_width="240dp"

<android.support.design.widget.NavigationView
android:id="@+id/navigation_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="@android:color/white"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />
app:headerLayout="@layout/navigation_header" />
</android.support.v4.widget.DrawerLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/list_header_channel_recipe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/item_list_header_height"
android:layout_height="260dp"
android:scaleType="centerCrop"
android:src="@drawable/recipe" />

Expand Down
16 changes: 16 additions & 0 deletions app/src/main/res/layout/navigation_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="192dp"
android:background="?attr/colorPrimaryDark"
android:gravity="bottom"
android:orientation="vertical"
android:padding="16dp"
android:theme="@style/ThemeOverlay.AppCompat.Dark">

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="rejasupotaro"
android:textAppearance="@style/TextAppearance.AppCompat.Body1" />

</LinearLayout>
1 change: 0 additions & 1 deletion app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
<dimen name="text_size_xsmall">14sp</dimen>
<dimen name="text_size_xxsmall">12sp</dimen>

<dimen name="item_list_header_height">240dp</dimen>
<dimen name="pager_tab_height">48dp</dimen>
</resources>

0 comments on commit c4b59b0

Please sign in to comment.