Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
Added an example implementation of the counters in an AutonomousFragment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Zoeller committed Oct 13, 2013
1 parent aab6ea0 commit cb1a14e
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
@@ -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;
}
}
Expand Up @@ -93,7 +93,7 @@ public boolean onNavigationItemSelected(int position, long id) {
/* Autonomous selected /* Autonomous selected
Show autonomous fragment */ Show autonomous fragment */
getSupportFragmentManager().beginTransaction() getSupportFragmentManager().beginTransaction()
.replace(R.id.container, new Fragment()) .replace(R.id.container, new AutonomousFragment())
.commit(); .commit();
break; break;
case 1: case 1:
Expand Down
23 changes: 23 additions & 0 deletions ScoutingApp/src/main/res/layout/fragment_autonomous.xml
@@ -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.