mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Merge branch '644-missing-header-only' into 'master'
Remove toolbar animation to fix the missing toolbar on first start Closes #644 See merge request !331
This commit is contained in:
@@ -28,7 +28,6 @@ import org.briarproject.android.controller.TransportStateListener;
|
||||
import org.briarproject.android.controller.handler.UiResultHandler;
|
||||
import org.briarproject.android.forum.ForumListFragment;
|
||||
import org.briarproject.android.fragment.BaseFragment;
|
||||
import org.briarproject.android.util.CustomAnimations;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.identity.LocalAuthor;
|
||||
|
||||
@@ -241,7 +240,6 @@ public class NavDrawerActivity extends BriarFragmentActivity implements
|
||||
if (isBlocking) {
|
||||
// Disable navigation drawer slide to open
|
||||
drawerLayout.setDrawerLockMode(LOCK_MODE_LOCKED_CLOSED);
|
||||
CustomAnimations.animateHeight(toolbar, false, 250);
|
||||
}
|
||||
progressTitle.setText(stringId);
|
||||
progressViewGroup.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.briarproject.android.ActivityComponent;
|
||||
import org.briarproject.android.BriarFragmentActivity;
|
||||
import org.briarproject.android.fragment.BaseFragment.BaseFragmentListener;
|
||||
import org.briarproject.android.keyagreement.IntroFragment.IntroScreenSeenListener;
|
||||
import org.briarproject.android.util.CustomAnimations;
|
||||
import org.briarproject.api.contact.ContactExchangeListener;
|
||||
import org.briarproject.api.contact.ContactExchangeTask;
|
||||
import org.briarproject.api.db.DbException;
|
||||
@@ -123,16 +122,12 @@ public class KeyAgreementActivity extends BriarFragmentActivity implements
|
||||
|
||||
@Override
|
||||
public void showLoadingScreen(boolean isBlocking, int stringId) {
|
||||
if (isBlocking) {
|
||||
CustomAnimations.animateHeight(toolbar, false, 250);
|
||||
}
|
||||
progressTitle.setText(stringId);
|
||||
progressContainer.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hideLoadingScreen() {
|
||||
CustomAnimations.animateHeight(toolbar, true, 250);
|
||||
progressContainer.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
package org.briarproject.android.util;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static android.view.View.MeasureSpec.UNSPECIFIED;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
public class CustomAnimations {
|
||||
|
||||
public static void animateHeight(final ViewGroup viewGroup,
|
||||
final boolean isExtending, int duration) {
|
||||
ValueAnimator anim;
|
||||
if (isExtending) {
|
||||
viewGroup.setVisibility(VISIBLE);
|
||||
viewGroup.measure(UNSPECIFIED, UNSPECIFIED);
|
||||
anim = ValueAnimator.ofInt(0, viewGroup.getMeasuredHeight());
|
||||
} else {
|
||||
anim = ValueAnimator.ofInt(viewGroup.getHeight(), 0);
|
||||
}
|
||||
anim.addListener(new Animator.AnimatorListener() {
|
||||
|
||||
@Override
|
||||
public void onAnimationStart(Animator animation) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
if (!isExtending) {
|
||||
viewGroup.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
}
|
||||
});
|
||||
anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||
@Override
|
||||
public void onAnimationUpdate(ValueAnimator valueAnimator) {
|
||||
int val = (Integer) valueAnimator.getAnimatedValue();
|
||||
ViewGroup.LayoutParams layoutParams =
|
||||
viewGroup.getLayoutParams();
|
||||
layoutParams.height = val;
|
||||
viewGroup.setLayoutParams(layoutParams);
|
||||
}
|
||||
});
|
||||
anim.setDuration(duration);
|
||||
anim.start();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user