Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c673a37
Adding feature of issues listing
n2oliver Apr 9, 2019
5fb20f7
Merge remote-tracking branch 'origin/feature/23-adding-feature-of-iss…
n2oliver Apr 11, 2019
095fa3c
Adding activity RepoDetailsActivity and its layout and changing the d…
n2oliver Apr 11, 2019
2188639
Adding navigation up support to toolbar and fixing the relative layou…
n2oliver Apr 11, 2019
5aa866b
Creating and addin RepoDetailsPagerAdapter to repo_detail_viewpager, …
n2oliver Apr 11, 2019
6903b05
Removing the default text string of fragments
n2oliver Apr 12, 2019
718dcd3
Adding funcionalities from IssueListActivity to the IssuesFragment. O…
Apr 12, 2019
d0bd97f
Fixing return of IssuesFragment.kt to fix the visibility of the fragment
n2oliver Apr 13, 2019
ba86bf2
Removing toolbar from activity_issues_list (that will be the fragment…
n2oliver Apr 13, 2019
5811119
Renaming IssuesFragment to IssuesListFragment and activity_issues_lis…
n2oliver Apr 13, 2019
bd27a7f
Removing access to IssueListActivity and access function of PullReque…
n2oliver Apr 13, 2019
83586b6
Optimizing imports from RepoListActivity
n2oliver Apr 13, 2019
e52f250
Removing not used fragment.
Apr 15, 2019
c21643a
Renaming TabLayout and ViewPager components
Apr 17, 2019
20a08e7
Tranferring titles to string resources and getting them by applicatio…
Apr 17, 2019
4384a55
Creating companion object to store constants on RepoDetailsPagerAdapt…
Apr 17, 2019
a434c13
Moving packages from parent package to repodetails package.
Apr 18, 2019
4a6a769
Moving PullRequestList to a Fragment.
Apr 18, 2019
2b93ca6
Removing unecessary files.
Apr 18, 2019
6a9a777
Renaming layout of fragment to fragment_pull_request_list.xml.
Apr 18, 2019
f9e1472
Deleting PullRequestsFragment and fixing the calling to PullRequestLi…
Apr 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
android:screenOrientation="portrait"
android:name=".issuelist.IssueListActivity_" />

<activity
android:label="@string/app_name"
android:screenOrientation="portrait"
android:name=".repodetails.RepoDetailsActivity_" />

<meta-data
android:name="io.fabric.ApiKey"
android:value="e31ee77a076b044cb52e3fedbad573fac9b5ee96" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package br.com.luisfernandez.github.client.koin

import br.com.luisfernandez.github.client.issuelist.IssueListModel
import br.com.luisfernandez.github.client.issuelist.IssueListModelImpl
import br.com.luisfernandez.github.client.pullrequest.PullRequestModel
import br.com.luisfernandez.github.client.pullrequest.PullRequestModelImpl
import br.com.luisfernandez.github.client.repodetails.issuelist.IssueListModel
import br.com.luisfernandez.github.client.repodetails.issuelist.IssueListModelImpl
import br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestModel
import br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestModelImpl
import br.com.luisfernandez.github.client.repolist.RepoListModel
import br.com.luisfernandez.github.client.repolist.RepoListModelImpl
import org.koin.dsl.module.module
Expand All @@ -16,8 +16,8 @@ val modelModule = module {
)
}

single<PullRequestModel> {
PullRequestModelImpl(
single<br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestModel> {
br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestModelImpl(
get()
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package br.com.luisfernandez.github.client.koin

import br.com.luisfernandez.github.client.pullrequest.PullRequestPresenter
import br.com.luisfernandez.github.client.pullrequest.PullRequestPresenterImpl
import br.com.luisfernandez.github.client.repolist.RepoListPresenter
import br.com.luisfernandez.github.client.repolist.RepoListPresenterImpl
import org.koin.dsl.module.module
Expand All @@ -10,8 +8,4 @@ val presenterModule = module {
single<RepoListPresenter> {
RepoListPresenterImpl(get())
}

single<PullRequestPresenter> {
PullRequestPresenterImpl(get())
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

package br.com.luisfernandez.github.client.koin

import br.com.luisfernandez.github.client.issuelist.IssueListViewModel
import br.com.luisfernandez.github.client.pullrequest.PullRequestViewModel
import br.com.luisfernandez.github.client.repodetails.issuelist.IssueListViewModel
import br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestViewModel
import br.com.luisfernandez.github.client.repolist.RepoListViewModel
import org.koin.android.viewmodel.ext.koin.viewModel
import org.koin.dsl.module.module
Expand All @@ -16,8 +16,8 @@ val viewModelModule = module {
)
}

viewModel<PullRequestViewModel> {
PullRequestViewModel(
viewModel<br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestViewModel> {
br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestViewModel(
get()
)
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package br.com.luisfernandez.github.client.repodetails


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

import br.com.luisfernandez.github.client.R

class BranchesFragment : Fragment() {

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {

return inflater.inflate(R.layout.fragment_branches, container, false)
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package br.com.luisfernandez.github.client.repodetails


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

import br.com.luisfernandez.github.client.R

class CollaboratorsFragment : Fragment() {

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {

return inflater.inflate(R.layout.fragment_collaborators, container, false)
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package br.com.luisfernandez.github.client.repodetails


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

import br.com.luisfernandez.github.client.R

class CommitsFragment : Fragment() {

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?): View? {

return inflater.inflate(R.layout.fragment_commits, container, false)
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package br.com.luisfernandez.github.client.repodetails

import android.annotation.SuppressLint
import android.support.v7.app.AppCompatActivity
import br.com.luisfernandez.github.client.R
import kotlinx.android.synthetic.main.activity_repo_details.*
import org.androidannotations.annotations.AfterViews
import org.androidannotations.annotations.EActivity
import org.androidannotations.annotations.Extra

@SuppressLint("Registered")
@EActivity(R.layout.activity_repo_details)
class RepoDetailsActivity : AppCompatActivity() {

@Extra
lateinit var owner: String

@Extra
lateinit var repoName: String

@AfterViews
fun afterViews() {
this.configToolbar()

val fragmentAdapter = RepoDetailsPagerAdapter(this, supportFragmentManager, owner, repoName)
viewPagerRepoDetail.adapter = fragmentAdapter

tabLayoutRepoDetail.setupWithViewPager(viewPagerRepoDetail)
}

private fun configToolbar() {
setSupportActionBar(toolbar)
supportActionBar?.let {
title = repoName
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setDisplayShowHomeEnabled(true)
supportActionBar?.setDisplayShowTitleEnabled(true)
}
}

override fun onSupportNavigateUp(): Boolean {
onBackPressed()
return true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package br.com.luisfernandez.github.client.repodetails

import android.content.Context
import android.os.Bundle
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter
import br.com.luisfernandez.github.client.R
import br.com.luisfernandez.github.client.repodetails.issuelist.IssuesListFragment
import br.com.luisfernandez.github.client.repodetails.pullrequest.PullRequestListFragment

class RepoDetailsPagerAdapter(private val context: Context, fm: FragmentManager, owner: String, repoName: String):
FragmentPagerAdapter(fm) {

companion object {
const val OWNER = "OWNER"
const val REPONAME = "REPONAME"
}

val owner = owner
val repoName = repoName

override fun getCount(): Int {
return 5
}

override fun getItem(position: Int): Fragment {
val bundle = Bundle()
bundle.putString(OWNER, owner)
bundle.putString(REPONAME, repoName)

var fragment = when(position) {
0 -> PullRequestListFragment()
1 -> IssuesListFragment()
2 -> CommitsFragment()
3 -> CollaboratorsFragment()
4 -> BranchesFragment()

else -> PullRequestListFragment()
}

fragment.arguments = bundle

return fragment
}

override fun getPageTitle(position: Int): CharSequence? {
return when(position){
0 -> context.getString(R.string.titlePullRequestsTab)
1 -> context.getString(R.string.titleIssuesTab)
2 -> context.getString(R.string.titleCommitsTab)
3 -> context.getString(R.string.titleCollaboratorsTab)
4 -> context.getString(R.string.titleBranchesTab)

else -> context.getString(R.string.titlePullRequestsTab)
}
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.luisfernandez.github.client.issuelist
package br.com.luisfernandez.github.client.repodetails.issuelist

import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.luisfernandez.github.client.issuelist
package br.com.luisfernandez.github.client.repodetails.issuelist

import br.com.luisfernandez.github.client.pojo.IssueResponse
import io.reactivex.Observable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.luisfernandez.github.client.issuelist
package br.com.luisfernandez.github.client.repodetails.issuelist

import br.com.luisfernandez.github.client.http.GitHubService
import br.com.luisfernandez.github.client.pojo.IssueResponse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.luisfernandez.github.client.issuelist
package br.com.luisfernandez.github.client.repodetails.issuelist

import br.com.luisfernandez.github.client.http.model.GitHubErrorBody
import br.com.luisfernandez.github.client.mvp.LoadContentView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package br.com.luisfernandez.github.client.issuelist
package br.com.luisfernandez.github.client.repodetails.issuelist

import android.arch.lifecycle.MutableLiveData
import android.arch.lifecycle.ViewModel
Expand Down
Loading