Created
September 4, 2014 18:13
-
-
Save makovkastar/430527f47f7171e8f2c5 to your computer and use it in GitHub Desktop.
Initally hide the FAB and show it with an animation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainActivity extends ListActivity { | |
private Handler mHandler = new Handler(); | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
final FloatingActionButton floatingActionButton = (FloatingActionButton) findViewById(R.id.button_floating_action); | |
floatingActionButton.attachToListView(getListView()); | |
ListAdapter listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, | |
getResources().getStringArray(R.array.planets)); | |
getListView().setAdapter(listAdapter); | |
floatingActionButton.hide(false); | |
mHandler.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
floatingActionButton.show(true); | |
} | |
}, 1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment