Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

Commit

Permalink
new icon, UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bdonald25 committed Jun 4, 2015
1 parent ad5c6dd commit de53357
Show file tree
Hide file tree
Showing 24 changed files with 194 additions and 143 deletions.
13 changes: 6 additions & 7 deletions Apps/Motion/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</activity>
<activity
android:name="edu.uml.cs.isense.proj.ProjectManager"
android:label="@string/choose_project_title"
android:label="@string/select_proj"
android:theme="@style/AppThemeDialog"
tools:ignore="MissingRegistered" >
</activity>
Expand Down Expand Up @@ -102,10 +102,9 @@
android:theme="@style/AppThemeDialog"
tools:ignore="MissingRegistered" />
<activity
android:name="edu.uml.cs.isense.credentials.EnterName"
android:label="@string/enter_name_prompt"
android:theme="@style/AppThemeDialog"
tools:ignore="MissingRegistered" />
android:name="edu.uml.cs.isense.motion.dialogs.EnterName"
android:label="Enter Data Set Name"
android:theme="@style/AppThemeDialog"/>
<activity
android:name="edu.uml.cs.isense.motion.dialogs.MessageDialogTemplate"
android:label="Output a message"
Expand Down Expand Up @@ -167,11 +166,11 @@
android:theme="@style/AppThemeDialog" />
<activity
android:name="edu.uml.cs.isense.motion.dialogs.DurationDialog"
android:label="Single input"
android:label="Duration"
android:theme="@style/AppThemeDialog" />
<activity
android:name=".dialogs.RateDialog"
android:label="Single input"
android:label="Rate"
android:theme="@style/AppThemeDialog" />
<activity
android:name="edu.uml.cs.isense.motion.dialogs.Help"
Expand Down
9 changes: 0 additions & 9 deletions Apps/Motion/res/layout-v11/duration_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@
android:layout_width="match_parent"
android:layout_height="1dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Length"
android:id="@+id/textView"
android:gravity="center_horizontal" />


<RadioGroup
android:id="@+id/radioGroup1"
android:layout_margin="10dp"
Expand Down
53 changes: 53 additions & 0 deletions Apps/Motion/res/layout-v11/enter_name.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?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"
android:orientation="vertical">

<!--This view forces the dialog to match_parent without it the dialog is really small, bug with Android L?-->
<View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/textview_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/edittext_name"
android:layout_margin="5dp"
android:text="@string/name" />

<EditText
android:id="@+id/edittext_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/textview_name"
android:digits="@string/digits_restriction"
android:imeOptions="actionNext"
android:inputType="textCapSentences"
android:maxLength="45" />
</LinearLayout>


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/edittext_name"
android:orientation="horizontal"
android:gravity="right">

<Button
android:id="@+id/button_ok"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@android:string/ok" />

</LinearLayout>

</LinearLayout>
2 changes: 1 addition & 1 deletion Apps/Motion/res/layout-v11/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
android:layout_height="40dp"
android:layout_toRightOf="@id/tv_name"
android:background="@drawable/button_rsense"
android:text="@string/john_smith"
android:text="@string/data_name"
android:textColor="#0066FF"
android:textSize="14sp"
android:textStyle="bold" />
Expand Down
7 changes: 0 additions & 7 deletions Apps/Motion/res/layout-v11/presets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
android:layout_width="match_parent"
android:layout_height="1dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:gravity="center"
android:text="Presets"/>

<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="match_parent"
Expand Down
8 changes: 0 additions & 8 deletions Apps/Motion/res/layout-v11/rate_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@
android:layout_width="match_parent"
android:layout_height="1dp"/>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Rate"
android:id="@+id/textView"
android:gravity="center_horizontal" />

<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="match_parent"
Expand Down
7 changes: 0 additions & 7 deletions Apps/Motion/res/layout-v11/reset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
android:layout_height="match_parent"
android:orientation="vertical" >

<TextView
android:layout_margin="10dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/reset_prompt"/>

<View
android:id="@+id/view1"
android:layout_width="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion Apps/Motion/res/layout-v21/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
android:layout_height="40dp"
android:layout_toRightOf="@id/tv_name"
android:background="@drawable/button_rsense"
android:text="@string/john_smith"
android:text="@string/data_name"
android:textColor="#0066FF"
android:textSize="14sp"
android:textStyle="bold" />
Expand Down
37 changes: 37 additions & 0 deletions Apps/Motion/res/layout/enter_name.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:id="@+id/textview_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="@string/name" />

<EditText
android:id="@+id/edittext_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/textview_name"
android:digits="@string/digits_restriction"
android:imeOptions="actionNext"
android:inputType="textCapSentences"
android:maxLength="45"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/edittext_name"
android:orientation="horizontal" >

<Button
android:id="@+id/button_ok"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@android:string/ok" />

</LinearLayout>

</RelativeLayout>
2 changes: 1 addition & 1 deletion Apps/Motion/res/layout/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
android:layout_height="40dp"
android:layout_toRightOf="@id/tv_name"
android:background="@drawable/button_rsense"
android:text="@string/john_smith"
android:text="@string/data_name"
android:textColor="#0066FF"
android:textSize="14sp"
android:textStyle="bold" />
Expand Down
3 changes: 2 additions & 1 deletion Apps/Motion/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

<string name="app_name">iSENSE Motions</string>
<string name="help_title">Help</string>
<string name="name">Name:</string>
<string name="display_name">iS Motion</string>
<string name="about_app">About:\n\nThis app enables you to record your accel/magn in all directions and it allows you to share that data online. When the app is activated, your data is collected for ten seconds and then saved so that it can later be shared on the iSENSE web system (isenseproject.org), where it can be viewed publicly. The recording length can be changed via the Menu. In order to allow you to find your contributed data easily, the app asks you to enter your first name and last initial. If you are not comfortable with this information being posted on the web, please refrain from using this application.\n\nInstructions:\n\n In order to begin recording and sharing data, first enter your first name and last initial. Next, choose the sample length in which you would like data to be recorded, this can be done via the \"Recording Length\" menu option. Choose the project you would like the data to be uploaded to by going to the \"Select Project\" menu option. Finally, when you are ready to begin recording data press and hold the button that says \"Hold to Start.\" This allows data to be recorded and saved. When you are ready to upload your data, click on the Upload option in the menu. While data is being recorded, you will not be able to exit the app by pressing the Back button. Pressing the Home button will interrupt the recording. </string>
<string name="help_app">\nHow to Create a Project for this App:\n\n1. Go to isenseproject.org\n\n2. Login or Register for an Account.\n\n3. Click on Projects.\n\n4. Click on Create Project.\n\n5. Enter a name for your project, then click finish. \n\n6. Enter a Description.\n\n7. When formatting the project, the app is capable of recording the following fields:\n\n
Expand Down Expand Up @@ -84,7 +85,7 @@ Light\n\n
<string name="new_proj_name_title">Create New Project</string>
<string name="force">Force Values:</string>
<string name="nameWithColon">Name: </string>
<string name="john_smith">John S.</string>
<string name="data_name">Data Set Name</string>
<string name="accel_preset">Acceleration Preset</string>
<string name="gps_preset">GPS Preset</string>

Expand Down
70 changes: 10 additions & 60 deletions Apps/Motion/src/edu/uml/cs/isense/motion/Motion.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
/***************************************************************************************************/
package edu.uml.cs.isense.motion;

import android.annotation.SuppressLint;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
Expand Down Expand Up @@ -48,7 +47,7 @@
import edu.uml.cs.isense.comm.API;
import edu.uml.cs.isense.credentials.ClassroomMode;
import edu.uml.cs.isense.credentials.CredentialManager;
import edu.uml.cs.isense.credentials.EnterName;
import edu.uml.cs.isense.motion.dialogs.EnterName;
import edu.uml.cs.isense.motion.dialogs.DurationDialog;
import edu.uml.cs.isense.motion.dialogs.Help;
import edu.uml.cs.isense.motion.dialogs.MessageDialogTemplate;
Expand All @@ -63,7 +62,6 @@
import edu.uml.cs.isense.motion.fields.MagFragment;
import edu.uml.cs.isense.motion.fields.PressureFragment;
import edu.uml.cs.isense.motion.fields.TempFragment;
import edu.uml.cs.isense.objects.RPerson;
import edu.uml.cs.isense.proj.ProjectManager;
import edu.uml.cs.isense.queue.QueueLayout;
import edu.uml.cs.isense.queue.UploadQueue;
Expand Down Expand Up @@ -97,9 +95,6 @@ public class Motion extends ActionBarActivity {

public API api;

static String firstName = "";
static String lastInitial = "";

public static final int RESULT_GOT_NAME = 1000;
public static final int LOGIN_STATUS_REQUESTED = 1002;
public static final int RECORDING_LENGTH_REQUESTED = 1003;
Expand All @@ -125,6 +120,8 @@ public class Motion extends ActionBarActivity {

public static Menu menu;

public static String dataSetName;

Intent service;

//Receives info from library to update ui
Expand Down Expand Up @@ -225,23 +222,13 @@ public void run() {
startStop.setText("Hold to Start");
}

SharedPreferences namePrefs = getSharedPreferences(
EnterName.PREFERENCES_KEY_USER_INFO, MODE_PRIVATE);
firstName = namePrefs.getString(
EnterName.PREFERENCES_USER_INFO_SUBKEY_FIRST_NAME,
"");
lastInitial = namePrefs
.getString(
EnterName.PREFERENCES_USER_INFO_SUBKEY_LAST_INITIAL,
"");

if (firstName.length() == 0) {
dataSetName = settings.getString(EnterName.Name_Key, "");

if (dataSetName.length() == 0) {
Intent iEnterName = new Intent(this, EnterName.class);
iEnterName.putExtra(EnterName.PREFERENCES_CLASSROOM_MODE,
true);
startActivityForResult(iEnterName, RESULT_GOT_NAME);
} else {
nameB.setText(firstName + " " + lastInitial);
nameB.setText(dataSetName);
}

String projId = ProjectManager.getProject(mContext);
Expand Down Expand Up @@ -399,16 +386,9 @@ public void onClick(View v) {

@Override
public void onClick(View v) {
// Launch the dialog that allows users to enter his/her
// firstname
// and last initial
Intent iEnterName = new Intent(mContext, EnterName.class);
SharedPreferences classPrefs = getSharedPreferences(
ClassroomMode.PREFS_KEY_CLASSROOM_MODE, 0);
iEnterName.putExtra(EnterName.PREFERENCES_CLASSROOM_MODE,
classPrefs.getBoolean(
ClassroomMode.PREFS_BOOLEAN_CLASSROOM_MODE,
true));
startActivityForResult(iEnterName, RESULT_GOT_NAME);
}

Expand Down Expand Up @@ -508,7 +488,6 @@ public void onStart() {
inPausedState = false;
}

@SuppressLint("NewApi")
@Override
public void onResume() {
super.onResume();
Expand Down Expand Up @@ -641,33 +620,9 @@ public void onActivityResult(int reqCode, int resultCode, Intent data) {
}
} else if (reqCode == RESULT_GOT_NAME) {
if (resultCode == RESULT_OK) {
SharedPreferences namePrefs = getSharedPreferences(
EnterName.PREFERENCES_KEY_USER_INFO, MODE_PRIVATE);

if (namePrefs
.getBoolean(
EnterName.PREFERENCES_USER_INFO_SUBKEY_USE_ACCOUNT_NAME,
true)) {
RPerson user = api.getCurrentUser();

firstName = user.name;
lastInitial = "";

nameB.setText(firstName + " " + lastInitial);


} else {
firstName = namePrefs.getString(
EnterName.PREFERENCES_USER_INFO_SUBKEY_FIRST_NAME,
"");
lastInitial = namePrefs
.getString(
EnterName.PREFERENCES_USER_INFO_SUBKEY_LAST_INITIAL,
"");

nameB.setText(firstName + " " + lastInitial);

}
SharedPreferences settings = getSharedPreferences(MY_SAVED_PREFERENCES, 0);
dataSetName = settings.getString(EnterName.Name_Key, "");
nameB.setText(dataSetName);
}

} else if (reqCode == RESET_REQUESTED) {
Expand Down Expand Up @@ -701,11 +656,6 @@ public void onActivityResult(int reqCode, int resultCode, Intent data) {

/*reset name*/
Intent iEnterName = new Intent(mContext, EnterName.class);
SharedPreferences classPrefs = getSharedPreferences(
ClassroomMode.PREFS_KEY_CLASSROOM_MODE, 0);
iEnterName.putExtra(EnterName.PREFERENCES_CLASSROOM_MODE,
classPrefs.getBoolean(
ClassroomMode.PREFS_BOOLEAN_CLASSROOM_MODE, true));
startActivityForResult(iEnterName, RESULT_GOT_NAME);

}
Expand Down
4 changes: 2 additions & 2 deletions Apps/Motion/src/edu/uml/cs/isense/motion/PresetScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;

import edu.uml.cs.isense.motion.dialogs.Presets;
import edu.uml.cs.isense.proj.ProjectManager;

public class PresetScreen extends ActionBarActivity {
public class PresetScreen extends AppCompatActivity {
CheckBox showScreen;

@Override
Expand Down
Loading

0 comments on commit de53357

Please sign in to comment.