Ok so here is the deal... I have a menu at the bottom of my apps
screen that works normally hits/clicks register fine.
When you select the "hide menu" button which is an arrow image the
animation works fine and the menu and the hide menu button move down
as they should, here is where it gets weird, The "hit area" or "click
area" whatever you want to call it remains where in the original
location for both the menu and the "hide menu" button, If I click on
the "hide menu" button again (where it was prior to the animation,
nothing happens when I click on its current location) it returns to
the visible position (which I defined through a state holder variable
and a couple if statements) so the code seems to be functioning
normally except that the button clickable areas aren't moving... can
someone explain where I'm going wrong or what I need to do?
Main Activity:
//Nav Button
ImageButton NavDrawerBtn = (ImageButton)
findViewById(R.id.nav_drawer_btn);
NavDrawerBtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
//Toast.makeText(Dashboard.this, "Nav",
Toast.LENGTH_SHORT).show();
animateNavDrawerBtn();
}
});
private void animateNavDrawerBtn(){
ImageButton NavDrawerBtn = (ImageButton)
findViewById(R.id.nav_drawer_btn);
...
View NavDrawer = (View) findViewById(R.id.nav_drawer);
//State 1 = Bottom
//State 2 = Middle
//State 3 = Top
//If State is 1 move to 2 and set to 2
if (navState == 1){
NavDrawerBtn.startAnimation(new
NavDrawerBtnAnimMid());
NavDrawer.startAnimation(new NavDrawerAnimMid());
navState = 2;
return;
//If State is 2 move to 1 and set to 1
}
if (navState == 2){
NavDrawerBtn.startAnimation(new
NavDrawerBtnAnimBottom());
NavDrawer.startAnimation(new NavDrawerAnimBottom());
navState = 1;
return;
}
//If State is 3 move to 2 and set to 2
if (navState == 3){
NavDrawerBtn.startAnimation(new
NavDrawerBtnAnimMid());
navState = 2;
return;
}
}
NavDrawerAnim Classes (only difference in the classes is the
matrix.setTRamslate(xxx,xxx) line:
import android.graphics.Matrix;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
import android.view.animation.Transformation;
public class NavDrawerAnimBottom extends Animation{
public void NavAnimation2(){}
@Override
public void initialize(int width, int height, int parentWidth,
int parentHeight){
super.initialize(width,height,parentWidth,parentHeight);
setDuration(2500);
setFillAfter(true);
setInterpolator(new LinearInterpolator());
}
@Override
protected void applyTransformation(float interpolatedTime,
Transformation t){
final Matrix matrix = t.getMatrix();
matrix.setTranslate(0, 125);
}
}
I'm up against a wall here I have no idea whats going on and I'm still
trying to figure this out any help would be greatly appreciated
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en