Browse Source

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.
master
Anthony Restaino 10 years ago
parent
commit
e7dacc9c10
  1. 1
      res/layout/tab_list_item.xml
  2. 23
      src/acr/browser/lightning/BrowserActivity.java

1
res/layout/tab_list_item.xml

@ -42,6 +42,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="13dp" android:layout_marginRight="13dp"
android:alpha="0.5" android:alpha="0.5"
android:background="?attr/actionBarItemBackground"
android:contentDescription="Delete Tab" android:contentDescription="Delete Tab"
android:gravity="center_vertical" android:gravity="center_vertical"
android:padding="3dp" android:padding="3dp"

23
src/acr/browser/lightning/BrowserActivity.java

@ -32,6 +32,7 @@ import android.os.Handler;
import android.os.Message; import android.os.Message;
import android.provider.Browser; import android.provider.Browser;
import android.support.v4.view.GravityCompat; import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.DrawerLayout; import android.support.v4.widget.DrawerLayout;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
@ -346,6 +347,26 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
}; };
anim.setDuration(300); anim.setDuration(300);
anim.setInterpolator(new DecelerateInterpolator()); 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() { new Handler().postDelayed(new Runnable() {
@Override @Override
@ -1568,6 +1589,8 @@ public class BrowserActivity extends ActionBarActivity implements BrowserControl
} }
}); });
ViewCompat.jumpDrawablesToCurrentState(holder.exit);
LightningView web = data.get(position); LightningView web = data.get(position);
holder.txtTitle.setText(web.getTitle()); holder.txtTitle.setText(web.getTitle());

Loading…
Cancel
Save