Update style, layout & UI

dev_raz_wip
Aurelien Hubert 7 years ago
parent bae23edd4a
commit 8a9e1f845e
  1. 8
      app/src/main/java/net/pokeranalytics/android/ui/activity/HomeActivity.kt
  2. 1
      app/src/main/java/net/pokeranalytics/android/ui/fragment/NewSessionFragment.kt
  3. 12
      app/src/main/res/layout/activity_home.xml
  4. 21
      app/src/main/res/layout/fragment_history.xml
  5. 1
      app/src/main/res/layout/fragment_new_session.xml
  6. 40
      app/src/main/res/layout/fragment_settings.xml
  7. 2
      app/src/main/res/values/colors.xml
  8. 2
      app/src/main/res/values/styles.xml

@ -6,6 +6,7 @@ import android.os.Bundle
import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.bottomnavigation.BottomNavigationView
import io.realm.Realm import io.realm.Realm
import kotlinx.android.synthetic.main.activity_home.* import kotlinx.android.synthetic.main.activity_home.*
import net.pokeranalytics.android.R
import net.pokeranalytics.android.model.realm.Session import net.pokeranalytics.android.model.realm.Session
import net.pokeranalytics.android.ui.fragment.HistoryFragment import net.pokeranalytics.android.ui.fragment.HistoryFragment
import net.pokeranalytics.android.ui.fragment.SettingsFragment import net.pokeranalytics.android.ui.fragment.SettingsFragment
@ -85,6 +86,13 @@ class HomeActivity : PokerAnalyticsActivity() {
*/ */
private fun displayFragment(index: Int) { private fun displayFragment(index: Int) {
toolbar.title = when (index) {
0 -> getString(R.string.title_history)
1 -> getString(R.string.title_stats)
2 -> getString(R.string.title_settings)
else -> ""
}
val fragment = when(index) { val fragment = when(index) {
0 -> HistoryFragment() 0 -> HistoryFragment()
1 -> StatsFragment() 1 -> StatsFragment()

@ -59,6 +59,7 @@ class NewSessionFragment : PokerAnalyticsFragment(), DynamicRowCallback, Editabl
val activity = activity as PokerAnalyticsActivity val activity = activity as PokerAnalyticsActivity
activity.setSupportActionBar(toolbar) activity.setSupportActionBar(toolbar)
activity.supportActionBar?.setDisplayHomeAsUpEnabled(true)
val viewManager = LinearLayoutManager(requireContext()) val viewManager = LinearLayoutManager(requireContext())
val newSessionAdapter = DynamicListAdapter(newSession, this) val newSessionAdapter = DynamicListAdapter(newSession, this)

@ -6,6 +6,16 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.activity.HomeActivity"> tools:context=".ui.activity.HomeActivity">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/app_name"
app:titleTextColor="@color/white" />
<FrameLayout <FrameLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="0dp" android:layout_width="0dp"
@ -13,7 +23,7 @@
app:layout_constraintBottom_toTopOf="@+id/navigation" app:layout_constraintBottom_toTopOf="@+id/navigation"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toBottomOf="@+id/toolbar" />
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/navigation" android:id="@+id/navigation"

@ -7,16 +7,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".ui.activity.HomeActivity"> tools:context=".ui.activity.HomeActivity">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:title="Poker Analytics"
app:titleTextColor="@color/white" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/newSession" android:id="@+id/newSession"
android:layout_width="48dp" android:layout_width="48dp"
@ -30,14 +20,13 @@
app:layout_constraintEnd_toStartOf="@+id/newTournament" app:layout_constraintEnd_toStartOf="@+id/newTournament"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/toolbar" /> app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/newTournament" android:id="@+id/newTournament"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/rectangle_rounded_green_ripple" android:background="@drawable/rectangle_rounded_green_ripple"
android:elevation="4dp" android:elevation="4dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
@ -45,14 +34,13 @@
app:layout_constraintEnd_toStartOf="@+id/newHand" app:layout_constraintEnd_toStartOf="@+id/newHand"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/newSession" app:layout_constraintStart_toEndOf="@+id/newSession"
app:layout_constraintTop_toBottomOf="@+id/toolbar" /> app:layout_constraintTop_toTopOf="@+id/newSession" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/newHand" android:id="@+id/newHand"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:background="@drawable/rectangle_rounded_green_ripple" android:background="@drawable/rectangle_rounded_green_ripple"
android:elevation="4dp" android:elevation="4dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
@ -60,14 +48,13 @@
app:layout_constraintEnd_toStartOf="@+id/newTransaction" app:layout_constraintEnd_toStartOf="@+id/newTransaction"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/newTournament" app:layout_constraintStart_toEndOf="@+id/newTournament"
app:layout_constraintTop_toBottomOf="@+id/toolbar" /> app:layout_constraintTop_toTopOf="@+id/newSession" />
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/newTransaction" android:id="@+id/newTransaction"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="@drawable/rectangle_rounded_green_ripple" android:background="@drawable/rectangle_rounded_green_ripple"
android:elevation="4dp" android:elevation="4dp"
@ -76,7 +63,7 @@
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/newHand" app:layout_constraintStart_toEndOf="@+id/newHand"
app:layout_constraintTop_toBottomOf="@+id/toolbar" /> app:layout_constraintTop_toTopOf="@+id/newSession" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"

@ -47,6 +47,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?attr/actionBarSize"
app:title="Poker Analytics" app:title="Poker Analytics"
app:titleMargins="0dp"
app:titleTextColor="@color/white" app:titleTextColor="@color/white"
app:layout_collapseMode="pin" /> app:layout_collapseMode="pin" />

@ -1,31 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="match_parent">
android:layout_height="match_parent">
<TextView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/title" android:id="@+id/recyclerView"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="0dp"
android:text="Settings" app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="8dp" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" />
android:layout_marginEnd="8dp"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="8dp"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:layout_marginTop="8dp"/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#141414</color> <color name="colorPrimary">#141414</color>
<color name="colorPrimaryDark">#000000</color> <color name="colorPrimaryDark">#0A0A0A</color>
<color name="colorAccent">#58C473</color> <color name="colorAccent">#58C473</color>
<color name="black">#000000</color> <color name="black">#000000</color>

@ -27,7 +27,7 @@
<style name="PokerAnalyticsTheme.Toolbar" parent="Widget.MaterialComponents.Toolbar"> <style name="PokerAnalyticsTheme.Toolbar" parent="Widget.MaterialComponents.Toolbar">
<item name="android:background">@color/gray_darker</item> <item name="android:background">@color/gray_darker</item>
<item name="titleTextColor">@color/white</item> <item name="titleTextColor">@color/white</item>
<item name="android:fontFamily">@font/roboto_bold </item> <item name="android:fontFamily">@font/roboto_bold</item>
</style> </style>
<style name="PokerAnalyticsTheme.TextView"> <style name="PokerAnalyticsTheme.TextView">

Loading…
Cancel
Save