Attempt to fix bug where DrawerArrowDrawable animation gets stuck half way.
Also, add a background to indicate that the exit button on a tab is pressed.
This commit is contained in:
parent
9173e8270a
commit
e7dacc9c10
@ -42,6 +42,7 @@
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="13dp"
|
||||
android:alpha="0.5"
|
||||
android:background="?attr/actionBarItemBackground"
|
||||
android:contentDescription="Delete Tab"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="3dp"
|
||||
|
@ -32,6 +32,7 @@ import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Browser;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@ -346,6 +347,26 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
};
|
||||
anim.setDuration(300);
|
||||
anim.setInterpolator(new DecelerateInterpolator());
|
||||
anim.setAnimationListener(new AnimationListener(){
|
||||
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
if (!hasFocus) {
|
||||
drawable.setProgress(0.0f);
|
||||
} else {
|
||||
drawable.setProgress(1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animation animation) {
|
||||
}
|
||||
|
||||
});
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
|
||||
@Override
|
||||
@ -1568,6 +1589,8 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
ViewCompat.jumpDrawablesToCurrentState(holder.exit);
|
||||
|
||||
LightningView web = data.get(position);
|
||||
holder.txtTitle.setText(web.getTitle());
|
||||
|
Loading…
x
Reference in New Issue
Block a user