-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare empty fragments for active / archived repositories
Related: #54
- Loading branch information
1 parent
252728d
commit 99293a7
Showing
20 changed files
with
271 additions
and
27 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
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/alexandr7035/gitstat/view/repositories/ActiveRepositoriesFragment.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,60 @@ | ||
package com.alexandr7035.gitstat.view.repositories | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.alexandr7035.gitstat.R | ||
|
||
// TODO: Rename parameter arguments, choose names that match | ||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER | ||
private const val ARG_PARAM1 = "param1" | ||
private const val ARG_PARAM2 = "param2" | ||
|
||
/** | ||
* A simple [Fragment] subclass. | ||
* Use the [ActiveRepositoriesFragment.newInstance] factory method to | ||
* create an instance of this fragment. | ||
*/ | ||
class ActiveRepositoriesFragment : Fragment() { | ||
// TODO: Rename and change types of parameters | ||
private var param1: String? = null | ||
private var param2: String? = null | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
arguments?.let { | ||
param1 = it.getString(ARG_PARAM1) | ||
param2 = it.getString(ARG_PARAM2) | ||
} | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_active_repositories, container, false) | ||
} | ||
|
||
companion object { | ||
/** | ||
* Use this factory method to create a new instance of | ||
* this fragment using the provided parameters. | ||
* | ||
* @param param1 Parameter 1. | ||
* @param param2 Parameter 2. | ||
* @return A new instance of fragment ActiveRepositoriesFragment. | ||
*/ | ||
// TODO: Rename and change types and number of parameters | ||
@JvmStatic | ||
fun newInstance(param1: String, param2: String) = | ||
ActiveRepositoriesFragment().apply { | ||
arguments = Bundle().apply { | ||
putString(ARG_PARAM1, param1) | ||
putString(ARG_PARAM2, param2) | ||
} | ||
} | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
app/src/main/java/com/alexandr7035/gitstat/view/repositories/ArchivedRepositoriesFragment.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,60 @@ | ||
package com.alexandr7035.gitstat.view.repositories | ||
|
||
import android.os.Bundle | ||
import androidx.fragment.app.Fragment | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import com.alexandr7035.gitstat.R | ||
|
||
// TODO: Rename parameter arguments, choose names that match | ||
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER | ||
private const val ARG_PARAM1 = "param1" | ||
private const val ARG_PARAM2 = "param2" | ||
|
||
/** | ||
* A simple [Fragment] subclass. | ||
* Use the [ArchivedRepositoriesFragment.newInstance] factory method to | ||
* create an instance of this fragment. | ||
*/ | ||
class ArchivedRepositoriesFragment : Fragment() { | ||
// TODO: Rename and change types of parameters | ||
private var param1: String? = null | ||
private var param2: String? = null | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
arguments?.let { | ||
param1 = it.getString(ARG_PARAM1) | ||
param2 = it.getString(ARG_PARAM2) | ||
} | ||
} | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
// Inflate the layout for this fragment | ||
return inflater.inflate(R.layout.fragment_archived_repositories, container, false) | ||
} | ||
|
||
companion object { | ||
/** | ||
* Use this factory method to create a new instance of | ||
* this fragment using the provided parameters. | ||
* | ||
* @param param1 Parameter 1. | ||
* @param param2 Parameter 2. | ||
* @return A new instance of fragment ArchivedRepositoriesFragment. | ||
*/ | ||
// TODO: Rename and change types and number of parameters | ||
@JvmStatic | ||
fun newInstance(param1: String, param2: String) = | ||
ArchivedRepositoriesFragment().apply { | ||
arguments = Bundle().apply { | ||
putString(ARG_PARAM1, param1) | ||
putString(ARG_PARAM2, param2) | ||
} | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...r7035/gitstat/view/RepositoriesAdapter.kt → .../view/repositories/RepositoriesAdapter.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
2 changes: 1 addition & 1 deletion
2
.../gitstat/view/filters/LanguagesAdapter.kt → .../repositories/filters/LanguagesAdapter.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
2 changes: 1 addition & 1 deletion
2
...7035/gitstat/view/filters/ReposFilters.kt → ...view/repositories/filters/ReposFilters.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
2 changes: 1 addition & 1 deletion
2
...view/filters/RepositoriesFiltersDialog.kt → ...ries/filters/RepositoriesFiltersDialog.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
2 changes: 1 addition & 1 deletion
2
...itstat/view/filters/RepositoriesSorter.kt → ...epositories/filters/RepositoriesSorter.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
<item android:state_selected="true"> | ||
<shape> | ||
<solid android:color="@color/gray_400"/> | ||
<corners android:radius="10dp"/> | ||
</shape> | ||
</item> | ||
|
||
<item> | ||
<shape> | ||
<solid android:color="@color/white"/> | ||
<corners android:radius="10dp"/> | ||
</shape> | ||
|
||
</item> | ||
|
||
|
||
</selector> |
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,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<solid android:color="@color/white"/> | ||
<corners android:radius="10dp"/> | ||
</shape> |
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.recyclerview.widget.RecyclerView 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" | ||
android:paddingStart="16dp" | ||
android:paddingEnd="16dp" | ||
android:paddingTop="20dp" | ||
android:clipToPadding="false" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
tools:context="com.alexandr7035.gitstat.view.repositories.RepositoriesListFragment"> | ||
|
||
</androidx.recyclerview.widget.RecyclerView> |
13 changes: 13 additions & 0 deletions
13
app/src/main/res/layout/fragment_archived_repositories.xml
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,13 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.recyclerview.widget.RecyclerView 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" | ||
android:paddingStart="16dp" | ||
android:paddingEnd="16dp" | ||
android:paddingTop="20dp" | ||
android:clipToPadding="false" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
tools:context="com.alexandr7035.gitstat.view.repositories.RepositoriesListFragment"> | ||
|
||
</androidx.recyclerview.widget.RecyclerView> |
60 changes: 60 additions & 0 deletions
60
app/src/main/res/layout/fragment_host_repositories_list.xml
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,60 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout 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" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
tools:context=".FragmentBaseRepositoriesList"> | ||
|
||
<androidx.appcompat.widget.Toolbar | ||
android:id="@+id/toolbar" | ||
app:title="@string/repos" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:contentInsetStart="0dp" | ||
app:contentInsetStartWithNavigation="0dp" | ||
app:navigationIcon="?attr/actionModeCloseDrawable" | ||
android:background="@color/white" | ||
android:elevation="5dp" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"/> | ||
|
||
<com.google.android.material.tabs.TabLayout | ||
android:layout_marginTop="10dp" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginEnd="16dp" | ||
app:tabIndicatorHeight="0dp" | ||
android:id="@+id/tabLayout" | ||
android:background="@drawable/background_tablayout" | ||
android:layout_width="0dp" | ||
android:layout_height="30dp" | ||
app:tabTextColor="@color/black" | ||
app:tabSelectedTextColor="@color/white" | ||
app:tabBackground="@drawable/background_tab" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/toolbar"> | ||
|
||
<com.google.android.material.tabs.TabItem | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Active"/> | ||
|
||
<com.google.android.material.tabs.TabItem | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="Archived"/> | ||
|
||
</com.google.android.material.tabs.TabLayout> | ||
|
||
<androidx.viewpager2.widget.ViewPager2 | ||
android:id="@+id/pager" | ||
android:layout_width="0dp" | ||
android:layout_height="0dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/tabLayout" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> |
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
Oops, something went wrong.