Added to my TODO list. For now you can use OnMenuToggleListener
to create such behavior by yourself.
Ability to dim background when the menu is opened
On most apps that uses the FAB, the background is dimmed when the menu is opened. It would be nice to have this feature here.
该提问来源于开源项目：Clans/FloatingActionButton
 点赞
 写回答
 关注问题
 收藏
 复制链接分享
 邀请回答
11条回答

采纳
点赞 评论 复制链接分享

采纳
Thanks! I was amazed how easy it was to implement it myself...
点赞 评论 复制链接分享 
采纳
That would be great addition.
点赞 评论 复制链接分享 
采纳
could you tell me how you dimmed the screen? The solution I tried (see below) didn't work.
mFloatMenu.setOnMenuToggleListener(new FloatingActionMenu.OnMenuToggleListener() {
public void onMenuToggle(boolean opened) { WindowManager.LayoutParams windowManager = getActivity().getWindow().getAttributes(); windowManager.dimAmount = 0.75f; getActivity().getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); } });
点赞 评论 复制链接分享 
采纳
see this gist: https://gist.github.com/avrahamshukron/16513fe5622d11061d1e
点赞 评论 复制链接分享 
采纳
Thanks!
点赞 评论 复制链接分享 
采纳
OnMenuToggleListener work perfectly. Thanks a lot!
点赞 评论 复制链接分享 
采纳
Just add the
fab:menu_backgroundColor="#ccffffff"
to thecom.github.clans.fab.FloatingActionMenu
tag. Choose the color and transparency you need.点赞 评论 复制链接分享 
采纳
But, then you have to set the width and height of the menu to match_parent or something which makes it so you can't interact with anything "under" the menu.
点赞 评论 复制链接分享 
采纳
also you need to remove margins from FAB Menu. You will have a partially dimmed screen
点赞 评论 复制链接分享 
采纳
JaydipRadadiya, how did you use the OnMenuToggleListener? Thanks!
点赞 评论 复制链接分享
相关推荐
 回答 1 已采纳 Programming is fun, Aaron is addicted to it. In order to improve his programming skill, he decides to solve one programming problem per day. As you know, different problems have different properties, some problems are so difficult that there are few people can solve it, while some problems are so easy that almost everyone is able to tackle it. Programming skill can be measured by an integer p. And all problems are described by two integers ai and bi. ai indicates that if and only if P >= ai, you can solve this problem. bi indicates that after you solve this problem, your programming skill can be increased by bi. Given the initial programming skill p of Aaron, and the information of each problem, Aaron want to know the maximal programming skill he can reach after m days, can you help him? Input Input consists of multiple test cases (less than 40 cases)! For each test case, the first line contains three numbers: n, m, p (1 <= n <= 100000, 1 <= m <= n, 1 <= p <= 10000), n is the number of problems available for Aaron, m, p as mentioned above. The following n lines each contain two numbers: ai and bi (1 <= ai <= 10000, 1 <= bi <= 10000) describe the information of the ith problem as memtioned above. There's a blank line between consecutive cases. Output For each case, output the maximal programming skill Aaron can reach after m days in a line. Sample Input 2 2 1 1 2 7 3 3 1 2 1 2 2 3 3 4 Sample Output 3 5
 4年前回答 1 已采纳 Problem Description The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. The width of the river is L (1<= L <= 1000000000). There are n (0<= n <= 500000) stones lined up in a straight line from one side to the other side of the river. The frogs can only jump through the river, but they can land on the stones. If they fall into the river, they are out. The frogs was asked to jump at most m (1<= m <= n+1) times. Now the frogs want to know if they want to jump across the river, at least what ability should they have. (That is the frog's longest jump distance). Input The input contains several cases. The first line of each case contains three positive integer L, n, and m. Then n lines follow. Each stands for the distance from the starting banks to the nth stone, two stone appear in one place is impossible. Output For each case, output a integer standing for the frog's ability at least they should have. Sample Input 6 1 2 2 25 3 3 11 2 18 Sample Output 4 11
 回答 2 已采纳 I think every one of you has played Starcraft. In order to simplify, we just consider the five characters: Armor: the defender's defending ability; HP: the points of health; Power: attacker's power at each hit; Amount: the amount of hitting each time; Cool: the time between the ending of the attack and the beginning of another, but neglect the time of attacking; the formula of the damage of each hit (Power  Armor) * Amount Each hit cause at least one point of damage. If one's hp<=0, he is dead. After waiting the first Cool time, there will be the first attack. Input You're given several cases. Each test case begins with a line contains the name of the unit. The following line contains the five characters of the first unit, followed the second. HP, Power, Amount, Cool are natural numbers, and Armor is a no negative number. The input is terminated by EOF, and there is a blank line between two cases. Output Just Print a single line "name Survive!" if one killed the other, or "All Die!". Sample Input Zerging 35 0 6 1 5 Marine 40 0 15 1 6 Zealot 100 2 40 2 8 Zealot2 100 2 40 2 8 Sample Output Zerging Survive! All Die!
 回答 1 已采纳 Description The Advancement of Collegiate Mastermind (hey, that's ACM again...weird!) is an organization which (among other things) holds classes for college students to improve their Mastermind skills. Recall that basic Mastermind is a twoplayer game which works as follows: The first player – the codemaker – creates a secret 4color code, each color taken from one of six colors (we'll use A, B, C, D, E and F for the colors). The other player – the codebreaker – now must try to guess the codemaker's code. After each guess, the codemaker uses black and white pegs to tell the codebreaker two things: the number of correct colors in the correct positions (the black pegs), and the number of remaining correct colors that are in the wrong positions (the white pegs). For example, if the true code is ABCC, and the codebreaker makes the guess ACCD, then the response would be 2 black and 1 white; if the guess was CCAA, the response would be 3 white. The codebreaker continues making guesses until he receives 4 blacks. More advanced versions of Mastermind increase both the length of the code and the number of colors to choose from. The ACM's master instructor is Dee Sifer, and she has a unique ability: when given a set of n guesses and responses, she can immediately determine what the best (n + 1)st guess should be. For each possible (n + 1)st guess, Dee calculates (in her head) the number of codes left for each possible response she could get to that guess. The maximum of these numbers over all responses is called the uncertainty of the guess. The "best" guess is the one with the minimum uncertainty. For example, suppose that you get to a point in a game where you've narrowed down the answer to only three possible codes: ABBB, ABBC or ABCB. If your next guess is ABBB, there would be two possible responses: 4 blacks (leaving 0 remaining possibilities left) or 3 blacks (leaving 2 remaining possibilities – ABBC and ABCB). However, if instead of ABBB you try ABBC, then there are 3 possible responses: 4 blacks (leaving 0 possibilities), 3 blacks (leaving 1 possibility – ABBB) and 2 blacks and 2 whites (also leaving 1 possibility – ABCB). Thus ABBC would be a better guess in this case, since the uncertainty it leaves is 1, whereas the uncertainty for ABBB is 2. This is all well and good, except for one thing. You have been selected as Dee's successor, and you do NOT have Dee's ability to pick the minimum uncertainty guess. Dee has been dropping hints (in code) that she plans to retire soon, so you need a program to help you simulate her ability. Input Input will consist of multiple test cases. The first line of the input file will contain a single integer indicating the number of test cases. Each test case will consist of several lines. The first line will contain three integers: l c n, where l is the length of the code being guessed, c is the number of colors to choose from, and n is the number of guesses made so far. These values will satisfy 1 ≤ l ≤ 15, 1 ≤ c ≤ 20, 0 ≤ n ≤ 10. The values of l and c will be such that the total possible number of codes will be 32768. After this will come n lines of the form : guess b w where guess is a lengthl character string specifying a guess, and b and w are the number of black and white pegs in the response. All colors will be uppercase letters taken from the first c letters of the alphabet. For each test case, the guesses given will limit the total number of possible solutions to 1500. Output For each test case, output a single line containing the best guess and its uncertainty. Use a single blank to separate the guess from the uncertainty. If there is more than one guess with the same minimum uncertainty, use the one which comes first lexicographically. Sample Input 3 4 6 2 AABC 1 2 BEAC 0 3 4 6 1 ABCD 0 0 3 20 4 ABE 1 0 ROM 1 0 INK 1 0 MOB 0 2 Sample Output ABCD 4 AEEE 3 IBM 0
 回答 1 已采纳 Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs her beauty sleep, so she wants to get back as quickly as possible. Farmer John's field has N (2 <= N <= 1000) landmarks in it, uniquely numbered 1..N. Landmark 1 is the barn; the apple tree grove in which Bessie stands all day is landmark N. Cows travel in the field using T (1 <= T <= 2000) bidirectional cowtrails of various lengths between the landmarks. Bessie is not confident of her navigation ability, so she always stays on a trail from its start to its end once she starts it. Given the trails between the landmarks, determine the minimum distance Bessie must walk to get back to the barn. It is guaranteed that some such route exists. Input * Line 1: Two integers: T and N * Lines 2..T+1: Each line describes a trail as three spaceseparated integers. The first two integers are the landmarks between which the trail travels. The third integer is the length of the trail, range 1..100. Output * Line 1: A single integer, the minimum distance that Bessie must travel to get from landmark N to landmark 1. Sample Input 5 5 1 2 20 2 3 30 3 4 20 4 5 20 1 5 100 Sample Output 90 Hint INPUT DETAILS: There are five landmarks. OUTPUT DETAILS: Bessie can get home by following trails 4, 3, 2, and 1.
 回答 1 已采纳 Cutting down a virtual tree isn't quite a complicated job. Just sway your axe several times and the tree is down. Cutting down a digital tree is not that simple. Before cutting a node, one has to deal with all of it's branches. Otherwise, data may become lost. To make this process more convenient, the International Carpenter Provision Corporation (ICPC) invented a tool called Advanced Cutting Machine (ACM). An ACM cuts down a tree in several turns. In each turn, it can cut at most k nodes (k is called the ability of that ACM). Furthermore, it can only cut a node if all of it's branches are cut in previous turns. Given a tree, calculate the minimal turns needed for an ACM with ability k to cut it down. Input The input contains several cases. Each case begins with two integers n (1=1), the ACM's ability. N1 lines follow, each contains 2 integers a and b, indicating a is b's subnode. Nodes are marked from 1 to n. There is a blank line between adjacent cases. Input is terminated by n=k=0. Output For each test case, output a line with the minimal turns needed. Sample Input 4 2 2 1 3 2 4 2 0 0 Sample Output 3
 回答 1 已采纳 Problem Description Defense of the Ancients (commonly known as DotA) is a custom scenario for the realtime strategy video game Warcraft III: Reign of Chaos and its expansion, Warcraft III: The Frozen Throne, based on the "Aeon of Strife" map for StarCraft. The objective of the scenario is for each team to destroy the opponents' Ancients, heavily guarded structures at opposing corners of the map. Players use powerful units known as heroes, and are assisted by allied heroes and AIcontrolled fighters called "creeps". As in roleplaying games, players level up their heroes and use gold to buy equipment during the mission. Defense of the Ancients pits two teams of players against each other: the Sentinel and the Scourge. Players on the Sentinel team are based at the southwest corner of the map, and those on the Scourge team are based at the northeast corner. Each base is defended by towers and waves of units which guard the main paths leading to their base. In the center of each base is the "Ancient", a building that must be destroyed to win the game. Each human player controls one Hero, a powerful unit with unique abilities. In DotA, players on each side choose one of 101 heroes, each with different abilities and tactical advantages over other heroes. The scenario is highly teamoriented; it is difficult for one player to carry the team to victory alone. Defense of the Ancients allows up to ten players in a fiveversusfive format and an additional two slots for referees or observers, often with an equal number of players on each side. In DotA, each hero has three basic attributes: strength, agility and intellect. One point of strength can give the hero 19 points of life and 0.03 life regen per second; One point of agility increases the hero's attack speed by 1% and every 7 points of agility increases the hero's Armor by 1; One point of intellect gives the hero 13 points of mana and 0.03 mana regen per second. To simplify the problem, we make the following conventions: one points of strength gives a hero S points of fighting ability; one points of agility gives a hero A points of fighting ability; one points of intellect gives a hero I points of fighting ability. S, A and I are fixed but unknown real numbers. A hero with 0 points of the three attributes has 0 points of fighting ability. When two heroes fight with each other, the one has higher fighting ability always win. When two heroes that have equal fighting ability meet, one of them randomly wins. Burning and AngleLover are both excellent DotA player. Burning is good at using the hero "Shadow Fiend" while AngleLover is famours for his "Rattletrap". They have fight with each other for n times. We knows the result and the attribute value of the two hero in each fight, but we don't know the exact value of S, A and I. Now given the attribute value of the two hero in other m fights, can you determine who will be the winer? It is guaranteed that none of S A, and I is more than 100 times as high as another, and none of them are 0. Input In the first line of input file there is a single integer T, means the number of test cases. (1 ≤ T ≤ 10) For each test case, in the first line there are two integers: n and m as mentioned above (0 ≤ n ≤ 300, 1 ≤ m ≤ 2000). Then there are n+m lines following. From line 2 to line n+1, each line describes a battle in the format: winner S1 A1 I1 S2 A2 I2 The string winner is either "Burning" or "AngleLover", S1, A1, I1 is the strength value, agility value and intellect value of Burning's hero respectively. And S2, A2, I2 is the strenght value, agility value and intellect value of AngleLover's hero respectively. From line n+2 to line n+m+1, each line describes battles whose result is to be determined in the format: S1 A1 I1 S2 A2 I2 Each variable's meaning is the same as the mentioned above. The value of the attributes are all integers between 0 and 1000 inclusively. Output For each battle to be determined, output a string in a line: If Burning will win the battle, output "Burning"; if AngleLover will win, output "AngleLover". If it is not sure, output "I don't know". Sample Input 1 3 3 Burning 6 5 4 5 4 7 AngleLover 5 4 2 3 5 5 Burning 9 0 10 8 2 7 6 6 4 5 4 7 9 0 10 8 2 6 3 4 8 4 4 6 Sample Output Burning Burning I don't know
 4年前回答 1 已采纳 Gensokyo is a world which exists quietly beside ours, separated by a mystical border. It is a utopia where humans and other beings such as fairies, youkai(phantoms), and gods live peacefully together. Shameimaru Aya is a crow tengu with the ability to manipulate wind who has been in Gensokyo for over 1000 years. She runs the Bunbunmaru News  a newspaper chockfull of rumors, and owns the Bunkachou  her record of interesting observations for Bunbunmaru News articles and pictures of beautiful danmaku(barrange) or cute girls living in Gensokyo. She is the biggest connoisseur of rumors about the girls of Gensokyo among the tengu. Her intelligence gathering abilities are the best in Gensokyo! During the coming n days, Aya is planning to take many photos of m cute girls living in Gensokyo to write Bunbunmaru News daily and record at least Gx photos of girl x in total in the Bunkachou. At the kth day, there are Ck targets, Tk1, Tk2, ..., TkCk. The number of photos of target Tki that Aya takes should be in range [Lki, Rki], if less, Aya cannot write an interesting article, if more, the girl will become angry and use her last spell card to attack Aya. What's more, Aya cannot take more than Dk photos at the kth day. Under these constraints, the more photos, the better. Aya is not good at solving this complex problem. So she comes to you, an earthling, for help. Input There are about 40 cases. Process to the end of file. Each case begins with two integers 1 <= n <= 365, 1 <= m <= 1000. Then m integers, G1, G2, ..., Gm in range [0, 10000]. Then n days. Each day begins with two integer 1 <= C <= 100, 0 <= D <= 30000. Then C different targets. Each target is described by three integers, 0 <= T < m, 0 <= L <= R <= 100. Output For each case, first output the number of photos Aya can take, 1 if it's impossible to satisfy her needing. If there is a best strategy, output the number of photos of each girl Aya should take at each day on separate lines. The output must be in the same order as the input. If there are more than one best strategy, any one will be OK. Output a blank line after each case. Sample Input 2 3 12 12 12 3 18 0 3 9 1 3 9 2 3 9 3 18 0 3 9 1 3 9 2 3 9 2 3 12 12 12 3 18 0 3 9 1 3 9 2 3 9 3 18 0 0 3 1 3 6 2 6 9 2 3 12 12 12 3 15 0 3 9 1 3 9 2 3 9 3 21 0 0 3 1 3 6 2 6 12 Sample Output 36 6 6 6 6 6 6 36 9 6 3 3 6 9 1
 xuehouniao的博客 Using Visual Basic and ASP with XML to Generate Excel 2003 Workbooks Frank RiceMicrosoft CorporationMarch 2004Applies to: Microsoft® Office Excel 2003 Microsoft Visual Basic® 6.0 Microsoft O
 rbmnet的博客 When you have Word and Excel installed on the local machine, Office is able to detect if an XML file is associated with either of its application allowing a document to launch with the respective ...
 zJianFlys的博客 This is the amount of deceleration to add when easing in. int AccessibilityService_accessibilityEventTypes The event types this serivce would like to receive as specified in...
 10年前做事先做人的博客 Here is a list of recent visual howto videos that demonstrate how to use the SharePoint developer tools in Visual Studio. Click on the screenshot to view the visual howto. There ...
 weixin_30909575的博客 Article ID : 311765 Last Review : June 23, 2005 Revision : 6.0 This article was previously published under Q311765 On This Page SUMMARY MORE INFORMATION ...Background information C...
 freexploit的博客 网上有一个汉化好的 压榨XP手册 是基于他的汉化版 现在我贴出的是英文原版你还可以向作者捐献15$以便获得一个自动优化XP的脚本原文：http://www.boldfortune.com/forums/index.php?showforum=13Thanks go out to ...
 zJianFlys的博客 When closing the current activity, this is the animation that is run on the current activity (which is exiting the screen). int activityOpenEnterAnimation When opening a new ...
 2年前ama7449的博客 Notes Tips Note ID UniquenessTracking Notes Users at the Notes Server ConsoleSetting Up Web Server LoggingJS32.DLL Error Upgrading Domino ServerNotes Client CommandLine OptionsReporting a B...
 3年前marton_13的博客  Default background dim amount when a menu, dialog, or something similar pops up. > < attr name = "backgroundDimAmount" format = "float" /> <! Control whether dimming behind the ...
 yangjia_cheng的博客 Oracle VMVirtualBoxR ?Programming Guide andReferenceVersion 5.2.8... 20042018 Oracle Corporationhttp://www.virtualbox.orgContents1 Introduction 211.1 Modularity: the building blocks of VirtualBox . ....
 回答 1 已采纳 Description Conflicts are everywhere in the world, from the young to the elderly, from families to countries. Conflicts cause quarrels, fights or even wars. How wonderful the world will be if all conflicts can be eliminated. Edward contributes his lifetime to invent a 'Conflict Resolution Terminal' and he has finally succeeded. This magic item has the ability to eliminate all the conflicts. It works like this: If any two people have conflict, they should simply put their hands into the 'Conflict Resolution Terminal' (which is simply a plastic tube). Then they play 'Rock, Paper and Scissors' in it. After they have decided what they will play, the tube should be opened and no one will have the chance to change. Finally, the winner have the right to rule and the loser should obey it. Conflict Eliminated! But the game is not that fair, because people may be following some patterns when they play, and if the pattern is founded by others, the others will win definitely. Alice and Bob always have conflicts with each other so they use the 'Conflict Resolution Terminal' a lot. Sadly for Bob, Alice found his pattern and can predict how Bob plays precisely. She is very kind that doesn't want to take advantage of that. So she tells Bob about it and they come up with a new way of eliminate the conflict: They will play the 'Rock, Paper and Scissors' for N round. Bob will set up some restricts on Alice. But the restrict can only be in the form of "you must play the same (or different) on the ith and jth rounds". If Alice loses in any round or break any of the rules she loses, otherwise she wins. Will Alice have a chance to win? Input The first line contains an integer T(1 <= T <= 50), indicating the number of test cases. Each test case contains several lines. The first line contains two integers N,M(1 <= N <= 10000, 1 <= M <= 10000), representing how many round they will play and how many restricts are there for Alice. The next line contains N integers B1,B2, ...,BN, where Bi represents what item Bob will play in the ith round. 1 represents Rock, 2 represents Paper, 3 represents Scissors. The following M lines each contains three integers A,B,K(1 <= A,B <= N,K = 0 or 1) represent a restrict for Alice. If K equals 0, Alice must play the same on Ath and Bth round. If K equals 1, she must play different items on Ath and Bthround. Output For each test case in the input, print one line: "Case #X: Y", where X is the test case number (starting with 1) and Y is "yes" or "no" represents whether Alice has a chance to win. Sample Input 2 3 3 1 1 1 1 2 1 1 3 1 2 3 1 5 5 1 2 3 2 1 1 2 1 1 3 1 1 4 1 1 5 1 2 3 0 Sample Output Case #1: no Case #2: yes Hint 'Rock, Paper and Scissors' is a game which played by two person. They should play Rock, Paper or Scissors by their hands at the same time. Rock defeats scissors, scissors defeats paper and paper defeats rock. If two people play the same item, the game is tied..
 13年前Chendy的博客 However, there will probably be times when you want the best of both worlds, that is you want the user to only have one instance of your second form instantiated at any one time, but you want them to ...