android-navigation

How to make bottom navigation show menu items with icon and text except center item menu show only icon? [closed]

徘徊边缘 提交于 2019-11-27 11:51:35
I want to create bottom navigation bar show menu items icon and text except center item. eg. i have attached image Try below code: XML file: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="top" android:background="@color

Setting launchMode=“singleTask” vs setting activity launchMode=“singleTop”

时光毁灭记忆、已成空白 提交于 2019-11-27 05:27:38
问题 I have an app that is very hierarchical (activities are similar to League > Team > Position > Player) and so I've made each activity singleTop in order to keep navigation sensible and to prevent duplicate instances. Now I'm making my second app and I've seen it suggested to declare my application to be singleTask to prevent duplicate instances. Could someone help explain the advantages of each approach? My new app is just an activity with 3 fragments and then I'll probably add a settings

Block/disable recent apps button

只愿长相守 提交于 2019-11-27 05:26:23
问题 I know that this question was asked before here Android Disable Recent Task Button like in SureLock, but since the answer there is not working, maybe some can share some light on this forgotten mater. I also tried: private void closeRecents() { activ.sendBroadcast(new Intent("com.android.systemui.recent.action.CLOSE")); Intent closeRecents = new Intent("com.android.systemui.recent.action.TOGGLE_RECENTS"); closeRecents.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM

Swapable tabs in Slider Menu fragment

帅比萌擦擦* 提交于 2019-11-27 02:51:17
问题 I have implemented Navigation Drawer by Referring this tutorial and now what I want to do is to display swiping tabs inside a fragment. i.e. when i click on an item in navigation drawer, lets say the first one, it should display swiping tabs for that items.( I have 6 fragments in my list view.(likewise :- A,B,C,D,E,F). and I need 3 swapable tabs on my A Fragment.) If the item1 is Events, when i click on it, then it should display swiping tabs. But I am facing the following issues:- How can I

Detect soft navigation bar availability in android device progmatically?

拥有回忆 提交于 2019-11-27 00:53:52
问题 I am trying to determine soft navigation bar through the android program. I didn't find straight way to determine. Is there anyway to find the navigation bar availability. Soft Navigation bar image is here. 回答1: Following method worked for me and tested in many devices. public boolean hasNavBar (Resources resources) { int id = resources.getIdentifier("config_showNavigationBar", "bool", "android"); return id > 0 && resources.getBoolean(id); } Note: Verified this method in real device 回答2: As i

Navigation Drawer item background colour for selected item

混江龙づ霸主 提交于 2019-11-27 00:22:05
I used Android Studio to implement the Navigation Drawer and I can't get the blue colour that is used to show which section we're currently in to change. I've tried numerous things, I'm currently using a listSelector which looks like: <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" android:drawable="@color/selected" /> <item android:state_pressed="true" android:drawable="@color/highlight" /> </selector> I've also tried state_checked . state_pressed works in this situation but the currently selected item is still blue. EDIT: I've been

Make navigation drawer draw behind status bar

孤者浪人 提交于 2019-11-27 00:06:29
问题 I'm trying to create a Nav Drawer like the one from the Material spec (like the one from the new gmail app). Note how the contents of the nav drawer draw behind the status bar: Using Chris Banes' answer from this question, I was able to successfully make the navigation drawer in my app draw behind the status bar; that's working fine. What isn't working is drawing the contents of the nav drawer behind the status bar. I want the blue image in my drawer to be displayed behind the status bar, but

Android Navigation Drawer implemented with Activities

倖福魔咒の 提交于 2019-11-26 18:23:12
问题 I am developing my own Android Application and i came to a point where i have three different Activities say Activity A, Activity B and Activity C. What i want to do now is to create a Navigation Drawer to navigate between them. I read the tutorial on the Android Developers website but they only focused on Fragments. How are professional Android Applications developed only with one Activity and all the other screens are developed with the use of Fragments?If not why isn't documented how to

Appcompatv7 - v21 Navigation drawer not showing hamburger icon

前提是你 提交于 2019-11-26 16:07:00
I am implementing the lollipop style navigation drawer with latest appcompat support library but the problem is the hamburger icon is never displayed . Only back icon is shown. This is my activity code import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.widget.Toolbar; import android.view.View; public class Home extends ActionBarActivity { private DrawerLayout mDrawerLayout; private ActionBarDrawerToggle mDrawerToggle; @Override protected void

Navigation Drawer item background colour for selected item

谁都会走 提交于 2019-11-26 12:22:25
问题 I used Android Studio to implement the Navigation Drawer and I can\'t get the blue colour that is used to show which section we\'re currently in to change. I\'ve tried numerous things, I\'m currently using a listSelector which looks like: <selector xmlns:android=\"http://schemas.android.com/apk/res/android\"> <item android:state_activated=\"true\" android:drawable=\"@color/selected\" /> <item android:state_pressed=\"true\" android:drawable=\"@color/highlight\" /> </selector> I\'ve also tried