Skip to content

Commit

Permalink
Release v0.1.3
Browse files Browse the repository at this point in the history
---------------
Layout renamed to avoid view binding conflict.
  • Loading branch information
jsaura committed Jan 17, 2021
1 parent d5699af commit 9752855
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Change Log
==========
Version 0.1.3 *(2021-01-16)*
----------------------------
Layout renamed to avoid view binding conflict.

Version 0.1.2 *(2021-01-07)*
----------------------------
Layout managers added.
Expand Down
2 changes: 1 addition & 1 deletion gallerydroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
minSdkVersion 17
targetSdkVersion 30
versionCode 1
versionName "0.1.2"
versionName "0.1.3"
multiDexEnabled = true
consumerProguardFiles "consumer-rules.pro"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class GalleryDroid(var items: List<Picture> = listOf()) {
var layoutManager: Int? = LAYOUT_GRID

@LayoutRes
var decoratorLayout: Int? = R.layout.default_decorator
var decoratorLayout: Int? = R.layout.gallery_droid_default_decorator

fun tag(tag: String): GalleryDroid {
this.tag = tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager
import com.jesusd0897.gallerydroid.R
import com.jesusd0897.gallerydroid.databinding.ActivityPictureDetailBinding
import com.jesusd0897.gallerydroid.databinding.GalleryDroidActivityPictureDetailBinding
import com.jesusd0897.gallerydroid.model.Picture
import com.jesusd0897.gallerydroid.util.EXTRA_USE_LABEL_TAG
import com.jesusd0897.gallerydroid.view.fragment.PicturePagerFragment
Expand All @@ -33,7 +33,7 @@ import java.util.*

class PictureDetailActivity : AppCompatActivity() {

private lateinit var binding: ActivityPictureDetailBinding
private lateinit var binding: GalleryDroidActivityPictureDetailBinding

private var pictures = ArrayList<Picture>()
private var position = 0
Expand All @@ -43,7 +43,7 @@ class PictureDetailActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityPictureDetailBinding.inflate(layoutInflater)
binding = GalleryDroidActivityPictureDetailBinding.inflate(layoutInflater)
setContentView(binding.root)
setSupportActionBar(binding.toolbar)
binding.toolbar.setNavigationOnClickListener { onBackPressed() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.jesusd0897.gallerydroid.R
import com.jesusd0897.gallerydroid.databinding.ItemImageBinding
import com.jesusd0897.gallerydroid.databinding.GalleryDroidItemImageBinding
import com.jesusd0897.gallerydroid.model.Picture
import com.jesusd0897.gallerydroid.view.fragment.OnPictureItemClickListener
import com.jesusd0897.kutil.extension.gone
Expand Down Expand Up @@ -48,7 +48,7 @@ class PicturesAdapter(
) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = PictureViewHolder(
ItemImageBinding.inflate(LayoutInflater.from(parent.context), parent, false)
GalleryDroidItemImageBinding.inflate(LayoutInflater.from(parent.context), parent, false)
)

override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
Expand All @@ -57,7 +57,7 @@ class PicturesAdapter(

override fun getItemCount() = items.size

inner class PictureViewHolder(private val binding: ItemImageBinding) :
inner class PictureViewHolder(private val binding: GalleryDroidItemImageBinding) :
RecyclerView.ViewHolder(binding.root) {

private var decoratorLabel: TextView? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.jesusd0897.gallerydroid.R
import com.jesusd0897.gallerydroid.databinding.ItemImageStaggeredBinding
import com.jesusd0897.gallerydroid.databinding.GalleryDroidItemImageStaggeredBinding
import com.jesusd0897.gallerydroid.model.Picture
import com.jesusd0897.gallerydroid.view.fragment.OnPictureItemClickListener
import com.jesusd0897.kutil.extension.gone
Expand Down Expand Up @@ -48,7 +48,11 @@ class StaggeredPicturesAdapter(
) {

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = PictureViewHolder(
ItemImageStaggeredBinding.inflate(LayoutInflater.from(parent.context), parent, false)
GalleryDroidItemImageStaggeredBinding.inflate(
LayoutInflater.from(parent.context),
parent,
false
)
)

override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
Expand All @@ -57,7 +61,7 @@ class StaggeredPicturesAdapter(

override fun getItemCount() = items.size

inner class PictureViewHolder(private val binding: ItemImageStaggeredBinding) :
inner class PictureViewHolder(private val binding: GalleryDroidItemImageStaggeredBinding) :
RecyclerView.ViewHolder(binding.root) {

private var decoratorLabel: TextView? = null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModel
import com.jesusd0897.gallerydroid.R
import com.jesusd0897.gallerydroid.databinding.FragmentRecyclerBinding
import com.jesusd0897.gallerydroid.databinding.GalleryDroidFragmentRecyclerBinding
import com.jesusd0897.kutil.extension.gone
import com.jesusd0897.kutil.extension.visible

Expand All @@ -33,7 +33,7 @@ abstract class BasicFragment : Fragment() {

abstract class RecyclerFragment : BasicFragment() {

private var _binding: FragmentRecyclerBinding? = null
private var _binding: GalleryDroidFragmentRecyclerBinding? = null
protected val binding get() = _binding

protected open var emptyTitle: String? = null
Expand All @@ -45,7 +45,7 @@ abstract class RecyclerFragment : BasicFragment() {
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
_binding = FragmentRecyclerBinding.inflate(inflater, container, false)
_binding = GalleryDroidFragmentRecyclerBinding.inflate(inflater, container, false)
emptyTitle = getString(R.string.no_items_found_title)
emptySubtitle = getString(R.string.no_items_found)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.jesusd0897.gallerydroid.databinding.FragmentPictureBinding
import com.jesusd0897.gallerydroid.databinding.GalleryDroidFragmentPictureBinding
import com.jesusd0897.gallerydroid.model.Picture
import com.jesusd0897.gallerydroid.view.activity.PictureDetailActivity
import com.jesusd0897.kutil.EXTRA_ITEM_TAG
Expand All @@ -27,7 +27,7 @@ import com.squareup.picasso.Picasso

class PictureDetailFragment : Fragment() {

private var _binding: FragmentPictureBinding? = null
private var _binding: GalleryDroidFragmentPictureBinding? = null
private val binding get() = _binding

companion object {
Expand All @@ -53,7 +53,7 @@ class PictureDetailFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View? {
_binding = FragmentPictureBinding.inflate(inflater, container, false)
_binding = GalleryDroidFragmentPictureBinding.inflate(inflater, container, false)
binding?.photoView?.let {
it.setOnClickListener { (activity as PictureDetailActivity).handleDecorVisibility() }
Picasso.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager
import com.jesusd0897.gallerydroid.databinding.FragmentPicturePagerBinding
import com.jesusd0897.gallerydroid.databinding.GalleryDroidFragmentPicturePagerBinding
import com.jesusd0897.gallerydroid.model.GalleryDroid.Companion.TRANSFORMER_BACK_TO_FOREGROUND
import com.jesusd0897.gallerydroid.model.GalleryDroid.Companion.TRANSFORMER_CUBE_OUT
import com.jesusd0897.gallerydroid.model.GalleryDroid.Companion.TRANSFORMER_DEPTH
Expand All @@ -41,7 +41,7 @@ import com.jesusd0897.kutil.EXTRA_POSITION_TAG

class PicturePagerFragment : Fragment() {

private var _binding: FragmentPicturePagerBinding? = null
private var _binding: GalleryDroidFragmentPicturePagerBinding? = null
private val binding get() = _binding

companion object {
Expand Down Expand Up @@ -78,7 +78,7 @@ class PicturePagerFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?
): View? {
_binding = FragmentPicturePagerBinding.inflate(inflater, container, false)
_binding = GalleryDroidFragmentPicturePagerBinding.inflate(inflater, container, false)
val sectionsPagerAdapter = SectionsPagerAdapter(parentFragmentManager)
binding?.picturePageContainer?.setPageTransformer(true, provideTransformer())
binding?.picturePageContainer?.adapter = sectionsPagerAdapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
android:layout_height="match_parent"
android:background="@android:color/transparent"
tools:itemCount="10"
tools:listitem="@layout/item_image" />
tools:listitem="@layout/gallery_droid_item_image" />

</FrameLayout>

0 comments on commit 9752855

Please sign in to comment.