Skip to content

Commit

Permalink
color code done
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Nov 29, 2019
1 parent e6484d9 commit ae3cd30
Show file tree
Hide file tree
Showing 47 changed files with 1,008 additions and 749 deletions.
4 changes: 2 additions & 2 deletions FtcRobotController/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.qualcomm.ftcrobotcontroller"
android:versionCode="34"
android:versionName="5.2">
android:versionCode="35"
android:versionName="5.3">

<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import android.widget.PopupMenu;
import android.widget.TextView;

import com.google.blocks.ftcrobotcontroller.BlocksActivity;
import com.google.blocks.ftcrobotcontroller.ProgrammingModeActivity;
import com.google.blocks.ftcrobotcontroller.ProgrammingModeControllerImpl;
import com.google.blocks.ftcrobotcontroller.ProgrammingWebHandlers;
import com.google.blocks.ftcrobotcontroller.runtime.BlocksOpMode;
import com.qualcomm.ftccommon.ClassManagerFactory;
Expand All @@ -74,7 +71,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import com.qualcomm.ftccommon.FtcRobotControllerSettingsActivity;
import com.qualcomm.ftccommon.LaunchActivityConstantsList;
import com.qualcomm.ftccommon.LaunchActivityConstantsList.RequestCode;
import com.qualcomm.ftccommon.ProgrammingModeController;
import com.qualcomm.ftccommon.Restarter;
import com.qualcomm.ftccommon.UpdateUI;
import com.qualcomm.ftccommon.configuration.EditParameters;
Expand Down Expand Up @@ -117,7 +113,6 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import org.firstinspires.ftc.robotcore.internal.system.Assert;
import org.firstinspires.ftc.robotcore.internal.system.PreferencesHelper;
import org.firstinspires.ftc.robotcore.internal.system.ServiceController;
import org.firstinspires.ftc.robotcore.internal.ui.LocalByRefIntentExtraHolder;
import org.firstinspires.ftc.robotcore.internal.ui.ThemedActivity;
import org.firstinspires.ftc.robotcore.internal.ui.UILocation;
import org.firstinspires.ftc.robotcore.internal.webserver.RobotControllerWebInfo;
Expand All @@ -140,7 +135,6 @@ public class FtcRobotControllerActivity extends Activity
protected RobotConfigFileManager cfgFileMgr;

protected ProgrammingModeManager programmingModeManager;
protected ProgrammingModeController programmingModeController;

protected UpdateUI.Callback callback;
protected Context context;
Expand Down Expand Up @@ -362,8 +356,6 @@ public boolean onMenuItemClick(MenuItem item) {
programmingModeManager = new ProgrammingModeManager();
programmingModeManager.register(new ProgrammingWebHandlers());
programmingModeManager.register(new OnBotJavaProgrammingMode());
programmingModeController = new ProgrammingModeControllerImpl(
this, (TextView) findViewById(R.id.textRemoteProgrammingMode), programmingModeManager);

updateUI = createUpdateUI();
callback = createUICallback(updateUI);
Expand Down Expand Up @@ -439,9 +431,6 @@ protected void onResume() {
protected void onPause() {
super.onPause();
RobotLog.vv(TAG, "onPause()");
if (programmingModeController.isActive()) {
programmingModeController.stopProgrammingMode();
}
}

@Override
Expand Down Expand Up @@ -569,20 +558,7 @@ private boolean isRobotRunning() {
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();

if (id == R.id.action_programming_mode) {
if (cfgFileMgr.getActiveConfig().isNoConfig()) {
// Tell the user they must configure the robot before starting programming mode.
// TODO: as we are no longer truly 'modal' this warning should be adapted
AppUtil.getInstance().showToast(UILocation.BOTH, context.getString(R.string.toastConfigureRobotBeforeProgrammingMode));
} else {
Intent programmingModeIntent = new Intent(AppUtil.getDefContext(), ProgrammingModeActivity.class);
programmingModeIntent.putExtra(
LaunchActivityConstantsList.PROGRAMMING_MODE_ACTIVITY_PROGRAMMING_WEB_HANDLERS,
new LocalByRefIntentExtraHolder(programmingModeManager));
startActivity(programmingModeIntent);
}
return true;
} else if (id == R.id.action_program_and_manage) {
if (id == R.id.action_program_and_manage) {
if (isRobotRunning()) {
Intent programmingModeIntent = new Intent(AppUtil.getDefContext(), ProgramAndManageActivity.class);
RobotControllerWebInfo webInfo = programmingModeManager.getWebServer().getConnectionInformation();
Expand All @@ -595,13 +571,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
Intent inspectionModeIntent = new Intent(AppUtil.getDefContext(), RcInspectionActivity.class);
startActivity(inspectionModeIntent);
return true;
}
else if (id == R.id.action_blocks) {
Intent blocksIntent = new Intent(AppUtil.getDefContext(), BlocksActivity.class);
startActivity(blocksIntent);
return true;
}
else if (id == R.id.action_restart_robot) {
} else if (id == R.id.action_restart_robot) {
dimmer.handleDimTimer();
AppUtil.getInstance().showToast(UILocation.BOTH, context.getString(R.string.toastRestartingRobot));
requestRobotRestart();
Expand Down Expand Up @@ -726,8 +696,8 @@ private void requestRobotSetup(@Nullable Runnable runOnComplete) {
}

OpModeRegister userOpModeRegister = createOpModeRegister();
eventLoop = new FtcEventLoop(hardwareFactory, userOpModeRegister, callback, this, programmingModeController);
FtcEventLoopIdle idleLoop = new FtcEventLoopIdle(hardwareFactory, userOpModeRegister, callback, this, programmingModeController);
eventLoop = new FtcEventLoop(hardwareFactory, userOpModeRegister, callback, this);
FtcEventLoopIdle idleLoop = new FtcEventLoopIdle(hardwareFactory, userOpModeRegister, callback, this);

controllerService.setCallback(callback);
controllerService.setupRobot(eventLoop, idleLoop, runOnComplete);
Expand Down
13 changes: 0 additions & 13 deletions FtcRobotController/src/main/res/layout/activity_ftc_controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
android:visibility="invisible"
android:text="" />

<!-- invisible except when programming mode is activated from the DS -->
<TextView
android:id="@+id/textRemoteProgrammingMode"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/backgroundLight"
android:gravity="center"
android:textColor="?attr/textWhite"
android:textSize="40sp"
android:textStyle="bold"
android:visibility="invisible"
android:text="" />

</RelativeLayout>

<WebView
Expand Down
14 changes: 0 additions & 14 deletions FtcRobotController/src/main/res/menu/ftc_robot_controller.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
android:showAsAction="never"
android:title="@string/configure_robot_menu_item"/>

<item
android:id="@+id/action_blocks"
android:orderInCategory="400"
android:showAsAction="never"
android:visible="false"
android:title="@string/blocks_menu_item"/>

<item
android:id="@+id/action_programming_mode"
android:orderInCategory="500"
android:showAsAction="never"
android:visible="false"
android:title="@string/programming_mode_menu_item"/>

<item
android:id="@+id/action_program_and_manage"
android:orderInCategory="550"
Expand Down
4 changes: 1 addition & 3 deletions FtcRobotController/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

<!-- Menu -->
<string name="inspection_mode_menu_item">Self Inspect</string>
<string name="programming_mode_menu_item">Programming Mode</string>
<string name="program_and_manage_menu_item">Program &amp; Manage</string>
<string name="blocks_menu_item">Blocks</string>
<string name="settings_menu_item">Settings</string>
Expand All @@ -54,8 +53,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<!-- Toast messages -->
<string name="toastWifiConfigurationComplete">Configuration Complete</string>
<string name="toastRestartingRobot">Restarting Robot</string>
<string name="toastConfigureRobotBeforeProgrammingMode">You must Configure Robot before starting Programming Mode.</string>
<string name="toastWifiUpBeforeProgrammingMode">The Robot Controller must be fully up and running before starting Programming Mode. Is Wifi turned on in settings?</string>
<string name="toastWifiUpBeforeProgrammingMode">The Robot Controller must be fully up and running before entering Program and Manage Mode.</string>

<!-- for interpreting pref_app_theme contents. may be override in merged resources -->
<integer-array name="app_theme_ids">
Expand Down
Loading

0 comments on commit ae3cd30

Please sign in to comment.