小编Har*_*rdy的帖子

Imageview中的并行动画

我想实现类似下图的动画.

我已经使用了ThreePhaseBottomLibrary,根据我的经验,当我向上滚动时动画应该按照上面的图像并行!

下面是我的Fragment类.它的工作正常,除了这个图像并行动画按照屏幕:

Myfragment.java

public class MyFragment extends BottomSheetFragment {
private BottomSheetLayout mBottomSheetLayout;
private ImageView mBottomSheetBackgroundImageView;
private int mBottomSheetHeight;
private ImageView movingIconImageView;
private AppBarLayout mAppBarLayout;
private int mMStartMarginBottom;
private int mMStartMarginLeft;
private Toolbar mToolbar;

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final View view = inflater.inflate(R.layout.fragment_my, container, false);
    mBottomSheetHeight = getResources().getDimensionPixelSize(R.dimen.header_height);
    mAppBarLayout = (AppBarLayout) view.findViewById(R.id.appbar);
    view.setMinimumHeight(getResources().getDisplayMetrics().heightPixels);
    CollapsingToolbarLayout collapsingToolbar = (CollapsingToolbarLayout) view.findViewById(R.id.collapsing_toolbar);
    //collapsingToolbar.setTitle("Title");
    collapsingToolbar.setTitleEnabled(false);
    mToolbar = (Toolbar) view.findViewById(R.id.toolbar);
    //final AppCompatActivity activity = (AppCompatActivity) getActivity();
    //activity.setSupportActionBar(toolbar); …
Run Code Online (Sandbox Code Playgroud)

android android-animation android-imageview

18
推荐指数
1
解决办法
681
查看次数

具有多个行和列的Recycler视图 - AutoFit,如Flow Layout [Android]

我正在构建一个像这样的布局的挑战:

在此输入图像描述

我的第一个见解是使用带有适配器的RecyclerView,该适配器可以处理每个项目并使其布局膨胀.

到目前为止,还不是那么好.

到目前为止我有这个布局:

在此输入图像描述

我可以感觉到我几乎就在那里,但是真的......我花了一个星期思考如何让它变得更好,或者就像UI提出的那样.

我的一些尝试是

  1. 使用网格布局并根据列表中的项目数更改最大列数
  2. StaggeredGridLayoutManager听起来像是一个强大的候选者来修复它并让我开心,但不幸的是,当我尝试使用它时,我意识到我们需要在构造函数上传递一些spanCount(列),我找到了一些方法来解决这个限制,改变了每行的列数,但我不喜欢最终结果,不像我在Foursquare等其他应用中看到的那样设置您的兴趣.
  3. 我查看了这个库Flow Layout,但我甚至没有开始使用它,因为我不想失去整个回收器的视图功能,我相信有一种方法可以使它工作!.....即使知道图书馆完全符合我的需要.

伙计们,我不是在这里寻找一些已经完成的代码安静或者有人来完成我的工作.其实我正在寻找隧道尽头的灯光.

android layout-manager flowlayout gridlayoutmanager android-recyclerview

14
推荐指数
1
解决办法
8302
查看次数

Sliver Appbar [折叠工具栏] 在 Flutter 中从左到中心动画标题

这是我的折叠工具栏的构建方法:-

     @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: CustomScrollView(
        controller: controller,
        slivers: <Widget>[
          SliverAppBar(
            pinned: true,
            expandedHeight: appBarHeight,
            leading: IconButton(
              icon: Icon(
                Icons.arrow_back_ios,
                color: Colors.black,
              ),
              onPressed: () => null,
            ),
            floating: true,
            flexibleSpace: FlexibleSpaceBar(

          titlePadding: EdgeInsets.only(left:leftV , bottom:bottomV ),
          title: Text(
            "Title ",
            style: TextStyle(
              color: Colors.black,
              fontSize: 16.0,
            ),
          ),
        ),
      ),
      SliverList(delegate:
          SliverChildBuilderDelegate((BuildContext context, int index) {
        return ListTile(title: Text("Flutter / $index"));
      }))
    ],
  ),
);
}
Run Code Online (Sandbox Code Playgroud)

根据文档,我得到了删除填充的解决方案:-

EdgeInsetsDirectional.only(start: 72, bottom: 16)/// 默认情况下,如果标题 /// 不居中,则此属性的值为 …

android-collapsingtoolbarlayout flutter flutter-sliver

10
推荐指数
2
解决办法
1万
查看次数

Android中类似Twitter的启动画面动画

如何在Android应用程序中实现像Twitter启动画面动画(来自iOS Twitter版本)的效果?有图书馆https://github.com/callumboddy/CBZSplashView但它仅适用于iOS.

twitter android android-animation

3
推荐指数
1
解决办法
7645
查看次数

如何在 Flutter 中限制文本输入中的特殊字符?

我只想使用 Alphabat、空格和“-”作为使用“Textinput”的名称输入。

用法:- 对于用户名输入,我们不希望用户输入“(,),$,%,&,*”字符。

textinputlayout flutter flutter-layout

0
推荐指数
1
解决办法
1971
查看次数