navigation-drawer

How to compare a String-Array

家住魔仙堡 提交于 2019-12-10 11:45:21
问题 Android devs! 1) I have tried to compare a string-array declared in my string.xml (I don't know if it's possible): <string-array name="menu_array"> <item>Pizzas</item> <item>Baguetes</item> <item>Calzones</item> <item>Esfihas</item> <item>Refrigerantes</item> <item>Vinhos</item> <item>Cervejas</item> </string-array> 2) I have a layout with an ImageView, to update images corresponding to each menu item string-array: <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android

Disable NavigationDrawer icon's slide animation

主宰稳场 提交于 2019-12-10 11:34:16
问题 Is there any way to disable sliding animation of the NavigationDrawer's icon? I mean the effect, when you click the icon or open the Drawer with slide gesture. (I still use the ActionBar at the moment) Preview 回答1: You need to override the onDrawerSlide method of ActionBarDrawerToggle and set the slideOffset to 0 if the drawer is right drawer. So this would disable the animation of the navigation drawer image. @Override public void onDrawerSlide(View drawerView, float slideOffset) { if

java.lang.IllegalStateException: RecyclerView has no LayoutManager

限于喜欢 提交于 2019-12-10 11:09:26
问题 I am getting below exception- Caused by: java.lang.IllegalStateException: RecyclerView has no LayoutManager at android.support.v7.widget.RecyclerView.generateLayoutParams(RecyclerView.java:2820) at android.view.LayoutInflater.rInflate(LayoutInflater.java:757) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:397) at com.peoplecloud.app.guggu.NavigationDrawerFragment.onCreateView(NavigationDrawerFragment.java:75) at

How to add divider to items in AndroidResideMenu?

浪子不回头ぞ 提交于 2019-12-10 10:54:53
问题 I'm creating an android application in which am using AndroidResideMenu. I want to set a divider in between each item in side menu.I tried adding a layout for divider in the xml in library.But its not working.Please help... <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:paddingTop=

Expandable listview default selection

柔情痞子 提交于 2019-12-10 10:40:02
问题 I have created a navigation drawer with an expandable listview inside it. I want the expandable listview to expand one of its groups and select one of its child by default when the activity opens up. The user may change the selection according to his requirement. Whatever I have created is not satisfying my requirement. The expandable list is allowing the user to select multiple options. The MainActivity : public class MainActivity extends Activity { DrawerLayout mDrawerLayout;

Navigation Drawer - Slowly animate menu items

余生长醉 提交于 2019-12-10 10:31:16
问题 I've implemented a DrawerLayout with this tutorial and everything works fine. @Override public boolean onPrepareOptionsMenu(Menu menu) { // if nav drawer is opened, hide the action items boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList); menu.findItem(R.id.action_settings).setVisible(!drawerOpen); return super.onPrepareOptionsMenu(menu); } onPrepareOptionsMenu simply toggles the menu visibility in one shot. But I'd like to slowly animate the alpha value of my menu items as the

(Android) Navigation drawer with Multi-pane layouts

半世苍凉 提交于 2019-12-10 10:09:23
问题 I have a hard time trying to come with a good and acceptable layout for an activity for a tablet , but I'm not sure that if my design is compatible with Google's design guidelines. In short: my application receives a network sniffer log file and shows statistics on different features on the data. For example, traffic over time, PM over time, show the traffic as a time line, different graphs, pie charts etc. The first thing comes to mind for a design for this activity is a multi-pane layout

clear focus on content when navigation drawer is showed

旧街凉风 提交于 2019-12-10 09:29:43
问题 What would be the best way to clear the focus in an android activity having a navigation drawer. The problem it's that when the user has a textbox selected, if you open the navigation drawer the back event it's not consumed by the drawer, and the navigation goes back one step leaving the drawer opened. Right now I solved using this on the activity, but i would like to know if someone use another solution where i don't need to use the ActionBarDrawerToggle events. /** Called when a drawer has

How to set an Observer to Update Navigation Drawer after onActivityResult method's received an Intent result

╄→гoц情女王★ 提交于 2019-12-10 06:59:07
问题 In my app I want to update the Navigation Drawer with the username's nickname and email after he's logged in. From my MainActivity I am starting a LoginActivity with the startActivityForResult(intent, PICK_ACCOUNT_REQUEST); method to get the users registered or logged in. After the LoginActivity returns the Intent data result (his NAME and EMAIL ) back to MainActivity , the method onActivityResult() is called and there I try to update the class' global variables NAME and EMAIL with the newly

Updating a fragment in response to Android Navigation Drawer interaction

为君一笑 提交于 2019-12-10 03:38:30
问题 The Android app I'm working on has a single MainActivity and each screen of the app is implemented as a Fragment. Each fragment is instantiated like this in the MainActivity as a private class variable: public class MainActivity extends Activity implements MainStateListener { private FragmentManager fm = getFragmentManager(); private BrowseFragment browseFragment = BrowseFragment.newInstance(); ... There is a single 'fragment frame' that loads each screen fragment. When switching screens in