Tôi có vấn đề rất kỳ quặc mà tôi không thể tìm ra. Tôi đã không phải là một vấn đề cho đến gần đây nhưng tôi dường như không thể quay trở lại để ngăn chặn nó. Ngoài ra điều kỳ lạ khác là nó hoạt động trên một số thiết bị và những người khác nó không.Snackbar và các hoạt ảnh khác ngừng hoạt động trên một số thiết bị Android
Sự cố là hình động. Một đặc biệt là quầy bar bán đồ ăn nhanh. Các snackbar nên animate lên và xuống nhưng nó không phải là. nó chỉ hiển thị sau đó ẩn. kiểm tra video dưới đây để xem vấn đề.
Đây là mã Android để animate snackbar ở
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
ViewCompat.setTranslationY(mView, mView.getHeight());
ViewCompat.animate(mView)
.translationY(0f)
.setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
.setDuration(ANIMATION_DURATION)
.setListener(new ViewPropertyAnimatorListenerAdapter() {
@Override
public void onAnimationStart(View view) {
mView.animateChildrenIn(ANIMATION_DURATION - ANIMATION_FADE_DURATION,
ANIMATION_FADE_DURATION);
}
@Override
public void onAnimationEnd(View view) {
onViewShown();
}
}).start();
}
của nó sử dụng ViewCompat cho v4 Thư viện. Tôi có các hoạt ảnh khác hoạt động trong một hoạt động khác hoạt động tốt. Vấn đề cũng không chỉ là một hoạt động của tất cả chúng. Điều đó làm cho tôi nghĩ rằng hệ thống của nó rộng bằng cách nào đó. Nhưng tất cả đều sử dụng các chủ đề nội bộ khác nhau nhưng tất cả mở rộng Theme.AppCompat.NoActionBar.
Đây là bố cục chính của tôi
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:elevation="4dp">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:titleTextAppearance="@style/ToolbarTitle"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:layout_scrollFlags="scroll|enterAlways|snap"/>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabTextAppearance="@style/TabText"
app:tabMinWidth="@dimen/tab_minwidth"
app:tabMode="fixed"
app:tabGravity="fill"
app:layout_scrollFlags="enterAlways"/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" >
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
<fr.castorflex.android.circularprogressbar.CircularProgressBar
android:id="@+id/base_progressSpinner"
android:layout_gravity="center"
android:layout_width="48dp"
android:layout_height="48dp"
android:indeterminate="true"
android:visibility="invisible"
app:cpb_color="@color/spinner"
app:cpb_rotation_speed="1.0"
app:cpb_sweep_speed="1.0"
app:cpb_stroke_width="4dp"
app:cpb_min_sweep_angle="10"
app:cpb_max_sweep_angle="300"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_upload"
android:visibility="gone"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_anchor="@id/content_frame"
app:layout_anchorGravity="bottom|right|end"
app:borderWidth="0dp"
android:src="@drawable/app_fab_upload"
android:layout_margin="@dimen/big_padding"
android:clickable="true"
app:backgroundTint="@color/fab_social"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab_muzei"
android:visibility="gone"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
app:layout_anchor="@id/content_frame"
app:layout_anchorGravity="bottom|right|end"
app:borderWidth="0dp"
android:src="@drawable/app_fab_muzei"
android:layout_margin="@dimen/big_padding"
android:clickable="true"
app:backgroundTint="@color/fab_social"/>
</android.support.design.widget.CoordinatorLayout>
Devices nó hoạt động trên
- Nexus 9 (Marshmallow)
- Nexus 4 (KitKat)
- Galaxy S7 (Marshmallow)
Devices nó không hoạt động
- Droid Turbo 2 (Marshmallow)
- Galaxy S7 (Marshmallow) * tác phẩm điện thoại của tôi, xét nghiệm của tôi không
- Nexus 6p (Android N)
Các sự cố hoạt ảnh khác là với Công tắc. Tôi có 2 trong cùng một bố trí và một trong những stutters khi chuyển đổi và khác chỉ chuyển đổi không có hình ảnh động.
Tôi cũng có một LayoutTransition thiết lập để AppBarLayout tôi để hình ảnh động các ẩn/hiển thị của TabLayout của tôi và nó hoạt động tốt và tất cả các thiết bị
liên kết video bị hỏng – ademar111190
trên Samsung J5 pro (Nougat) cũng không hoạt động. –
Tất cả dòng sản phẩm Moto đều có cùng sự cố. – zackygaurav