Skip to content

Commit

Permalink
Minor cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlstone1 committed Apr 5, 2016
1 parent 4af6dd4 commit 1eae104
Show file tree
Hide file tree
Showing 14 changed files with 420 additions and 596 deletions.
2 changes: 1 addition & 1 deletion src/android_foo/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

761 changes: 401 additions & 360 deletions src/android_foo/.idea/workspace.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

import com.robotca.ControlApp.Core.ControlMode;
import com.robotca.ControlApp.Core.RobotController;
import android.media.AudioManager;
import android.media.ToneGenerator;

import java.util.Random;
import java.util.Timer;

import sensor_msgs.LaserScan;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
package com.robotca.ControlApp.Fragments;

import android.annotation.SuppressLint;
import android.app.Fragment;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.TextView;

import com.robotca.ControlApp.Core.Utils;
import com.robotca.ControlApp.R;
Expand All @@ -35,7 +29,7 @@ public AboutFragment() {}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_about, null);
@SuppressLint("InflateParams") View view = inflater.inflate(R.layout.fragment_about, null);

WebView webView = (WebView) view.findViewById(R.id.abouttxt);
webView.loadData(Utils.readText(getActivity(), R.raw.about), "text/html", null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,69 +1,42 @@
package com.robotca.ControlApp.Fragments;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.TextView;

import com.robotca.ControlApp.Core.Utils;
import com.robotca.ControlApp.R;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

/**
* About Fragment for the Robot Chooser screen.
*
* Created by Kenneth Spear on 3/15/16.
*/
public class AboutFragmentRobotChooser extends Fragment {

public AboutFragmentRobotChooser() {

}
/**
* Default Constructor.
*/
public AboutFragmentRobotChooser() {}

/**
* Called when the activity is created.
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

View view = inflater.inflate(R.layout.fragment_about, null);
@SuppressLint("InflateParams") View view = inflater.inflate(R.layout.fragment_about, null);

// TextView aboutTxt = (TextView) view.findViewById(R.id.abouttxt);
// aboutTxt.setText(Html.fromHtml(readTxt()));
WebView webView = (WebView) view.findViewById(R.id.abouttxt);
webView.loadData(readTxt(), "text/html", null);
webView.loadData(Utils.readText(getActivity(), R.raw.about), "text/html", null);

return view;


}

private String readTxt() {

InputStream inputStream = getResources().openRawResource(R.raw.about);

ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();

int i;
try {
i = inputStream.read();
while (i != -1) {
byteArrayOutputStream.write(i);
i = inputStream.read();
}
inputStream.close();
}
catch (IOException e) {

e.printStackTrace();
}

return byteArrayOutputStream.toString();

}
}

Original file line number Diff line number Diff line change
@@ -1,45 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:baselineAligned="false">

<!--<LinearLayout-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="fill_parent"-->
<!--android:layout_weight="1"-->
<!--android:orientation="vertical"-->
<!--android:weightSum="2">-->

<!--<FrameLayout-->
<!--android:id="@+id/hud_fragment_placeholder"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"/>-->

<org.ros.android.view.RosImageView
android:id="@+id/camera_view"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"/>

<!--<fragment android:name="com.robotca.ControlApp.Fragments.LaserScanFragment"-->
<!--android:id="@+id/laser_scan_fragment"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent"-->
<!--android:layout_weight="1"-->
<!--tools:layout="@layout/laser_scan_view" />-->
<FrameLayout
android:id="@+id/laser_scan_placeholder"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<!--<org.ros.android.view.visualization.VisualizationView-->
<!--android:id="@+id/viz_view"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent"-->
<!--android:layout_weight="1" />-->

<!--</LinearLayout>-->
</LinearLayout>
69 changes: 1 addition & 68 deletions src/android_foo/control_app/src/main/res/layout-land/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,7 @@
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
tools:layout="@layout/fragment_joystick_view" />
<!--<Button-->
<!--android:id="@+id/emergencyStop"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_alignParentRight="true"-->
<!--android:layout_alignParentEnd="true"-->
<!--android:background="@android:color/holo_red_dark"-->
<!--android:text="@string/stop"/>-->

</RelativeLayout>
<!-- The navigation drawer -->
<ListView android:id="@+id/left_drawer"
Expand All @@ -56,64 +49,4 @@
android:background="#eee"/>
</android.support.v4.widget.DrawerLayout>

<!--android:baselineAligned="false"-->

<!--<LinearLayout-->
<!--android:layout_weight="1"-->
<!--android:weightSum="2"-->
<!--android:orientation="vertical"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent">-->

<!--<org.ros.android.view.RosImageView-->
<!--android:id="@+id/camera_view"-->
<!--android:layout_weight="1"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent"-->
<!--/>-->

<!--<org.ros.android.view.visualization.VisualizationView-->
<!--android:id="@+id/viz_view"-->
<!--android:layout_weight="1"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent" />-->

<!--</LinearLayout>-->

<!--<fragment android:name="com.robotca.ControlApp.Fragments.CameraViewFragment"-->
<!--android:id="@+id/camera_view_fragment"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--tools:layout="@layout/fragment_camera_view" />-->

<!--<fragment android:name="com.robotca.ControlApp.Fragments.LaserScanFragment"-->
<!--android:id="@+id/laser_scan_fragment"-->
<!--android:layout_below="@id/laser_scan_fragment"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--tools:layout="@layout/fragment_camera_view" />-->


<!--<RelativeLayout-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent"-->
<!--android:layout_weight="3"-->
<!--android:gravity="center_horizontal">-->

<!--<com.robotca.ControlApp.Views.JoystickView-->
<!--android:id="@+id/joystick_view"-->
<!--android:layout_width="200dip"-->
<!--android:layout_height="200dip"-->
<!--android:layout_alignParentBottom="true"/>-->
<!--</RelativeLayout>-->

<!--<fragment android:name="com.robotca.ControlApp.Fragments.JoystickFragment"-->
<!--android:id="@+id/joystick_fragment"-->
<!--android:layout_width="200dip"-->
<!--android:layout_height="200dip"-->
<!--tools:layout="@layout/fragment_joystick_view"-->
<!--android:layout_alignParentBottom="true"-->
<!--android:layout_alignParentRight="true" />-->

</RelativeLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:scrollbars="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<EditText
android:id="@+id/robot_name_edit_text"
android:layout_width="match_parent"
Expand All @@ -33,7 +33,7 @@
android:id="@+id/advanced_options_checkbox_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/show_advanced_options"></CheckBox>
android:text="@string/show_advanced_options"/>
<LinearLayout
android:id="@+id/advanved_options_view"
android:visibility="gone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@
android:layout_height="match_parent"
android:gravity="center_horizontal">

<!--<CheckBox-->
<!--android:id="@+id/tilt_checkbox"-->
<!--android:text="@string/use_tilt_sensor_string"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:onClick="buttonPressed"-->
<!--android:enabled="false"-->
<!--android:layout_alignParentBottom="true"-->
<!--android:layout_alignParentLeft="true"-->
<!--android:layout_alignParentStart="true" />-->
<com.robotca.ControlApp.Views.JoystickView
android:id="@+id/joystick_view"
android:layout_width="300dip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<!--<org.ros.android.view.visualization.VisualizationView-->
<!--android:id="@+id/laser_scan_fragment_viz_view"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="wrap_content" />-->
<com.robotca.ControlApp.Views.LaserScanView
android:id="@+id/laser_scan_renderer_view"
android:layout_width="match_parent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,4 @@
android:layout_alignParentBottom="true"
android:text="@string/center"/>

<!-- <Button
android:id="@+id/tabletRecenter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:text="Android Center"/>-->

</RelativeLayout>
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

<!--<LinearLayout-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent"-->
<!--android:orientation="vertical"-->
<!--android:weightSum="2">-->

<!--<FrameLayout-->
<!--android:id="@+id/hud_fragment_placeholder"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"/>-->

<org.ros.android.view.RosImageView
android:id="@+id/camera_view"
android:layout_width="fill_parent"
Expand All @@ -27,11 +15,5 @@
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<!--<org.ros.android.view.visualization.VisualizationView-->
<!--android:id="@+id/viz_view"-->
<!--android:layout_width="fill_parent"-->
<!--android:layout_height="fill_parent"-->
<!--android:layout_weight="1" />-->

<!--</LinearLayout>-->
</LinearLayout>
Loading

0 comments on commit 1eae104

Please sign in to comment.