Git Product home page Git Product logo

albert-lii / autogridview Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 5.0 1.87 MB

:traffic_light:AutoGridView可以更轻松实现QQ空间和微信朋友圈的九宫格、点击展开、点击加号添加照片等功能,而且采用Adapter方式,可以自定义item,更加灵活,使用起来就像ListView和BaseAdapter搭配一样简单...

Home Page: https://github.com/albert-lii/AutoGridView

Java 100.00%
adapter add-pictures android autogridview show-grid-pictures

autogridview's Issues

在RecyclerView中滚动时 AutoGridView调用onDetachedFromWindow问题

当RecyclerView向下滚动时 不可见的条目中的AutoGridView会调用onDetachedFromWindow方法释放资源;

这样上下来回滚动几次,再点击AutoGridView中的图片,会因为资源被释放造成点击事件不响应。

解决:
在Adapter中重写onViewRecycled方法,在onViewRecycled方法中调用AutoGridView的释放资源方法。

@OverRide
public void onViewRecycled(@nonnull ItemHolder holder) {
super.onViewRecycled(holder);
holder.autoGridView.release();
}

图片很多的时候如何像ScrollView可上下滑动

你的AutoGridView不支持上下滑动,当我有很多图片的时候,我在外层加了一个ScrollView,但是显示大图浏览模式有问题,会只在屏幕的最上边一小块显示。

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.liyi.grid.AutoGridView
        android:id="@+id/autoGridView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:grid_column="3" />

    <com.liyi.viewer.widget.ImageViewer
        android:id="@+id/imagePreivew"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</RelativeLayout>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.