-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
170 additions
and
13 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
app/src/main/java/com/example/a83661/screenrecorder/ui/adapter/LocalGifAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.example.a83661.screenrecorder.ui.adapter | ||
|
||
import android.content.Context | ||
import android.support.v7.widget.RecyclerView | ||
import android.support.v7.widget.RecyclerView.Adapter | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.ImageView | ||
import com.bumptech.glide.Glide | ||
import com.example.a83661.screenrecorder.R | ||
import java.io.File | ||
|
||
/** | ||
* @author:honglei92 | ||
* @time:2018/7/9 | ||
*/ | ||
|
||
class LocalGifAdapter(var context: Context, var gifPaths: ArrayList<String>) : Adapter<LocalGifAdapter.ViewHolder>() { | ||
lateinit var mOnItemClickListener: OnItemClickListener | ||
override fun onCreateViewHolder(p0: ViewGroup, p1: Int): ViewHolder { | ||
return ViewHolder(LayoutInflater.from(context).inflate(R.layout.item_local_gif, p0, false)) | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return gifPaths.size | ||
} | ||
|
||
override fun onBindViewHolder(p0: ViewHolder, p1: Int) { | ||
Glide.with(context).load(File(gifPaths[p1])).asGif().into(p0.mGifIv) | ||
p0.mShareGifiv.setOnClickListener { | ||
mOnItemClickListener.onItemClick(it, p1) | ||
} | ||
} | ||
|
||
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { | ||
var mGifIv: ImageView = itemView.findViewById(R.id.gifIv) | ||
var mShareGifiv: ImageView = itemView.findViewById(R.id.ivShareGif) | ||
} | ||
|
||
fun setOnItemClickListener(onItemClickListener: OnItemClickListener) { | ||
this.mOnItemClickListener = onItemClickListener | ||
} | ||
|
||
interface OnItemClickListener { | ||
fun onItemClick(view: View, position: Int) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 59 additions & 1 deletion
60
app/src/main/java/com/example/a83661/screenrecorder/ui/fragment/GifFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<ImageView | ||
android:id="@+id/gifIv" | ||
android:layout_width="120dp" | ||
android:layout_height="120dp" /> | ||
|
||
<ImageView | ||
android:id="@+id/ivShareGif" | ||
android:layout_width="20dp" | ||
android:layout_height="20dp" | ||
android:layout_marginLeft="10dp" | ||
android:layout_marginTop="10dp" | ||
android:layout_marginBottom="10dp" | ||
android:src="@mipmap/icon_share" /> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ allprojects { | |
repositories { | ||
google() | ||
jcenter() | ||
maven { url 'https://jitpack.io' } | ||
} | ||
} | ||
|
||
|