Wiv

介绍:

类似Tweet-ui的TweetMediaView组件

运行效果:

使用说明:

MediaView mediaView;
ArrayList<String> medias;
//medias.add("http://datalook.io/app/uploads/NY.jpg");
mediaView.setOnMediaClickListener(new MediaView.OnMediaClickListener() {
    @Override
    public void onMediaClick(View view, int index) {
        Snackbar.make(view, "onClickIndex :" + index, Snackbar.LENGTH_LONG).show();
    }
});
mediaView.setMedias(medias);
<com.ihsanbal.wiv.AspectRatioLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?attr/actionBarSize"
        app:aspect_ratio="1"
        app:dimension_to_adjust="height">
        <com.ihsanbal.wiv.MediaView
            android:id="@+id/media.view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="14dp"
            app:background_color="@android:color/white"
            app:corner_radii="15dp"
            app:divider_size="2dp" />
</com.ihsanbal.wiv.AspectRatioLayout>

Download

Gradle:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    compile 'com.github.ihsanbal:Wiv:1.0.0'
}

Maven:

<repository>
   <id>jitpack.io</id>
   <url>https://jitpack.io</url>
</repository>
<dependency>
   <groupId>com.github.ihsanbal</groupId>
   <artifactId>Wiv</artifactId>
   <version>1.0.0</version>
</dependency>
已下载
0