Git Product home page Git Product logo

crossfadedrawerlayout's People

Contributors

mikepenz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crossfadedrawerlayout's Issues

Empty mini drawer

I implemented It, but when I open The mini drawer, i get an empty one. Only account header image.

CrossFade cannot scroll

It seems that when the number of items in the sample app CrossfadeDrawerLayoutActvitiy increases till it is possible to scroll, scrolling the drawer is not possible at all.

Cross fade / mini drawer issue

Hi,

The mini drawer have an issue with the cross fader, i don't know if it come from the drawer or the cross fader.

When for the first time you build those, the click listener will be active for the items on the drawer (pane) even if its closed. The bug only appear the first tim i.e. if you open then close the pane everything works at it should. You can reproduce the bug on your demo its not coming from me bad using your lib.

I tried to open then close the pane by code it but it only work by swipe.

I've a quick fix consisting of adding and deleting listener for mini and normal drawer when pane is closed/opended but i'am still able to see click animations so the bug is still there.

Drawer icon is not visible

Hi @mikepenz how to enable drawer hamburger icon i have added withActionBarDrawerToggle true like this

 result = new DrawerBuilder()
                .withActivity(this)
                .withActionBarDrawerToggle(true)
                .withToolbar(toolbar)
                .withDrawerLayout(crossfadeDrawerLayout)
                .withHasStableIds(true)
                .withDrawerWidthDp(72)
                .withAccountHeader(headerResult) //set the AccountHeader we created earlier for the header
                .addDrawerItems(
                        new PrimaryDrawerItem().withName(R.string.drawer_item_first).withIcon(GoogleMaterial.Icon.gmd_wb_sunny).withIdentifier(1),
                        new PrimaryDrawerItem().withName(R.string.drawer_item_second).withIcon(FontAwesome.Icon.faw_home).withIdentifier(2),
                        new PrimaryDrawerItem().withName(R.string.drawer_item_third).withIcon(FontAwesome.Icon.faw_gamepad).withIdentifier(3),
                        new PrimaryDrawerItem().withName(R.string.drawer_item_fourth).withIcon(FontAwesome.Icon.faw_eye).withIdentifier(4).withBadge("5"),
                        new PrimaryDrawerItem().withName(R.string.drawer_item_fifth).withDescription("A more complex sample").withIcon(GoogleMaterial.Icon.gmd_adb).withIdentifier(5),
                        new PrimaryDrawerItem().withName(R.string.drawer_item_sixth).withIcon(GoogleMaterial.Icon.gmd_style).withIdentifier(6),
                        new DividerDrawerItem(),
                        new SecondaryDrawerItem().withName(R.string.drawer_item_seventh).withIcon(FontAwesome.Icon.faw_github)
                ) // add the items we want to use with our Drawer
                .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
                    @Override
                    public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
                        if (position == 1) {
                            Intent MeassgingActivity = new Intent(MainActivity.this,LoginActivity.class);
                            startActivity(MeassgingActivity);
                        }
                        if (drawerItem instanceof Nameable) {
                            Toast.makeText(MainActivity.this, ((Nameable) drawerItem).getName().getText(MainActivity.this) + "pos " + position, Toast.LENGTH_SHORT).show();
                        }

                        //IMPORTANT notify the MiniDrawer about the onItemClick
                        return miniResult.onItemClick(drawerItem);
                    }
                })
                .withSavedInstance(savedInstanceState)
                .withShowDrawerOnFirstLaunch(true)
                .build();

screen1
screen2

MiniDrawer closing gesture

Hi Mike, is it normal that MiniDrawer closing gesture can ne performed only with a tap? I mean when I open it swiping right I try to close it swiping left, but it isn't working. I close it by tapping the screen. Is this a correct behavior or not?

P.S. Sorry for my English

Update MiniDrawer

I'm trying to update the AccountHeader image, and I do it, but only for the MaterialDrawer.
I update the MiniDrawer with this:

miniResult.getAccountHeader().updateProfile(BITMAP_IMAGE_HERE); but it remains as it was.

custom icon selection color or effect.

Hi @mikepenz ,

In CrossfadeDrawerLayout how can i have the drawer item custom icon selected effect.
say i have my custom icon in the crossfadedrawerlayout list item and how can give the selected effect like that this list item is clicked let me add test screen.
test

CrossfadeDrawerLayout below status bar and App bar

@mikepenz. Thanks for this great library, its indeed helpful.. my issue is that i can't figure out how to make the cross fade drawer layout show behind the ActionBar/APP Bar. I tried using

.withDrawerLayout(R.layout.crossfade_drawer).withRootView(R.id.miniDrawer).withRootView(R.id.drawer_container) But i was getting: "Relative layout" cannot be cast into drawerlayout.

I went through previous issues to see if i could find similar question but couldn't find one. i also tried using the .withBelowStatusBar still problem persist.

Below is my cross fade drawerlayout.xml

<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:elevation="4dp"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<!-- the layout which will contain (host) the drawerLayout -->
  <FrameLayout
      android:id="@+id/drawer_container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@id/toolbar">

<com.mikepenz.crossfadedrawerlayout.view.CrossfadeDrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/material_drawer_layout"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fitsSystemWindows="true" />

  </FrameLayout>

Thanks in anticipation.
Regards

OnDrawerItemClickListener not always called (CrossfadeDrawerLayout)

From @CodeAbode on June 18, 2016 21:13

Sometimes when I press on a drawer item, the listener is not called and the item needs to be pressed again. Below is my drawer click listener:

.withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() {
                    @Override
                    public boolean onItemClick(View view, int position, IDrawerItem drawerItem) {
                        Log.d(TAG, "onItemClick: "+position);
                            switch(position){
                                case 1:
                                    if(context.getClass() !=  MainActivity.class){
                                        Intent s = new Intent(context, MainActivity.class);
                                        context.startActivity(s);
                                    }
                                    break;

And this is a snippet of my drawer builder:

 final Drawer drawer = new DrawerBuilder()
                .withActivity((Activity) context)
                .withHasStableIds(true)
                .withToolbar(toolbar)
                .withDrawerLayout(R.layout.crossfade_drawer)
                .withSliderBackgroundColor(ContextCompat.getColor(context, R.color.darkgrey))
                .withDrawerWidthDp(72)
                .withDelayDrawerClickEvent(-1)
                .withAccountHeader(headerResult) //set the AccountHeader we created earlier for the header
                .withCloseOnClick(true)
                .addDrawerItems(
                        new PrimaryDrawerItem()
                                .withName(R.string.home_drawer_title)
                                .withSelectedColor(ContextCompat.getColor(context, com.mikepenz.materialdrawer.R.color.material_drawer_dark_selected))
                                .withTextColor(ContextCompat.getColor(context, com.mikepenz.materialdrawer.R.color.material_drawer_dark_primary_text))
                                .withSelectedTextColor(ContextCompat.getColor(context, com.mikepenz.materialdrawer.R.color.material_drawer_dark_selected_text))
                                .withIcon(GoogleMaterial.Icon.gmd_home).withIconColor(ContextCompat.getColor(context, R.color.grey))
                                .withIconColor(ContextCompat.getColor(context, com.mikepenz.materialdrawer.R.color.material_drawer_dark_primary_icon))
                                .withSelectedIconColor(ContextCompat.getColor(context, R.color.colorPrimary))

Copied from original issue: mikepenz/MaterialDrawer#1345

Right drawer

How do I add a right drawer?

I've tried with

new DrawerBuilder() .withActivity(this) .withDrawerGravity(Gravity.END) .append(result);

but it has an unwanted behaviour with the crossfade on the left side then. Any suggestions of what I did wrong?

Show mini drawer on start

I want to open the mini drawer on start app, therefore I called result.openDrawer(). It works.

However, when I want to expand out the drawer to full view by swiping right, the drawer is stuck and won't expand.

May I know how to achieve this behaviour?

I tried to meddle with ICrossfader in order to try to solve above. I put some breakpoints in this sample code, it seems like the listener methods of ICrossfader is never called. I am not sure of how the ICrossfader() works but if I comment it out, there seems to be no difference in behaviour.

//define the crossfader to be used with the miniDrawer. This is required to be able to automatically toggle open / close
        miniResult.withCrossFader(new ICrossfader() {
            @Override
            public void crossfade() {
                boolean isFaded = isCrossfaded();
                crossfadeDrawerLayout.crossfade(400);

                //only close the drawer if we were already faded and want to close it now
                if (isFaded) {
                    result.getDrawerLayout().closeDrawer(GravityCompat.START);
                }
            }

            @Override
            public boolean isCrossfaded() {
                return crossfadeDrawerLayout.isCrossfaded();
            }
        });

Graphical issue

Sometimes when I open and close the MiniDrawer, a trace of the MaterialDrawer icons remain slightly visible in the MiniDrawer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.