commit
a0a745700d
Binary file not shown.
@ -0,0 +1,33 @@ |
|||||||
|
package net.pokeranalytics.android.ui.activity |
||||||
|
|
||||||
|
import android.content.Context |
||||||
|
import android.content.Intent |
||||||
|
import android.os.Bundle |
||||||
|
import androidx.fragment.app.Fragment |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.ui.activity.components.PokerAnalyticsActivity |
||||||
|
|
||||||
|
class ComparisonChartActivity : PokerAnalyticsActivity() { |
||||||
|
|
||||||
|
companion object { |
||||||
|
fun newInstance(context: Context) { |
||||||
|
val intent = Intent(context, ComparisonChartActivity::class.java) |
||||||
|
context.startActivity(intent) |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Create a new instance for result |
||||||
|
*/ |
||||||
|
fun newInstanceForResult(fragment: Fragment, requestCode: Int) { |
||||||
|
val intent = Intent(fragment.requireContext(), ComparisonChartActivity::class.java) |
||||||
|
fragment.startActivityForResult(intent, requestCode) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) { |
||||||
|
super.onCreate(savedInstanceState) |
||||||
|
setContentView(R.layout.activity_comparison_chart) |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,80 @@ |
|||||||
|
package net.pokeranalytics.android.ui.adapter |
||||||
|
|
||||||
|
import android.content.Context |
||||||
|
import android.util.SparseArray |
||||||
|
import android.view.ViewGroup |
||||||
|
import androidx.fragment.app.FragmentManager |
||||||
|
import androidx.fragment.app.FragmentStatePagerAdapter |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.ui.fragment.* |
||||||
|
import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment |
||||||
|
import java.lang.ref.WeakReference |
||||||
|
|
||||||
|
/** |
||||||
|
* Comparison Chart Pager Adapter |
||||||
|
*/ |
||||||
|
class ComparisonChartPagerAdapter(val context: Context, fragmentManager: FragmentManager) : FragmentStatePagerAdapter(fragmentManager) { |
||||||
|
|
||||||
|
var weakReferences = SparseArray<WeakReference<PokerAnalyticsFragment>>() |
||||||
|
|
||||||
|
override fun getItem(position: Int): PokerAnalyticsFragment { |
||||||
|
return when (position) { |
||||||
|
0 -> GraphFragment() |
||||||
|
1 -> GraphFragment() |
||||||
|
2 -> CalendarFragment.newInstance() |
||||||
|
else -> HistoryFragment.newInstance() |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun getCount(): Int { |
||||||
|
return 3 |
||||||
|
} |
||||||
|
|
||||||
|
override fun getPageTitle(position: Int): CharSequence? { |
||||||
|
return when(position) { |
||||||
|
0 -> context.getString(R.string.bar) |
||||||
|
1 -> context.getString(R.string.line) |
||||||
|
2-> context.getString(R.string.table) |
||||||
|
else -> super.getPageTitle(position) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) { |
||||||
|
super.destroyItem(container, position, `object`) |
||||||
|
weakReferences.remove(position) |
||||||
|
} |
||||||
|
|
||||||
|
override fun instantiateItem(container: ViewGroup, position: Int): Any { |
||||||
|
val fragment = super.instantiateItem(container, position) as PokerAnalyticsFragment |
||||||
|
weakReferences.put(position, WeakReference(fragment)) |
||||||
|
return fragment |
||||||
|
} |
||||||
|
|
||||||
|
override fun getItemPosition(obj: Any): Int { |
||||||
|
return when (obj) { |
||||||
|
//CLEAN |
||||||
|
/* |
||||||
|
HistoryFragment::class.java -> 0 |
||||||
|
StatsFragment::class.java -> 1 |
||||||
|
SettingsFragment::class.java -> 2 |
||||||
|
*/ |
||||||
|
HistoryFragment::class.java -> 0 |
||||||
|
StatsFragment::class.java -> 1 |
||||||
|
CalendarFragment::class.java -> 2 |
||||||
|
ReportsFragment::class.java -> 3 |
||||||
|
MoreFragment::class.java -> 4 |
||||||
|
else -> -1 |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Return the fragment at the position key |
||||||
|
*/ |
||||||
|
fun getFragment(key: Int): PokerAnalyticsFragment? { |
||||||
|
if (weakReferences.get(key) != null) { |
||||||
|
return weakReferences.get(key).get() |
||||||
|
} |
||||||
|
return null |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -1,4 +1,4 @@ |
|||||||
package net.pokeranalytics.android.util.extensions |
package net.pokeranalytics.android.ui.extensions |
||||||
|
|
||||||
import com.google.android.material.chip.ChipGroup |
import com.google.android.material.chip.ChipGroup |
||||||
|
|
||||||
@ -0,0 +1,122 @@ |
|||||||
|
package net.pokeranalytics.android.ui.fragment |
||||||
|
|
||||||
|
import android.os.Bundle |
||||||
|
import android.view.* |
||||||
|
import kotlinx.android.synthetic.main.fragment_comparison_chart.* |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.ui.activity.BankrollActivity |
||||||
|
import net.pokeranalytics.android.ui.activity.SettingsActivity |
||||||
|
import net.pokeranalytics.android.ui.activity.components.PokerAnalyticsActivity |
||||||
|
import net.pokeranalytics.android.ui.adapter.ComparisonChartPagerAdapter |
||||||
|
import net.pokeranalytics.android.ui.adapter.RowRepresentableDelegate |
||||||
|
import net.pokeranalytics.android.ui.adapter.StaticRowRepresentableDataSource |
||||||
|
import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment |
||||||
|
import net.pokeranalytics.android.ui.view.RowRepresentable |
||||||
|
import net.pokeranalytics.android.ui.view.rowrepresentable.MoreTabRow |
||||||
|
import net.pokeranalytics.android.ui.extensions.toast |
||||||
|
|
||||||
|
class ComparisonChartFragment : PokerAnalyticsFragment(), StaticRowRepresentableDataSource, RowRepresentableDelegate { |
||||||
|
|
||||||
|
companion object { |
||||||
|
|
||||||
|
/** |
||||||
|
* Create new instance |
||||||
|
*/ |
||||||
|
fun newInstance(): ComparisonChartFragment { |
||||||
|
val fragment = ComparisonChartFragment() |
||||||
|
val bundle = Bundle() |
||||||
|
fragment.arguments = bundle |
||||||
|
return fragment |
||||||
|
} |
||||||
|
|
||||||
|
val rowRepresentation: List<RowRepresentable> by lazy { |
||||||
|
val rows = ArrayList<RowRepresentable>() |
||||||
|
rows.addAll(MoreTabRow.values()) |
||||||
|
rows |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
private lateinit var parentActivity: PokerAnalyticsActivity |
||||||
|
private lateinit var viewPagerAdapter: ComparisonChartPagerAdapter |
||||||
|
private var comparisonChartMenu: Menu? = null |
||||||
|
|
||||||
|
|
||||||
|
// Life Cycle |
||||||
|
|
||||||
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
||||||
|
return inflater.inflate(R.layout.fragment_comparison_chart, container, false) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
initData() |
||||||
|
initUI() |
||||||
|
} |
||||||
|
|
||||||
|
override fun onCreateOptionsMenu(menu: Menu?, inflater: MenuInflater?) { |
||||||
|
inflater?.inflate(R.menu.toolbar_comparison_chart, menu) |
||||||
|
this.comparisonChartMenu = menu |
||||||
|
super.onCreateOptionsMenu(menu, inflater) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onOptionsItemSelected(item: MenuItem?): Boolean { |
||||||
|
when (item!!.itemId) { |
||||||
|
R.id.settings -> openChangeStatistics() |
||||||
|
} |
||||||
|
return true |
||||||
|
} |
||||||
|
|
||||||
|
// Rows |
||||||
|
override fun adapterRows(): List<RowRepresentable>? { |
||||||
|
return rowRepresentation |
||||||
|
} |
||||||
|
|
||||||
|
override fun onRowSelected(position: Int, row: RowRepresentable, fromAction: Boolean) { |
||||||
|
super.onRowSelected(position, row, fromAction) |
||||||
|
when(row) { |
||||||
|
MoreTabRow.BANKROLL -> BankrollActivity.newInstance(requireContext()) |
||||||
|
MoreTabRow.SETTINGS -> SettingsActivity.newInstance(requireContext()) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// Business |
||||||
|
|
||||||
|
/** |
||||||
|
* Init data |
||||||
|
*/ |
||||||
|
private fun initData() { |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Init UI |
||||||
|
*/ |
||||||
|
private fun initUI() { |
||||||
|
|
||||||
|
parentActivity = activity as PokerAnalyticsActivity |
||||||
|
|
||||||
|
toolbar.title = "" |
||||||
|
|
||||||
|
parentActivity.setSupportActionBar(toolbar) |
||||||
|
parentActivity.supportActionBar?.setDisplayHomeAsUpEnabled(true) |
||||||
|
setHasOptionsMenu(true) |
||||||
|
|
||||||
|
toolbar.title = "Comparison chart" |
||||||
|
|
||||||
|
viewPagerAdapter = ComparisonChartPagerAdapter(requireContext(), parentActivity.supportFragmentManager) |
||||||
|
viewPager.adapter = viewPagerAdapter |
||||||
|
viewPager.offscreenPageLimit = 2 |
||||||
|
|
||||||
|
tabs.setupWithViewPager(viewPager) |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Open change statistics |
||||||
|
*/ |
||||||
|
private fun openChangeStatistics() { |
||||||
|
//TODO |
||||||
|
toast("Open change statistics") |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,79 @@ |
|||||||
|
package net.pokeranalytics.android.ui.fragment |
||||||
|
|
||||||
|
import android.content.Context |
||||||
|
import android.content.Intent |
||||||
|
import android.os.Bundle |
||||||
|
import android.view.LayoutInflater |
||||||
|
import android.view.View |
||||||
|
import android.view.ViewGroup |
||||||
|
import com.github.mikephil.charting.data.Entry |
||||||
|
import kotlinx.android.synthetic.main.fragment_statistic_details.* |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
import net.pokeranalytics.android.calculus.Stat |
||||||
|
import net.pokeranalytics.android.ui.activity.StatisticDetailsActivity |
||||||
|
import net.pokeranalytics.android.ui.activity.components.PokerAnalyticsActivity |
||||||
|
import net.pokeranalytics.android.ui.fragment.components.PokerAnalyticsFragment |
||||||
|
|
||||||
|
class StatisticDetailsFragment : PokerAnalyticsFragment() { |
||||||
|
|
||||||
|
companion object { |
||||||
|
fun newInstance(context: Context) { |
||||||
|
val intent = Intent(context, StatisticDetailsFragment::class.java) |
||||||
|
context.startActivity(intent) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private lateinit var parentActivity: PokerAnalyticsActivity |
||||||
|
|
||||||
|
private var stat: Stat = Stat.NETRESULT |
||||||
|
private var entries: List<Entry> = ArrayList() |
||||||
|
|
||||||
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { |
||||||
|
return inflater.inflate(R.layout.fragment_statistic_details, container, false) |
||||||
|
} |
||||||
|
|
||||||
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { |
||||||
|
super.onViewCreated(view, savedInstanceState) |
||||||
|
initUI() |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Init UI |
||||||
|
*/ |
||||||
|
private fun initUI() { |
||||||
|
|
||||||
|
parentActivity = activity as PokerAnalyticsActivity |
||||||
|
|
||||||
|
// Avoid a bug during setting the title |
||||||
|
toolbar.title = "" |
||||||
|
|
||||||
|
parentActivity.setSupportActionBar(toolbar) |
||||||
|
parentActivity.supportActionBar?.setDisplayHomeAsUpEnabled(true) |
||||||
|
setHasOptionsMenu(true) |
||||||
|
|
||||||
|
toolbar.title = stat.localizedTitle(requireContext()) |
||||||
|
|
||||||
|
val fragmentManager = parentActivity.supportFragmentManager |
||||||
|
val fragmentTransaction = fragmentManager.beginTransaction() |
||||||
|
val fragment = GraphFragment() |
||||||
|
|
||||||
|
fragmentTransaction.add(R.id.container, fragment) |
||||||
|
fragmentTransaction.commit() |
||||||
|
|
||||||
|
StatisticDetailsActivity.parameters?.let { |
||||||
|
fragment.setData(it.stat, it.entries) |
||||||
|
StatisticDetailsActivity.parameters = null |
||||||
|
} ?: run { |
||||||
|
throw Exception("Missing graph parameters") |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Set data |
||||||
|
*/ |
||||||
|
fun setData(stat: Stat, entries: List<Entry>) { |
||||||
|
this.stat = stat |
||||||
|
this.entries = entries |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
package net.pokeranalytics.android.ui.graph |
||||||
|
|
||||||
|
import android.content.Context |
||||||
|
import com.github.mikephil.charting.data.Entry |
||||||
|
import com.github.mikephil.charting.data.LineDataSet |
||||||
|
import net.pokeranalytics.android.R |
||||||
|
|
||||||
|
class PALineDataSet(yVals: List<Entry>, label: String, context: Context) : LineDataSet(yVals, label) { |
||||||
|
|
||||||
|
init { |
||||||
|
this.highLightColor = context.getColor(R.color.chart_highlight_indicator) |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -1,76 +1,61 @@ |
|||||||
package net.pokeranalytics.android.ui.graph |
package net.pokeranalytics.android.ui.graph |
||||||
|
|
||||||
import android.content.Context |
import android.content.Context |
||||||
|
import android.graphics.Typeface |
||||||
import androidx.core.content.ContextCompat |
import androidx.core.content.ContextCompat |
||||||
import com.github.mikephil.charting.charts.BarLineChartBase |
import com.github.mikephil.charting.charts.BarLineChartBase |
||||||
import com.github.mikephil.charting.components.XAxis |
import com.github.mikephil.charting.components.XAxis |
||||||
import net.pokeranalytics.android.R |
import net.pokeranalytics.android.R |
||||||
import net.pokeranalytics.android.util.extensions.px |
import net.pokeranalytics.android.ui.extensions.px |
||||||
|
|
||||||
//fun BarChart.setStyle(context: Context) { |
fun BarLineChartBase<*>.setStyle(small: Boolean, context: Context) { |
||||||
// GraphHelper.setStyle(this, context) |
|
||||||
//} |
|
||||||
|
|
||||||
fun BarLineChartBase<*>.setStyle(context: Context) { |
// X Axis |
||||||
GraphHelper.setStyle(this, context) |
this.xAxis.axisLineColor = ContextCompat.getColor(context, R.color.chart_default) |
||||||
} |
this.xAxis.enableGridDashedLine(3.0f.px, 5.0f.px, 1.0f.px) |
||||||
|
this.xAxis.textColor = ContextCompat.getColor(context, R.color.chart_default) |
||||||
|
this.xAxis.labelCount = 4 |
||||||
|
this.xAxis.position = XAxis.XAxisPosition.BOTTOM |
||||||
|
|
||||||
class GraphHelper { |
this.xAxis.textColor = ContextCompat.getColor(context, R.color.chart_default) |
||||||
|
this.xAxis.typeface = Typeface.DEFAULT |
||||||
|
this.xAxis.labelCount = 4 |
||||||
|
this.xAxis.position = XAxis.XAxisPosition.BOTTOM |
||||||
|
|
||||||
companion object { |
this.xAxis.setDrawLabels(true) |
||||||
|
this.xAxis.setDrawGridLines(true) |
||||||
|
this.xAxis.granularity = 1.0f |
||||||
|
this.xAxis.isGranularityEnabled = true |
||||||
|
this.xAxis.isEnabled = true |
||||||
|
|
||||||
fun setStyle(chart: BarLineChartBase<*>, context: Context) { |
// Y Axis |
||||||
|
this.axisLeft.setDrawAxisLine(false) |
||||||
|
this.axisLeft.setDrawGridLines(true) |
||||||
|
this.axisLeft.enableGridDashedLine(3.0f.px, 5.0f.px, 1.0f.px) |
||||||
|
|
||||||
chart.xAxis.axisLineColor = ContextCompat.getColor(context, R.color.chart_default) |
this.axisLeft.setDrawZeroLine(true) |
||||||
chart.xAxis.enableGridDashedLine(3.0f.px, 5.0f.px, 1.0f.px) |
// this.axisLeft.zeroLineWidth = 1.0f.px |
||||||
chart.xAxis.textColor = ContextCompat.getColor(context, R.color.chart_default) |
this.axisLeft.zeroLineColor = ContextCompat.getColor(context, R.color.chart_default) |
||||||
chart.xAxis.labelCount = 4 |
|
||||||
chart.xAxis.position = XAxis.XAxisPosition.BOTTOM |
|
||||||
|
|
||||||
chart.axisLeft.enableGridDashedLine(3.0f.px, 5.0f.px, 1.0f.px) |
this.axisLeft.isGranularityEnabled = true |
||||||
|
this.axisLeft.granularity = 1.0f |
||||||
|
|
||||||
// this.xAxis.axisLineWidth = ChartAppearance.lineWidth |
this.axisLeft.textColor = ContextCompat.getColor(context, R.color.chart_default) |
||||||
// this.xAxis.enableGridDashedLine(3.0f, 5.0f, 1.0f) |
this.axisLeft.typeface = Typeface.DEFAULT |
||||||
// |
this.axisLeft.labelCount = |
||||||
// this.xAxis.labelTextColor = ChartAppearance.defaultColor |
if (small) 1 else 7 // @todo not great if interval is [0..2] for number of records as we get decimals |
||||||
// this.xAxis.labelFont = Fonts.graphAxis |
|
||||||
// this.xAxis.labelCount = 4 |
this.axisRight.isEnabled = false |
||||||
// this.xAxis.labelPosition = .bottom |
this.legend.isEnabled = false |
||||||
// |
|
||||||
// this.xAxis.drawLabelsEnabled = true |
|
||||||
// this.xAxis.drawGridLinesEnabled = true |
// @todo |
||||||
// this.xAxis.granularity = 1.0 |
|
||||||
// this.xAxis.granularityEnabled = true |
|
||||||
// this.xAxis.enabled = true |
|
||||||
// |
|
||||||
// // Y Axis |
|
||||||
// this.leftAxis.drawAxisLineEnabled = false |
|
||||||
// this.leftAxis.drawGridLinesEnabled = true |
|
||||||
// this.leftAxis.gridLineDashLengths = [3.0, 5.0] |
|
||||||
// |
|
||||||
// this.leftAxis.drawZeroLineEnabled = true |
|
||||||
// this.leftAxis.zeroLineWidth = ChartAppearance.lineWidth |
|
||||||
// this.leftAxis.zeroLineColor = ChartAppearance.defaultColor |
|
||||||
// |
|
||||||
// this.leftAxis.granularityEnabled = true |
|
||||||
// this.leftAxis.granularity = 1.0 |
|
||||||
// |
|
||||||
// this.leftAxis.labelTextColor = ChartAppearance.defaultColor |
|
||||||
// this.leftAxis.labelFont = Fonts.graphAxis |
|
||||||
// this.leftAxis.labelCount = small ? 1 : 7 // @todo not great if interval is [0..2] for number of records as we get decimals |
|
||||||
// |
|
||||||
// if timeYAxis { |
// if timeYAxis { |
||||||
// this.leftAxis.valueFormatter = HourValueFormatter() |
// this.axisLeft.valueFormatter = HourValueFormatter() |
||||||
// } else { |
// } else { |
||||||
// this.leftAxis.valueFormatter = LargeNumberFormatter() |
// this.axisLeft.valueFormatter = LargeNumberFormatter() |
||||||
// } |
// } |
||||||
// |
// |
||||||
// this.rightAxis.enabled = false |
|
||||||
// |
|
||||||
// this.legend.enabled = false |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
} |
} |
||||||
|
|||||||
@ -1,10 +0,0 @@ |
|||||||
package net.pokeranalytics.android.ui.view.fields |
|
||||||
|
|
||||||
import android.content.Context |
|
||||||
import androidx.appcompat.widget.AppCompatTextView |
|
||||||
import net.pokeranalytics.android.calculus.TextFormat |
|
||||||
|
|
||||||
fun AppCompatTextView.setTextFormat(textFormat: TextFormat, context: Context) { |
|
||||||
this.setTextColor(textFormat.getColor(context)) |
|
||||||
this.text = textFormat.text |
|
||||||
} |
|
||||||
@ -0,0 +1,15 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||||
|
android:orientation="vertical"> |
||||||
|
|
||||||
|
<fragment |
||||||
|
android:id="@+id/comparisonChartFragment" |
||||||
|
android:name="net.pokeranalytics.android.ui.fragment.ComparisonChartFragment" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
tools:layout="@layout/fragment_comparison_chart" /> |
||||||
|
|
||||||
|
</LinearLayout> |
||||||
@ -1,8 +1,26 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||||
<FrameLayout |
<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" |
||||||
android:id="@+id/container" |
xmlns:tools="http://schemas.android.com/tools" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent"> |
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar |
||||||
|
android:id="@+id/toolbar" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="match_parent"> |
android:layout_height="?attr/actionBarSize" |
||||||
|
app:layout_constraintEnd_toEndOf="parent" |
||||||
|
app:layout_constraintStart_toStartOf="parent" |
||||||
|
app:layout_constraintTop_toTopOf="parent" |
||||||
|
tools:title="@string/app_name" /> |
||||||
|
|
||||||
|
<FrameLayout |
||||||
|
android:id="@+id/container" |
||||||
|
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/toolbar" /> |
||||||
|
|
||||||
</FrameLayout> |
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
|
|||||||
@ -0,0 +1,15 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||||
|
android:orientation="vertical"> |
||||||
|
|
||||||
|
<fragment |
||||||
|
android:id="@+id/statisticDetailsFragment" |
||||||
|
android:name="net.pokeranalytics.android.ui.fragment.StatisticDetailsFragment" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent" |
||||||
|
tools:layout="@layout/fragment_statistic_details" /> |
||||||
|
|
||||||
|
</LinearLayout> |
||||||
@ -0,0 +1,57 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent"> |
||||||
|
|
||||||
|
<com.google.android.material.appbar.AppBarLayout |
||||||
|
android:id="@+id/appBar" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:theme="@style/PokerAnalyticsTheme.Toolbar.Session" |
||||||
|
app:layout_constraintEnd_toEndOf="parent" |
||||||
|
app:layout_constraintStart_toStartOf="parent"> |
||||||
|
|
||||||
|
<androidx.appcompat.widget.Toolbar |
||||||
|
android:id="@+id/toolbar" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="?attr/actionBarSize" |
||||||
|
app:layout_collapseMode="pin" |
||||||
|
app:titleTextColor="@color/white" |
||||||
|
tools:title="Poker Analytics" /> |
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabLayout |
||||||
|
android:id="@+id/tabs" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content"> |
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabItem |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="@string/bar" /> |
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabItem |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="@string/line" /> |
||||||
|
|
||||||
|
<com.google.android.material.tabs.TabItem |
||||||
|
android:layout_width="wrap_content" |
||||||
|
android:layout_height="wrap_content" |
||||||
|
android:text="@string/table" /> |
||||||
|
|
||||||
|
</com.google.android.material.tabs.TabLayout> |
||||||
|
|
||||||
|
</com.google.android.material.appbar.AppBarLayout> |
||||||
|
|
||||||
|
<androidx.viewpager.widget.ViewPager |
||||||
|
android:id="@+id/viewPager" |
||||||
|
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/appBar" /> |
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
@ -0,0 +1,26 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
xmlns:tools="http://schemas.android.com/tools" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="match_parent"> |
||||||
|
|
||||||
|
<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="@string/app_name" /> |
||||||
|
|
||||||
|
<FrameLayout |
||||||
|
android:id="@+id/container" |
||||||
|
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/toolbar" /> |
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout> |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"> |
||||||
|
|
||||||
|
<item |
||||||
|
android:id="@+id/settings" |
||||||
|
android:title="@string/services" |
||||||
|
android:icon="@drawable/ic_outline_settings" |
||||||
|
app:showAsAction="always" /> |
||||||
|
|
||||||
|
</menu> |
||||||
Loading…
Reference in new issue