This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Added an example implementation of the counters in an AutonomousFragment

  • Loading branch information...
Ryan Zoeller
Ryan Zoeller committed Oct 13, 2013
1 parent aab6ea0 commit cb1a14eb42d29d6ea174ccde8124b6fbb5e26745
@@ -0,0 +1,29 @@
package com.kingtec2169.scouting;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

/**
* Created by rtzoeller on 10/13/13.
*/
public class AutonomousFragment extends Fragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.fragment_autonomous, container, false);

((Counter)layout.findViewById(R.id.high_goal)).setFloor(0);
((Counter)layout.findViewById(R.id.medium_goal)).setFloor(0);
((Counter)layout.findViewById(R.id.low_goal)).setFloor(0);

return layout;
}
}
@@ -93,7 +93,7 @@ public boolean onNavigationItemSelected(int position, long id) {
/* Autonomous selected
Show autonomous fragment */
getSupportFragmentManager().beginTransaction()
.replace(R.id.container, new Fragment())
.replace(R.id.container, new AutonomousFragment())
.commit();
break;
case 1:
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.kingtec2169.scouting.Counter
android:id="@+id/high_goal"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>

<com.kingtec2169.scouting.Counter
android:id="@+id/medium_goal"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>

<com.kingtec2169.scouting.Counter
android:id="@+id/low_goal"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>

</LinearLayout>

0 comments on commit cb1a14e

Please sign in to comment.