我正在制作一个汉字卡片应用程序.我希望有一个LinearLayout代表前面和另一个代表卡的背面,我已经在一个XML布局中声明了.问题是,第二个LinearLayout总是不可见的,第一个通常是动画.无论如何在动画进行时进行方法调用?我想将第一个布局的可见性设置GONE为第二个布局VISIBLE?
或者是否有另一种更好的方法来实现翻转卡?
以下是我的代码.预先感谢.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_container_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#ff825e4e" >
<LinearLayout
android:id="@+id/card_front_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:gravity="center"
android:background="@drawable/card_shape_front">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="?"
android:textColor="#ff000000"
android:textSize="200sp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/card_back_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:layout_margin="10dp"
android:background="@drawable/card_shape_front">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="QWERTY"
android:textColor="#ff000000"/>
</LinearLayout>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
FlashcardsFragment.java
public class FlashcardsFragment extends Fragment
{
private AnimatorSet showFrontAnim = new AnimatorSet();
private AnimatorSet showBackAnim = new AnimatorSet();
private boolean isShowingBack = false;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, …Run Code Online (Sandbox Code Playgroud) 我想要一个包含两列的字典数据库(word, definition)。fts有没有办法只在列上实现word?因为 的大小definition相当大,所以无论如何也不会对其执行任何查询。或者我应该分成word另一个表并fts对其进行应用?
谢谢 :)
我正在编写一个应用程序,需要从互联网加载大量图像(漫画阅读器)。我需要缓存一些缩略图以供离线使用,其他任何图像都应在应用程序关闭时清除。
我在 Glide 页面上读到了一些关于缓存失效的内容,他们说最好的方法是更改内容 url,但是 Glide 如何知道它是旧内容的修改后的 url 还是新内容呢?我是新来的滑翔机。
https://github.com/bumptech/glide/wiki/Caching-and-Cache-Invalidation
预先感谢 :)