floating-action-button

Error inflating class android.support.design.widget.FloatingActionButton in Android

南楼画角 提交于 2019-12-29 01:15:13
问题 When I'm trying to build the application it will show the android.view.InflateException in FloatingActionButton? I really don't know what causes the error. Login.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android

Floating action button issue when going to another fragment

夙愿已清 提交于 2019-12-29 00:40:10
问题 I built a project based on Scrolling Activity (pre-built activity suggested by android studio) and faced a strange issue. Consider the following scenario: I clicked on fab button to go to another fragment but when the fragment changed, the fab button is not disappeared ! Can anybody know how to fix this problem? Here is my XML of Scrolling Activity that I added to my frameLayout : <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http:/

Why is my floating action button not displaying properly?

早过忘川 提交于 2019-12-25 08:23:47
问题 My floating button image looks like this It's a smaller button inside a larger circle, How do I fix this? layout file: <android.support.design.widget.FloatingActionButton android:id="@+id/addToKitchenButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="16dp" android:layout_gravity="bottom|end" android:layout_alignParentBottom="true" android:layout_alignParentEnd="true" android:src="@drawable/ic_add_circle_black_50dp" /> vector code: <vector

FloatingActionButton onPressed not triggering

放肆的年华 提交于 2019-12-24 23:13:58
问题 hopefully a simple one here. I have floating buttons that are animated. They do not seem to trigger my onPressed code, just seems to do nothing although I do get the "ViewPostImeInputStage processPointer 0" and 1 type events in the logs. A button: Widget dice() { return Container( child: FloatingActionButton( elevation: 5.0, backgroundColor: Theme.of(context).accentColor, heroTag: null, onPressed: _rollDice, tooltip: 'Inbox', child: SizedBox( height: 32, width: 32, child: Image.asset('lib

how to get id by clicking FAB button

时间秒杀一切 提交于 2019-12-24 22:35:35
问题 I am displaying a ordered food list. A FloatingActionButton is placed on each food item(productId) at the ordered list, and I want to show a rating alert dialog to let user rate the food after clicking the FloatingActionButton. How do I get each of the productId when user click on the Fab button? Because I need to display the ratings at another food detail page based on the productId. I am just a beginner learning so don't really understand.Thanks OrderDetailAdapter.java class MyViewHolder

Remove Floating menu button from HTC one

最后都变了- 提交于 2019-12-24 15:33:40
问题 I have an app that's been running for years, and constantly get's updated. Originally it had a menu with some shortcuts, but it's not necessary to operate the app, so no big deal as the menu button started to disappear from new devices. Now I have a customer complaining that a floating menu button appears on he's HTC one, and it actually covers some other buttons in my app. (That's not the case on my Samsung S5 nor Lenovo Yoga tablet) I've removed "onCreateOptionsMenu" and

Extra margin(spacing) around FloatingActionButton only on API 19

和自甴很熟 提交于 2019-12-23 19:04:17
问题 I'm experiencing an e xtra margin or spacing around FloatingActionButton but only on API19. Screenshot on API19: Margin is correct on every other version, see screenshot below: The developer option for showing layout boundaries is turned on in both cases. You can clearly see that in API 19 there is an extra space around the FABs. XML: <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <android.support.design.widget

Animate Floating Action Button on ViewPager scroll

混江龙づ霸主 提交于 2019-12-23 17:36:47
问题 I have AppBarLayout, ViewPager below it and a Floating Action Button in one Activity. I want to animate the FAB when the ViewPager is scrolled. Have a look at the below screens. When Tab1 is the current tab then the FAB should be in the bottom-right corner. When Tab2 is the current tab then the FAB should be in the bottom-center area. When Tab3 is the current tab then the FAB should move back to bottom-right corner. When Tab4 is the current tab then the FAB should get anchored to ImageView4

Android: FloatingActionButton could not be instantiated

断了今生、忘了曾经 提交于 2019-12-23 10:06:53
问题 I am trying to use Floating Action Button(FAB) in my application. However, when I am declaring the same I get the error: android.support.design.widget.FloatingActionButton could not be instantiated. I have added following commands to my gradle file: compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:support-v4:23.1.1' I have also tried with adding following to my style parent: parent="@style/Theme.AppCompat" Also tried

set FAB anchor gravity dynamically

一世执手 提交于 2019-12-23 09:06:10
问题 I need to be able to change the app:layout_anchorGravity="center" of the FAB from "center" to "bottom|start" from the code. I've found this example: CoordinatorLayout.LayoutParams p = (CoordinatorLayout.LayoutParams) fab.getLayoutParams(); p.setAnchorId(xxxx); fab.setLayoutParams(p); but it's for setting the anchor and not the anchor gravity. 回答1: The CoordinatorLayout.LayoutParams class has the anchorGravity field for that. For example: FloatingActionButton fab = (FloatingActionButton)