-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/28 adding navigation screen of repository content by tabs #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
n2oliver
wants to merge
6
commits into
luisfernandezbr:develop
Choose a base branch
from
n2oliver:feature/28-adding-navigation-screen-of-repository-content-by-tabs
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c673a37
Adding feature of issues listing
n2oliver 5fb20f7
Merge remote-tracking branch 'origin/feature/23-adding-feature-of-iss…
n2oliver 095fa3c
Adding activity RepoDetailsActivity and its layout and changing the d…
n2oliver 2188639
Adding navigation up support to toolbar and fixing the relative layou…
n2oliver 5aa866b
Creating and addin RepoDetailsPagerAdapter to repo_detail_viewpager, …
n2oliver 6903b05
Removing the default text string of fragments
n2oliver File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
21 changes: 21 additions & 0 deletions
21
app/src/main/java/br/com/luisfernandez/github/client/repodetails/BranchesFragment.kt
This file contains hidden or 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,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) | ||
} | ||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/br/com/luisfernandez/github/client/repodetails/CollaboratorsFragment.kt
This file contains hidden or 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,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) | ||
} | ||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/br/com/luisfernandez/github/client/repodetails/CommitsFragment.kt
This file contains hidden or 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,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) | ||
} | ||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/br/com/luisfernandez/github/client/repodetails/IssuesFragment.kt
This file contains hidden or 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,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 IssuesFragment : Fragment() { | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle?): View? { | ||
|
||
return inflater.inflate(R.layout.fragment_issues, container, false) | ||
} | ||
|
||
|
||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/br/com/luisfernandez/github/client/repodetails/PullRequestsFragment.kt
This file contains hidden or 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,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 PullRequestsFragment : Fragment() { | ||
|
||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle?): View? { | ||
|
||
return inflater.inflate(R.layout.fragment_pull_requests, container, false) | ||
} | ||
|
||
|
||
} |
45 changes: 45 additions & 0 deletions
45
app/src/main/java/br/com/luisfernandez/github/client/repodetails/RepoDetailsActivity.kt
This file contains hidden or 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 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(supportFragmentManager) | ||
repo_detail_viewpager.adapter = fragmentAdapter | ||
|
||
repo_detail_tablayout.setupWithViewPager(repo_detail_viewpager) | ||
} | ||
|
||
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 | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
app/src/main/java/br/com/luisfernandez/github/client/repodetails/RepoDetailsPagerAdapter.kt
This file contains hidden or 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,38 @@ | ||
package br.com.luisfernandez.github.client.repodetails | ||
|
||
import android.support.v4.app.Fragment | ||
import android.support.v4.app.FragmentManager | ||
import android.support.v4.app.FragmentPagerAdapter | ||
|
||
class RepoDetailsPagerAdapter(fm: FragmentManager): | ||
FragmentPagerAdapter(fm) { | ||
|
||
override fun getCount(): Int { | ||
return 5 | ||
} | ||
|
||
override fun getItem(position: Int): Fragment { | ||
return when(position) { | ||
0 -> PullRequestsFragment() | ||
1 -> IssuesFragment() | ||
2 -> CommitsFragment() | ||
3 -> CollaboratorsFragment() | ||
4 -> BranchesFragment() | ||
|
||
else -> PullRequestsFragment() | ||
} | ||
} | ||
|
||
override fun getPageTitle(position: Int): CharSequence? { | ||
return when(position){ | ||
0 -> "PullRequests" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Será que não faria mais sentido adicionarmos esses textos no arquivo de strings? |
||
1 -> "Issues" | ||
2 -> "Commits" | ||
3 -> "Collaborators" | ||
4 -> "Branches" | ||
|
||
else -> "PullRequests" | ||
} | ||
} | ||
|
||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -15,6 +15,7 @@ import br.com.luisfernandez.github.client.http.model.ServerError | |
import br.com.luisfernandez.github.client.issuelist.IssueListActivity_ | ||
import br.com.luisfernandez.github.client.pojo.Repo | ||
import br.com.luisfernandez.github.client.pullrequest.PullRequestListActivity_ | ||
import br.com.luisfernandez.github.client.repodetails.RepoDetailsActivity_ | ||
import com.crashlytics.android.answers.Answers | ||
import com.crashlytics.android.answers.SearchEvent | ||
import com.miguelcatalan.materialsearchview.MaterialSearchView | ||
|
@@ -128,7 +129,7 @@ class RepoListActivity : AppCompatActivity(), RepoListView { | |
private fun getOnItemClickListener(): OnItemClickListener<Repo> { | ||
return object : OnItemClickListener<Repo> { | ||
override fun onItemClick(type: Repo) { | ||
goToPullRequestActivity(type) | ||
goToRepoDetailsActivity(type) | ||
} | ||
} | ||
} | ||
|
@@ -165,6 +166,14 @@ class RepoListActivity : AppCompatActivity(), RepoListView { | |
.start() | ||
} | ||
|
||
private fun goToRepoDetailsActivity(type: Repo) { | ||
RepoDetailsActivity_ | ||
.intent(this@RepoListActivity) | ||
.owner(type.owner.login) | ||
.repoName(type.name) | ||
.start() | ||
} | ||
|
||
private fun loadMoreContent() { | ||
[email protected] = true | ||
recyclerView.post { repoListAdapter.showFooter() } | ||
|
This file contains hidden or 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,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:animateLayoutChanges="true"> | ||
|
||
<android.support.v7.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="?attr/colorPrimary" | ||
android:minHeight="?attr/actionBarSize" | ||
android:theme="@style/AppTheme.AppBarOverlay" /> | ||
|
||
<android.support.design.widget.TabLayout | ||
android:id="@+id/repo_detail_tablayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:tabMode="scrollable" | ||
android:layout_below="@+id/toolbar"/> | ||
|
||
<android.support.v4.view.ViewPager | ||
android:id="@+id/repo_detail_viewpager" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:clipToPadding="true" | ||
android:layout_below="@+id/repo_detail_tablayout"/> | ||
|
||
</RelativeLayout> |
This file contains hidden or 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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".repodetails.BranchesFragment"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:textSize="24sp" | ||
android:text="Conteúdo da aba Branches" | ||
android:gravity="center"/> | ||
|
||
</RelativeLayout> |
This file contains hidden or 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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".repodetails.CollaboratorsFragment"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:textSize="24sp" | ||
android:text="Conteúdo da aba Collaborators" | ||
android:gravity="center"/> | ||
|
||
</RelativeLayout> |
This file contains hidden or 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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".repodetails.CommitsFragment"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:textSize="24sp" | ||
android:text="Conteúdo da aba Commits" | ||
android:gravity="center"/> | ||
|
||
</RelativeLayout> |
This file contains hidden or 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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".repodetails.IssuesFragment"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:textSize="24sp" | ||
android:text="Conteúdo da aba Issues" | ||
android:gravity="center"/> | ||
|
||
</RelativeLayout> |
This file contains hidden or 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,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".repodetails.PullRequestsFragment"> | ||
|
||
<TextView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:textSize="24sp" | ||
android:text="Conteúdo da aba PullRequests" | ||
android:gravity="center"/> | ||
|
||
</RelativeLayout> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideal é seguir o padrão de nomenclatura de ids nas views:
buttonSubmit
ao invés de
submit_button