Comments (7)
Hi,
There is nothing wrong with the code you are using:
actionButton.setShowAnimation(getResources().getAnimation(R.anim.fab_fade_in));
actionButton.setShowAnimation(ActionButton.Animations.FADE_IN);
and actually it works well in the demo application.
Please provide the full code example, which contains the ActionButton object instantiation, setting the animation type and forcing its playing.
Also, provide the version, which you are using
from fab.
I'm using android version 4.0.4
Heres the code:
package --------------------------;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.software.shell.fab.ActionButton;
public class MainActivity extends ActionBarActivity {
ActionButton mActionButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mActionButton = (ActionButton)findViewById(R.id.action_button);
mActionButton.setButtonColor(getResources().getColor(R.color.app_theme_blue));
mActionButton.setButtonColorPressed(getResources().getColor(R.color.app_dark_theme_blue));
// The error is caused in the following statement.
mActionButton.setShowAnimation(getResources().getAnimation(R.anim.fab_fade_in));
mActionButton.setShowAnimation(ActionButton.Animations.FADE_IN);
mActionButton.playShowAnimation();
// The following code is for the listview fragment. It works properly
if(findViewById(R.id.fragment_container)!=null)
{
if(savedInstanceState!=null)
{
return;
}
GeneralListFragment generalListFragment = new GeneralListFragment();
generalListFragment.setArguments(getIntent().getExtras());
getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, generalListFragment).commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}
from fab.
Why are you setting showAnimation twice? You can choose between either of these 2 methods that you are using
from fab.
You mean either
mActionButton.setShowAnimation(getResources().getAnimation(R.anim.fab_fade_in));
or
mActionButton.setShowAnimation(ActionButton.Animations.FADE_IN); ?
I tried running only mActionButton.setShowAnimation(ActionButton.Animations.FADE_IN);
but it didnt work.
from fab.
Post a stacktrace here please
from fab.
It's resolved now. I thought that the animation would take place automatically when I scrolled. Just realised that it works if I implement my scroll listeners. My bad.
Thanks :D
from fab.
Great
from fab.
Related Issues (20)
- Icon is outside the circle HOT 3
- move() method smearing on KitKat with snackbar. HOT 6
- FAB sides are not perfectly round HOT 22
- FAB position not exactly correct HOT 2
- Needs compatible method with new CoordinatorLayout. HOT 2
- Is the way to have margin 0dp? HOT 2
- Render issue HOT 7
- setSize method doesn't work
- Remove deprecated API, fix unknown API references HOT 7
- Is it possible to use Text and Font_awesome with this library ? HOT 1
- Ripple state reset on UP_ACTION outside of FAB HOT 8
- cant set color of button HOT 5
- Background of the button HOT 1
- Can't render XML HOT 1
- Can Drag? HOT 1
- no resource found logback-android-core HOT 1
- Prefix attributes to avoid collisions with other libraries
- Does the actionButton have some playHideAnimationCompleationListner? HOT 1
- Ripple effect gets interrupted as soon as you release the touch input from the fab HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fab.