|
|
@@ -8,6 +8,7 @@ import android.view.View;
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
import androidx.appcompat.app.AlertDialog;
|
|
|
+import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
|
import androidx.fragment.app.Fragment;
|
|
|
import androidx.viewpager.widget.ViewPager;
|
|
|
|
|
|
@@ -107,6 +108,21 @@ public class TabActivity extends BaseBeiActivity implements View.OnClickListener
|
|
|
View rl_search = findViewById(R.id.rl_search);
|
|
|
// 搜索图标动画
|
|
|
AppBarLayout abl_main = findViewById(R.id.abl_main);
|
|
|
+
|
|
|
+ // AppBarLayout不能被拖动
|
|
|
+ CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) abl_main.getLayoutParams();
|
|
|
+ abl_main.post(() -> {
|
|
|
+ AppBarLayout.Behavior behavior = (AppBarLayout.Behavior) params.getBehavior();
|
|
|
+ if (behavior != null) {
|
|
|
+ behavior.setDragCallback(new AppBarLayout.Behavior.DragCallback() {
|
|
|
+ @Override
|
|
|
+ public boolean canDrag(AppBarLayout appBarLayout) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
AppbarTranslateListener listener = new AppbarTranslateListener(
|
|
|
this,
|
|
|
defaultWidth, defaultHeight,
|