forked from antoniolg/Bandhook-Kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to design support library, add view pager for artist bio and …
…albums
- Loading branch information
Alexey Verein
committed
Jul 8, 2016
1 parent
f649049
commit 575438c
Showing
20 changed files
with
374 additions
and
320 deletions.
There are no files selected for viewing
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
109 changes: 0 additions & 109 deletions
109
app/src/main/java/com/antonioleiva/bandhookkotlin/ui/activity/ScrollableHeaderActivity.kt
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
app/src/main/java/com/antonioleiva/bandhookkotlin/ui/adapter/ArtistDetailPagerAdapter.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,33 @@ | ||
package com.antonioleiva.bandhookkotlin.ui.adapter | ||
|
||
import android.support.v4.app.Fragment | ||
import android.support.v4.app.FragmentManager | ||
import android.support.v4.app.FragmentPagerAdapter | ||
import java.util.* | ||
|
||
/** | ||
* @author tpom6oh@gmail.com | ||
* | ||
* 01/07/16. | ||
*/ | ||
|
||
class ArtistDetailPagerAdapter(fragmentManager: FragmentManager): FragmentPagerAdapter(fragmentManager) | ||
{ | ||
val fragments = LinkedHashMap<Fragment, String>() | ||
|
||
override fun getItem(position: Int): Fragment? { | ||
return fragments.keys.elementAt(position) | ||
} | ||
|
||
override fun getCount(): Int { | ||
return fragments.keys.size | ||
} | ||
|
||
fun addFragment(fragment: Fragment, title: String) { | ||
fragments.put(fragment, title) | ||
} | ||
|
||
override fun getPageTitle(position: Int): CharSequence { | ||
return fragments.values.elementAt(position) | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
app/src/main/java/com/antonioleiva/bandhookkotlin/ui/custom/ObservableScrollView.kt
This file was deleted.
Oops, something went wrong.
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
45 changes: 45 additions & 0 deletions
45
app/src/main/java/com/antonioleiva/bandhookkotlin/ui/screens/detail/AlbumsFragment.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,45 @@ | ||
package com.antonioleiva.bandhookkotlin.ui.screens.detail | ||
|
||
|
||
import android.os.Bundle | ||
import android.support.v4.app.Fragment | ||
import android.support.v7.widget.RecyclerView | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.antonioleiva.bandhookkotlin.R | ||
import com.antonioleiva.bandhookkotlin.ui.adapter.ImageTitleAdapter | ||
import com.antonioleiva.bandhookkotlin.ui.entity.ImageTitle | ||
|
||
/** | ||
* @author alexey@plainvanillagames.com | ||
* | ||
* 01/07/16. | ||
*/ | ||
|
||
class AlbumsFragment: Fragment() { | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | ||
|
||
val view = inflater.inflate(R.layout.fragment_albums, container, false) | ||
|
||
if (view != null) { | ||
setUpRecyclerView(view) | ||
return view | ||
} | ||
return super.onCreateView(inflater, container, savedInstanceState) | ||
} | ||
|
||
private fun setUpRecyclerView(view: View) { | ||
val recyclerView = view.findViewById(R.id.albums_view) as RecyclerView | ||
val adapter = ImageTitleAdapter(); | ||
mockAdapterContent(adapter) | ||
recyclerView.adapter = adapter; | ||
} | ||
|
||
private fun mockAdapterContent(adapter: ImageTitleAdapter) { | ||
val imageTile = ImageTitle("0", "The Dark Side of the Moon", | ||
"http://a.fastcompany.net/multisite_files/fastcompany/imagecache/inline-large/inline/2014/12/3039377-inline-i-3-the-dark-side-of-the-moon-cover-pf-dark-side-copy.jpg"); | ||
adapter.items = listOf(imageTile, imageTile, imageTile, imageTile, imageTile, imageTile) | ||
} | ||
} |
Oops, something went wrong.