navigation-drawer

SwipeRefreshLayout Got Action_Move freezes view

断了今生、忘了曾经 提交于 2019-12-05 13:30:13
I have a normal NavigationDrawer with different fragments : News other Stuff 1 other Stuff 2 Setting The problem : The NewsFragment contains a SwipeRefreshLayout. It works great the first time I refresh. I can change fragment to other Stuff 1 and 2 and Setting. So I come back to NewsFragment. And now when I refresh, the fragment freezes. The drawerLayout works correctly (open/close, even the ActionBar Title change) but the main fragment stay at NewsFragment and I can't scroll. But the scollListner works (I have log) but the view doesn"t change. No refreshView (top of the swipeRefreshLayout),

What is the navigation drawer icons size?

删除回忆录丶 提交于 2019-12-05 13:20:36
问题 I need to know the correct size (artboard and content) for Navigation Drawer icons. It doesn't say anything on the Navigation Drawer specs: http://www.google.com.br/design/spec/patterns/navigation-drawer.html#navigation-drawer-specs Thanks! 回答1: I would vote up Balar's answer, but it is off by one small detail. The correct answer is that all small icons should be 24 x 24 dp . Reference: https://material.io/guidelines/layout/metrics-keylines.html#metrics-keylines-touch-target-size 回答2: For:

Navigation Drawer menu items selected within different groups

孤者浪人 提交于 2019-12-05 12:39:17
问题 I have a working Navigation Drawer and having some issues with menuItem.setChecked(true); when using groups and headers within the menu. It's not highlighting menu items as expected. Here is my XML: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context=".ActivityMap"> <group android:checkableBehavior="single"> <item android:id="@+id/nav_welcome" android:icon="@drawable/abc_btn_check_to_on_mtrl_000" android:title="Welcome"

java.lang.NullPointerException: Attempt to invoke virtual method 'ActionBar.setNavigationMode(int)' on a null object reference

为君一笑 提交于 2019-12-05 12:24:13
I am getting this error at runtime. java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setNavigationMode(int)' on a null object reference Main Activity.java public class MainActivity <T extends Fragment> extends ActionBarActivity implements ListView.OnItemClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActionBar actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); actionBar

Fragment in FrameLayout not showing in CoordinatorLayout

荒凉一梦 提交于 2019-12-05 10:25:52
I opened the default Android Studio App with a NavigationDrawer. The default content-view is not very useful, therefore I tried to replace it with a FrameLayout so I can add Fragments. If I just replace content_main with the FrameLayout the Fragment will not be shown at all. If I pull out the FrameLayout out of app_bar_main.xml into activity_main.xml it is shown but it overlaps with the Toolbar. MainActivity.java public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { @Override protected void onCreate(Bundle savedInstanceState) { super

Resource Not Found error res/drawable/abc_switch_thumb_material.xml after adding SwitchCompat in Android App Bundle

孤者浪人 提交于 2019-12-05 10:16:58
I Know this Question has been asked several times i have read them all and have matched all dependencies so that they have same versions but this error only started to happen after adding Switch Compat as you can also see that by going through the crash report by fabric . This Error is happing not on all devices but to some by the crash report , also it has no specific Android for this crash. One More thing i am using beta versions of android because of Android App Bundle and this thing does not happen in non bundles that is Apk. Fatal Exception: java.lang.RuntimeException: Unable to start

How to get items in Navigation Drawer to change view

南笙酒味 提交于 2019-12-05 09:53:50
问题 I want to make an simple app with a Navigation Drawer, which can open other views (News, Information, Gallery, Contact etc). So I opened up the latest Android Studio, made a new project that is compatible with API8>API19, to get maximum reach. I chose the preset Navigation Drawer and clicked finish. I have figured out to change the names of the items in the Navigation Drawer, but how do I get these items to redirect to a new view? I have tried implementing the setOnItemClickListener into the

View Gone when clicked outside that view

可紊 提交于 2019-12-05 09:09:01
I wanted to hide the view when clicking outside that view, for example, <Framelayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" > <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="match_parent" android:layout_height="match_parent" /> <ImageView android:id="@+id/imgButtonToOpenGrid" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right|bottom" android:src="@drawable/open_grid_img" /> <RelativeLayout android:id="@+id

Removing left margin from android navigation drawer icon

走远了吗. 提交于 2019-12-05 08:46:46
Can anybody help me to find the way to remove the left margin of the navigation drawer icon (mentioned by red rectangle below )? I am using toolbar here. This removes the left margin from toolbar. mainToolbar.setContentInsetsAbsolute(0, 0); Or you can set left inset to 0dp in toolbar xml: android:contentInsetLeft="0dp" Other way is to define that padding in the styles.xml: <style name="ToolbarStyle" parent="@style/Widget.AppCompat.Toolbar"> <item name="contentInsetStart">0dp</item> <item name="android:contentInsetStart">0dp</item> </style> If all of these solutions didn't worked please check

Navigation Drawer back button in fragments

久未见 提交于 2019-12-05 08:32:46
I started creating of app which use one activity (Navigation Drawer) and many fragments. But I unable to use toolbar back button to navigate back from fragments. Hardware back button works perfectly. I know that I need to override onOptionsItemSelected , catch android.R.id.home , check if there are something in back stack and than pop it. After changing fragment, "burger" button changes to "back arrow", but when I click on it onOptionsItemSelected never fired, just opens the NavigationDrawer menu. Here the code from activity: public class NavDrawerActivity extends AppCompatActivity implements