() {
23 |
24 | class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
25 |
26 | val viewBinding = ItemPokemonBinding.bind(itemView)
27 |
28 | fun bindView(
29 | item: Pokemon,
30 | itemClickedListener: OnItemClickedListener?,
31 | imageLoadedListener: OnImageLoadedListener?
32 | ) {
33 |
34 | viewBinding.textViewName.text = item.name
35 | viewBinding.textViewID.text = item.id
36 |
37 | val color = PokemonColorUtil(itemView.context).getPokemonColor(item.typeofpokemon)
38 | viewBinding.relativeLayoutBackground.background.colorFilter =
39 | PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)
40 |
41 | item.typeofpokemon?.getOrNull(0).let { firstType ->
42 | viewBinding.textViewType3.text = firstType
43 | viewBinding.textViewType3.isVisible = firstType != null
44 | }
45 |
46 | item.typeofpokemon?.getOrNull(1).let { secondType ->
47 | viewBinding.textViewType2.text = secondType
48 | viewBinding.textViewType2.isVisible = secondType != null
49 | }
50 |
51 | item.typeofpokemon?.getOrNull(2).let { thirdType ->
52 | viewBinding.textViewType1.text = thirdType
53 | viewBinding.textViewType1.isVisible = thirdType != null
54 | }
55 |
56 | GlideApp.with(itemView.context)
57 | .load(item.imageurl)
58 | .placeholder(android.R.color.transparent)
59 | .addListener(ImageLoadingListener {
60 | imageLoadedListener?.invoke(item, viewBinding.imageView)
61 | })
62 | .into(viewBinding.imageView)
63 |
64 | viewBinding.imageView.transitionName = item.name
65 | itemView.setOnClickListener {
66 | itemClickedListener?.invoke(item, this)
67 | }
68 | }
69 | }
70 |
71 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
72 | val view = LayoutInflater.from(parent.context).inflate(R.layout.item_pokemon, parent, false)
73 | return ViewHolder(view)
74 | }
75 |
76 | override fun onBindViewHolder(holder: ViewHolder, position: Int) {
77 | val item = list[position]
78 | holder.bindView(item, itemClickedListener, imageLoadedListener)
79 | }
80 |
81 | override fun getItemCount(): Int {
82 | return list.size
83 | }
84 | }
85 |
86 | typealias OnImageLoadedListener = (pokemon: Pokemon, imageView: ImageView) -> Unit
87 |
88 | typealias OnItemClickedListener = (pokemon: Pokemon, viewHolder: PokemonAdapter.ViewHolder) -> Unit
89 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_pokedex.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
22 |
23 |
29 |
30 |
37 |
38 |
45 |
46 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
73 |
74 |
81 |
82 |
83 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_pokemon.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
28 |
29 |
41 |
42 |
43 |
56 |
57 |
70 |
71 |
83 |
84 |
95 |
96 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | xmlns:android
21 |
22 | ^$
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | xmlns:.*
32 |
33 | ^$
34 |
35 |
36 | BY_NAME
37 |
38 |
39 |
40 |
41 |
42 |
43 | .*:id
44 |
45 | http://schemas.android.com/apk/res/android
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | .*:name
55 |
56 | http://schemas.android.com/apk/res/android
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | name
66 |
67 | ^$
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | style
77 |
78 | ^$
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 | .*
88 |
89 | ^$
90 |
91 |
92 | BY_NAME
93 |
94 |
95 |
96 |
97 |
98 |
99 | .*
100 |
101 | http://schemas.android.com/apk/res/android
102 |
103 |
104 | ANDROID_ATTRIBUTE_ORDER
105 |
106 |
107 |
108 |
109 |
110 |
111 | .*
112 |
113 | .*
114 |
115 |
116 | BY_NAME
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/marcosfarias/pokedex/ui/dashboard/DashboardFragment.kt:
--------------------------------------------------------------------------------
1 | package dev.marcosfarias.pokedex.ui.dashboard
2 |
3 | import android.graphics.PorterDuff
4 | import android.graphics.PorterDuffColorFilter
5 | import android.os.Bundle
6 | import android.view.LayoutInflater
7 | import android.view.View
8 | import android.view.ViewGroup
9 | import androidx.core.view.isVisible
10 | import androidx.fragment.app.Fragment
11 | import androidx.lifecycle.Observer
12 | import dev.marcosfarias.pokedex.GlideApp
13 | import androidx.transition.TransitionInflater
14 | import com.bumptech.glide.Glide
15 | import dev.marcosfarias.pokedex.R
16 | import dev.marcosfarias.pokedex.databinding.FragmentDashboardBinding
17 | import dev.marcosfarias.pokedex.utils.ImageLoadingListener
18 | import dev.marcosfarias.pokedex.utils.PokemonColorUtil
19 | import org.koin.androidx.viewmodel.ext.android.viewModel
20 |
21 | class DashboardFragment : Fragment() {
22 |
23 | private val dashboardViewModel: DashboardViewModel by viewModel()
24 | private var dashboardViewBinding: FragmentDashboardBinding? = null
25 |
26 | override fun onCreate(savedInstanceState: Bundle?) {
27 | super.onCreate(savedInstanceState)
28 | sharedElementEnterTransition = TransitionInflater.from(requireContext())
29 | .inflateTransition(R.transition.image_shared_element_transition)
30 | }
31 |
32 | override fun onCreateView(
33 | inflater: LayoutInflater,
34 | container: ViewGroup?,
35 | savedInstanceState: Bundle?
36 | ): View? {
37 | postponeEnterTransition()
38 | return inflater.inflate(R.layout.fragment_dashboard, container, false)
39 | }
40 |
41 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
42 | super.onViewCreated(view, savedInstanceState)
43 | val id = checkNotNull(arguments?.getString("id"))
44 | val name = checkNotNull(arguments?.getString("name"))
45 |
46 | dashboardViewBinding = FragmentDashboardBinding.bind(view)
47 |
48 | dashboardViewBinding?.imageView?.transitionName = name
49 |
50 | dashboardViewModel.getPokemonById(id).observe(viewLifecycleOwner, Observer { pokemonValue ->
51 | pokemonValue?.let { pokemon ->
52 | dashboardViewBinding?.textViewID?.text = pokemon.id
53 | dashboardViewBinding?.textViewName?.text = pokemon.name
54 |
55 | val color = PokemonColorUtil(view.context).getPokemonColor(pokemon.typeofpokemon)
56 | dashboardViewBinding?.appBar?.setBackgroundColor(color)
57 | dashboardViewBinding?.toolbarLayout?.contentScrim?.colorFilter =
58 | PorterDuffColorFilter(color, PorterDuff.Mode.SRC_ATOP)
59 | activity?.window?.statusBarColor =
60 | PokemonColorUtil(view.context).getPokemonColor(pokemon.typeofpokemon)
61 |
62 | pokemon.typeofpokemon?.getOrNull(0).let { firstType ->
63 | dashboardViewBinding?.textViewType3?.text = firstType
64 | dashboardViewBinding?.textViewType3?.isVisible = firstType != null
65 | }
66 |
67 | pokemon.typeofpokemon?.getOrNull(1).let { secondType ->
68 | dashboardViewBinding?.textViewType2?.text = secondType
69 | dashboardViewBinding?.textViewType2?.isVisible = secondType != null
70 | }
71 |
72 | pokemon.typeofpokemon?.getOrNull(2).let { thirdType ->
73 | dashboardViewBinding?.textViewType1?.text = thirdType
74 | dashboardViewBinding?.textViewType1?.isVisible = thirdType != null
75 | }
76 |
77 | dashboardViewBinding?.imageView?.let {
78 | GlideApp.with(view.context)
79 | .load(pokemon.imageurl)
80 | .listener(ImageLoadingListener {
81 | startPostponedEnterTransition()
82 | })
83 | .into(it)
84 | }
85 | val pager = dashboardViewBinding?.viewPager
86 | val tabs = dashboardViewBinding?.tabs
87 | pager?.adapter =
88 | ViewPagerAdapter(childFragmentManager, requireContext(), pokemon.id)
89 | tabs?.setupWithViewPager(pager)
90 | }
91 | })
92 | }
93 |
94 | override fun onDestroyView() {
95 | dashboardViewBinding = null
96 | super.onDestroyView()
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/app/src/main/java/dev/marcosfarias/pokedex/ui/pokedex/PokedexFragment.kt:
--------------------------------------------------------------------------------
1 | package dev.marcosfarias.pokedex.ui.pokedex
2 |
3 | import android.os.Bundle
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import androidx.core.os.bundleOf
8 | import androidx.fragment.app.Fragment
9 | import androidx.lifecycle.Observer
10 | import androidx.navigation.fragment.FragmentNavigatorExtras
11 | import androidx.navigation.fragment.findNavController
12 | import androidx.recyclerview.widget.GridLayoutManager
13 | import com.leinardi.android.speeddial.SpeedDialView
14 | import dev.marcosfarias.pokedex.R
15 | import dev.marcosfarias.pokedex.databinding.FragmentPokedexBinding
16 | import dev.marcosfarias.pokedex.ui.generation.GenerationFragment
17 | import dev.marcosfarias.pokedex.ui.search.SearchFragment
18 | import dev.marcosfarias.pokedex.utils.PokemonColorUtil
19 | import org.koin.androidx.viewmodel.ext.android.viewModel
20 |
21 | class PokedexFragment : Fragment() {
22 |
23 | private val pokedexViewModel: PokedexViewModel by viewModel()
24 | private var viewBinding: FragmentPokedexBinding? = null
25 | private var selectedPokemonId: String? = null
26 |
27 | override fun onCreateView(
28 | inflater: LayoutInflater,
29 | container: ViewGroup?,
30 | savedInstanceState: Bundle?
31 | ): View? {
32 | if (selectedPokemonId != null) {
33 | postponeEnterTransition()
34 | }
35 |
36 | return inflater.inflate(R.layout.fragment_pokedex, container, false)
37 | }
38 |
39 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
40 | super.onViewCreated(view, savedInstanceState)
41 | activity?.window?.statusBarColor =
42 | PokemonColorUtil(view.context).convertColor(R.color.background)
43 |
44 | viewBinding = FragmentPokedexBinding.bind(view)
45 |
46 | val layoutManager = GridLayoutManager(context, 2)
47 | viewBinding?.recyclerView?.layoutManager = layoutManager
48 |
49 | pokedexViewModel.getListPokemon().observe(viewLifecycleOwner, Observer { pokemons ->
50 | viewBinding?.recyclerView?.adapter = PokemonAdapter(
51 | list = pokemons,
52 | itemClickedListener = { pokemon, viewHolder ->
53 | selectedPokemonId = pokemon.id
54 |
55 | val extras = FragmentNavigatorExtras(
56 | viewHolder.itemView to viewHolder.viewBinding.imageView.transitionName
57 | )
58 |
59 | val bundle = bundleOf(
60 | "id" to pokemon.id,
61 | "name" to pokemon.name
62 | )
63 |
64 | findNavController()
65 | .navigate(
66 | R.id.action_navigation_pokedex_to_navigation_dashboard,
67 | bundle,
68 | null,
69 | // extras
70 | )
71 | },
72 | imageLoadedListener = { pokemon, _ ->
73 | if (pokemon.id == selectedPokemonId) {
74 | startPostponedEnterTransition()
75 | }
76 | })
77 | if (pokemons.isNotEmpty()){
78 | viewBinding?.progressBar?.visibility = View.GONE
79 | }
80 | })
81 |
82 | val speedDialView = viewBinding?.speedDial
83 | speedDialView?.inflate(R.menu.menu_pokedex)
84 | speedDialView?.setOnActionSelectedListener(SpeedDialView.OnActionSelectedListener { actionItem ->
85 | when (actionItem.id) {
86 | R.id.menuAllGen -> {
87 | showAllGen()
88 | speedDialView.close()
89 | return@OnActionSelectedListener true
90 | }
91 | R.id.menuSearch -> {
92 | showSearch()
93 | speedDialView.close()
94 | return@OnActionSelectedListener true
95 | }
96 | else -> {
97 | speedDialView.close()
98 | return@OnActionSelectedListener true
99 | }
100 | }
101 | })
102 | }
103 |
104 | private fun showAllGen() {
105 | val dialog = GenerationFragment()
106 | dialog.show(childFragmentManager, "")
107 | }
108 |
109 | private fun showSearch() {
110 | val dialog = SearchFragment()
111 | dialog.show(childFragmentManager, "")
112 | }
113 |
114 | override fun onDestroyView() {
115 | viewBinding = null
116 | super.onDestroyView()
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
10 |
12 |
14 |
16 |
18 |
20 |
22 |
24 |
26 |
28 |
30 |
32 |
34 |
36 |
38 |
40 |
42 |
44 |
46 |
48 |
50 |
52 |
54 |
56 |
58 |
60 |
62 |
64 |
66 |
68 |
70 |
72 |
74 |
75 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Pokedex app built with Kotlin
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | ## Download
28 |
29 | Go to the [releases page](https://github.com/mrcsxsiq/Kotlin-Pokedex/releases) to download the latest available apk.
30 |
31 |
38 |
39 | ## Screenshots
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 | ## Development Roadmap
60 |
61 | - [x] [Kotlin](https://kotlinlang.org/)
62 | - [x] [LiveData](https://developer.android.com/topic/libraries/architecture/livedata)
63 | - [x] [Navigation](https://developer.android.com/topic/libraries/architecture/navigation)
64 | - [x] [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel)
65 | - [x] [Room](https://developer.android.com/topic/libraries/architecture/room)
66 | - [ ] [Coroutines](https://developer.android.com/topic/libraries/architecture/coroutines)
67 | - [x] [Gradle Kotlin DSL](https://docs.gradle.org/current/userguide/kotlin_dsl.html)
68 | - [x] [Databinding](https://developer.android.com/topic/libraries/data-binding)
69 | - [x] [Retrofit](https://square.github.io/retrofit/)
70 | - [x] [Koin](https://insert-koin.io/)
71 | - [x] [Ktlint](https://ktlint.github.io/)
72 | - [ ] JUnit
73 | - [ ] MotionLayout
74 | - [ ] Transition Animations
75 | - [ ] DayNight
76 | - [ ] PokeAPI
77 | - [ ] ~[Jetpack Compose](https://developer.android.com/jetpack/compose)~ - See [compose-pokedex](https://github.com/zsoltk/compose-pokedex)
78 |
79 | ## Features
80 |
81 | - [x] Home
82 | - [x] Pokedex
83 | - [x] Pokedex - FAB
84 | - [x] Pokedex - Search
85 | - [x] Pokedex - Generation
86 | - [x] Pokemon Info
87 | - [x] Pokemon Info - About
88 | - [x] Pokemon Info - Base Stats
89 | - [x] Pokemon Info - Evolution
90 | - [x] News Detail
91 |
92 | ## Thanks
93 |
94 | - [Márton Braun](https://github.com/zsmb13) for his [article](https://zsmb.co/lets-review-pokedex/) and [code review](https://github.com/mrcsxsiq/Kotlin-Pokedex/pull/3)
95 |
96 | ## Design
97 |
98 | - [Saepul Nahwan](https://dribbble.com/saepulnahwan23) for his [Pokedex App design](https://dribbble.com/shots/6545819-Pokedex-App)
99 |
100 | ## Other Pokedex Projects
101 |
102 | - [Zsolt Kocsi](https://github.com/zsoltk/compose-pokedex) - Android on Jetpack Compose
103 | - [Pham Sy Hung](https://github.com/scitbiz/flutter_pokedex/) - Flutter
104 |
105 |
106 | ## Contributors
107 |
108 |
109 |
110 |
111 |
112 | ## License
113 |
114 | All the code available under the MIT license. See [LICENSE](LICENSE).
115 |
116 | ```
117 | MIT License
118 |
119 | Copyright (c) 2019 Marcos Paulo Farias
120 |
121 | Permission is hereby granted, free of charge, to any person obtaining a copy
122 | of this software and associated documentation files (the "Software"), to deal
123 | in the Software without restriction, including without limitation the rights
124 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
125 | copies of the Software, and to permit persons to whom the Software is
126 | furnished to do so, subject to the following conditions:
127 |
128 | The above copyright notice and this permission notice shall be included in all
129 | copies or substantial portions of the Software.
130 |
131 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
132 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
133 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
134 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
135 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
136 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
137 | SOFTWARE.
138 | ```
139 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_news_detail.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
26 |
27 |
32 |
33 |
34 |
44 |
45 |
52 |
53 |
54 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
78 |
79 |
84 |
85 |
92 |
93 |
100 |
101 |
106 |
107 |
115 |
116 |
122 |
123 |
129 |
130 |
131 |
137 |
138 |
139 |
140 |
141 |
142 |
148 |
149 |
154 |
155 |
163 |
164 |
172 |
173 |
174 |
180 |
181 |
182 |
183 |
184 |
185 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
29 |
30 |
36 |
37 |
38 |
39 |
44 |
45 |
55 |
56 |
61 |
62 |
71 |
72 |
80 |
81 |
90 |
91 |
96 |
97 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
120 |
121 |
126 |
127 |
141 |
142 |
147 |
148 |
156 |
157 |
163 |
164 |
165 |
176 |
177 |
178 |
179 |
180 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_about.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
24 |
25 |
32 |
33 |
38 |
39 |
44 |
45 |
50 |
51 |
52 |
59 |
60 |
61 |
62 |
67 |
68 |
73 |
74 |
75 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
96 |
97 |
102 |
103 |
109 |
110 |
111 |
119 |
120 |
121 |
122 |
127 |
128 |
134 |
135 |
136 |
144 |
145 |
146 |
147 |
152 |
153 |
159 |
160 |
161 |
169 |
170 |
171 |
172 |
180 |
181 |
187 |
188 |
189 |
197 |
198 |
204 |
205 |
211 |
212 |
213 |
221 |
222 |
223 |
224 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_dashboard.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
19 |
28 |
29 |
34 |
35 |
47 |
48 |
53 |
54 |
66 |
67 |
79 |
80 |
81 |
94 |
95 |
108 |
109 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
133 |
134 |
143 |
144 |
148 |
149 |
153 |
154 |
158 |
159 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
177 |
178 |
183 |
184 |
185 |
186 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_stats.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
23 |
24 |
30 |
31 |
40 |
41 |
50 |
51 |
52 |
53 |
59 |
60 |
66 |
67 |
76 |
77 |
86 |
87 |
88 |
89 |
95 |
96 |
102 |
103 |
112 |
113 |
122 |
123 |
124 |
125 |
131 |
132 |
138 |
139 |
148 |
149 |
158 |
159 |
160 |
161 |
167 |
168 |
174 |
175 |
184 |
185 |
194 |
195 |
196 |
197 |
203 |
204 |
210 |
211 |
220 |
221 |
230 |
231 |
232 |
233 |
239 |
240 |
246 |
247 |
256 |
257 |
266 |
267 |
268 |
269 |
270 |
278 |
279 |
285 |
286 |
287 |
294 |
295 |
296 |
297 |
--------------------------------------------------------------------------------