Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few questions about the toolbar... #2

Closed
AndroidDeveloperLB opened this issue Oct 20, 2014 · 3 comments
Closed

A few questions about the toolbar... #2

AndroidDeveloperLB opened this issue Oct 20, 2014 · 3 comments

Comments

@AndroidDeveloperLB
Copy link

I have a few questions regarding the toolbar (which acts as an actionbar) :

  1. How would you add the cool animations of the "up" button when being clicked?
  2. How would you make the navigation drawer to avoid being on top of the action bar ?
  3. How would you put it in PreferenceActivity (for pre-API11 versions), if you can't extend from PreferenceActivity (as you must extend from ActionBarActivity) ?
    You can't even use PreferenceFragment, as it's from API 11 and above... ?

Please help.

@AndroidDeveloperLB AndroidDeveloperLB changed the title questions about the toolbar... A few questions about the toolbar... Oct 20, 2014
@AndroidDeveloperLB
Copy link
Author

About #2, that was actually quite easy. I just changed the layout file of "activity_home.xml" to this:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <include
            android:id="@+id/toolbar"
            layout="@layout/toolbar" />

        <android.support.v4.widget.DrawerLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:id="@+id/drawer"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            tools:context=".HomeActivity" >

            <GridView
                android:id="@+id/gridView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clipToPadding="false"
                android:columnWidth="@dimen/item_width"
                android:horizontalSpacing="4dp"
                android:numColumns="auto_fit"
                android:padding="4dp"
                android:stretchMode="columnWidth"
                android:verticalSpacing="4dp" />

            <ListView
                android:layout_width="260dp"
                android:layout_height="match_parent"
                android:layout_gravity="start"
                android:background="@color/windowBackgroundColor" />
        </android.support.v4.widget.DrawerLayout>

    </LinearLayout>

@antoniolg
Copy link
Owner

How would you add the cool animations of the "up" button when being clicked?

You can achieve it using the new ActionBarDrawerToggle (https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.html)

How would you put it in PreferenceActivity (for pre-API11 versions)

I don't know of a way for previous versions. Maybe look for a supported PreferenceFragment out there.

@AndroidDeveloperLB
Copy link
Author

About the "up" animations, correct.
about the PreferecenActivity, I've made a library if you wish:
https://github.com/AndroidDeveloperLB/MaterialStuffLibrary

On Sun, Oct 26, 2014 at 10:32 AM, Antonio Leiva notifications@github.com
wrote:

How would you add the cool animations of the "up" button when being
clicked?

You can achieve it using the new ActionBarDrawerToggle (
https://developer.android.com/reference/android/support/v7/app/ActionBarDrawerToggle.html
)

How would you put it in PreferenceActivity (for pre-API11 versions)

I don't know of a way for previous versions. Maybe look for a supported
PreferenceFragment out there.


Reply to this email directly or view it on GitHub
#2 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants