slidingmenu

java.lang.IllegalStateException: Failure saving state: active has cleared index in fragment

℡╲_俬逩灬. 提交于 2019-12-03 10:30:27
First, my app has structure like this: SpashActivity -> MainActivity -> switching between many fragments My app use SlideMenu to switch between fragments. I have to use attach instead of replace to keep fragment state. It's look like: public void switchContent(int index, String fragmentTag) { FragmentManager fragmentManager = getSupportFragmentManager(); FragmentTransaction transaction = fragmentManager.beginTransaction(); if (fragmentManager.findFragmentByTag(fragmentTag) != mContent) { if (!mContent.isDetached()) { transaction.detach(mContent); } if (null == fragmentManager.findFragmentByTag

mimicking the navigation drawer of youtube/gmail app

痞子三分冷 提交于 2019-12-03 07:04:04
问题 Background In the recent months Google released the Youtube app with navigation drawer (AKA sliding menu). it has many cool features that i wish to have on an app i'm working on. the features are: touch anywhere to start sliding. moving icon on the "up" button of the action bar when switching modes. content area (the area on the right, not the menu itself) stays instead of scrolling, when sliding the menu. action bar stays instead of scrolling. content area (the area on the right, not the

Android - Sliding menu with sub menu

自古美人都是妖i 提交于 2019-12-03 06:13:55
I wanted my app to have face book like sliding menu. I google'd about the issue and found many posts out there, which only helped me to build a single sliding menu. But what i need is, 2 level sliding menu ie, when i click on some option in sliding menu, it should open another sliding menu on top of it (first sliding menu should blur at this point) like the zomato app as shown below. I tried with JFeinstein sliding menu library, but i could build a 2 level sliding menu using it. Are there any other libraries to achieve this or should i build one on my own? Shown below is sliding menu from

What is the difference between the SlidingMenu library and the Android Navigation Drawer?

瘦欲@ 提交于 2019-12-02 22:35:01
The SlidingMenu library is an excellent third party library and I've already used it for a long time. Now I know Android provides a new navigation pattern using Navigation Drawer. It looks like the sliding menu. So is there anyone who already uses these two both? What is the difference and what are the pros and cons? Thanks a lot. SlidingMenu library is a third party api which uses a RelativeLayout inside. The main advantage is customization according to your requirement. Buy your layouts have to be based on a viewgroup, unfortunatly this negates the <merge> optimisations. Navigation Drawer is

mimicking the navigation drawer of youtube/gmail app

☆樱花仙子☆ 提交于 2019-12-02 19:37:34
Background In the recent months Google released the Youtube app with navigation drawer (AKA sliding menu). it has many cool features that i wish to have on an app i'm working on. the features are: touch anywhere to start sliding. moving icon on the "up" button of the action bar when switching modes. content area (the area on the right, not the menu itself) stays instead of scrolling, when sliding the menu. action bar stays instead of scrolling. content area (the area on the right, not the menu itself) changes its color when scrolling, and not the menu itself. here are screenshots to show what

Android-通过SlidingMenu高仿微信6.2最新版手势滑动返回(二)

落花浮王杯 提交于 2019-12-02 12:21:12
转载请标明出处: http://blog.csdn.net/hanhailong726188/article/details/46453627 本文出自: 【海龙的博客】 一、概述 在上一篇博文中,博文地址 Android-通过SlidingPaneLayout高仿微信6.2最新版手势滑动返回(一) ,我们是通过官方自带的SlidingPaneLayout来实现的手势滑动返回,在这篇博文中,我们将采用 SlidingMenu 来高仿。其实实现的原理都一样,只不过是把SlidingPaneLayout换成SlidingMenu而已,不过SlidingMenu本身的功能比官方自带的强大,不仅可以实现像微信一样的边缘滑动返回,还支持全屏幕滑动返回。你还可以添加动画效果,不过这里笔者业务时间不多,这里就没有实现! 首先来看一下效果图,一个是边缘滑动的,一个是全屏幕滑动,效果非常赞,比我们上一篇博文中实现的还要给力些! 边缘滑动效果图 全屏幕滑动效果图 下面我们从头开始一步一步来实现这个手势滑动返回效果,从新建工程到引入SlidingMenu,然后通过修改Activity主题样式、抽取出实现SwipeBack的父类BaseSwipeBackActivity等等 二、下面开始进入主题 首先肯定是通过AndroidStudio新建一个SlidingMenuSwipeBackDemo工程

Android:使用Slidingmenu显示WebView的时候出现空白部分

守給你的承諾、 提交于 2019-12-02 08:05:20
使用 Slidingmenu的时候,以前一直从侧边栏打开的都是普通的Fragment页面,不管是采用replace()还是hide()和show(),contentView都没有出现过空白部分。空白部分的内容,往往会稍微晚点显示完整。 这次由于contentView包含了webView,加载的是一个网页,所以才出现了这种情况。 这是一篇博客的解决办法,我试了下,的确有用。后期的话,如果 Slidingmenu作者自己解决的话,那当然最好。所以这个办法,当作是暂时的替代吧。 在Android2.2上面没有这个问题,但是Android4.0上面却出现这样的问题,高版本竟然不如低版本兼容性好?经过研究发现了,原来是 Android从3.0(API Level 11)开始,在绘制View的时候支持硬件加速,充分利用GPU的特性,使得绘制更加平滑,但是会多消耗一些内存。这样问题就被锁定在了硬件加速上,解决方法也应运而生:关闭硬件加速。 在这个Activity中加入: android:hardwareAccelerated="false" 在webview的布局中加入: android:layerType="software" 如: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:/

当webview遇到了Slidingmenu,webView出现卡白,解决方案

情到浓时终转凉″ 提交于 2019-12-01 04:14:31
Sliding Menu的是一种比较新的设置界面或配置界面效果,在主界面左滑或者右滑出现设置界面,能方便的进行各种操作。如 Evernote、Google+、Foursquare等诸多优秀应用都采用了这种界面方案。效果见下图: webView大家都认识,就像村头的王二狗,村上屌丝,人人都知。 如此白富美的SlidingMenu人见人爱,而屌丝WebView扮演着村头二狗的角色,当WebView遇到了SlidingMenu 的的时候,WebView就走不动路了,SlidingMenu如此elegant的滑动也被WebView拖的不那么优雅,每次划开SlidingMenu,WebView有文本的地方都会出现大片的卡顿,严重的影响了SlidingMenu的美观和使用。 一般很少有人想到将SlidingMenu和WebView结合,以为大部分应用使用SlidingMenu的时候都是在左抽屉里面放应用的栏目分类,主页面放一个个listView,像印象笔记这样 但是少数的怪才会想到这样的布局,左边的抽屉里面就已经将各个分类和下面的子项目列出来,所以中间的主页面就放一个webview来显示具体的文本内容,比如我: 这时候webview出现了卡白的问题,真心纠结死我了,查了各大论坛贴吧,最后问了SlidingMenu的作者,也没有得到回复,虽然这个bug不影响性能

滑动菜单栏SlidingMenu动画效果的实现

一世执手 提交于 2019-12-01 04:13:48
经过上一篇文章的学习,相信大家对开源项目SlidingMenu的用法已经有了一个非常深入的了解,那么这一章博 主就来教大家滑动菜单栏滑动时动画效果的实现。博主这里用了三个不同动画效果的基础示例来教大家如何去实现, 等 大家 弄懂了之后完全可以做到举一反三,去实现更多不同的动画效果,让你的应用软件给用户带来眼前一亮的效 果。 一、SlidingMenu动画效果示例一 1、示例一效果图 该示例实现了滑动时缩放的效果,看左边的效果图可以明显的感觉到,滑动菜单栏刚刚打开时的图片比右边的效 果图 滑动菜单栏打开一大半的图片要小。这里用到的是比例缩放的动画效果。 2、示例一项目结构图 3、示例一代码讲解 关于项目中资源文件的部分我就不详细讲解了,在上篇文章中已经详细的介绍过了,这地方我就着重的讲解一下MainActivity类,也是主程序入口类,滑动菜单栏和滑动的效果都是在此类中实现。 package com.example.myslidingmenudemo08; import android.graphics.Canvas; import android.os.Bundle; import android.view.MenuItem; import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu; import com

【Android】SlidingMenu属性详解

醉酒当歌 提交于 2019-12-01 04:13:35
简单记下属性。 SlidingMenu 常用属性介绍: menu.setMode(SlidingMenu.LEFT);//设置左滑菜单 menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);//设置滑动的屏幕范围,该设置为全屏区域都可以滑动 menu.setShadowDrawable(R.drawable.shadow);//设置阴影图片 menu.setShadowWidthRes(R.dimen.shadow_width);//设置阴影图片的宽度 menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);//SlidingMenu划出时主页面显示的剩余宽度 menu.setBehindWidth(400);//设置SlidingMenu菜单的宽度 menu.setFadeDegree(0.35f);//SlidingMenu滑动时的渐变程度 menu.attachToActivity(this, SlidingMenu.SLIDING_CONTENT);//使SlidingMenu附加在Activity上 menu.setMenu(R.layout.menu_layout);//设置menu的布局文件 menu.toggle();/