Added fullscreen graph for landscape mode.
[artf472308]
This commit is contained in:
parent
55f983c773
commit
05417b10d0
10 changed files with 79 additions and 23 deletions
4
.idea/libraries/GraphView_3_1_3.xml
generated
4
.idea/libraries/GraphView_3_1_3.xml
generated
|
|
@ -4,6 +4,8 @@
|
|||
<root url="jar://$PROJECT_DIR$/app/libs/GraphView-3.1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
<SOURCES>
|
||||
<root url="jar://$PROJECT_DIR$/app/libs/src/GraphView-3.1.3.zip!/GraphView-3.1.3/src/main/java" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
11
.idea/libraries/support_annotations_21_0_0.xml
generated
Executable file
11
.idea/libraries/support_annotations_21_0_0.xml
generated
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-annotations-21.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.0/support-annotations-21.0.0.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://C:/Program Files (x86)/Android/android-sdk/extras/android/m2repository/com/android/support/support-annotations/21.0.0/support-annotations-21.0.0-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
11
.idea/libraries/support_v4_21_0_0.xml
generated
Executable file
11
.idea/libraries/support_v4_21_0_0.xml
generated
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
<component name="libraryTable">
|
||||
<library name="support-v4-21.0.0">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.0/libs/internal_impl-21.0.0.jar!/" />
|
||||
<root url="file://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.0/res" />
|
||||
<root url="jar://$PROJECT_DIR$/app/build/intermediates/exploded-aar/com.android.support/support-v4/21.0.0/classes.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
|
|
@ -83,13 +83,14 @@
|
|||
</content>
|
||||
<orderEntry type="jdk" jdkName="Android API 15 Platform" jdkType="Android SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" exported="" name="support-v4-19.1.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="dom4j-1.6.1" level="project" />
|
||||
<orderEntry type="library" exported="" name="log4j-1.2.17" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-v4-21.0.0" level="project" />
|
||||
<orderEntry type="library" exported="" name="android-logging-log4j-1.0.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="gson-2.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="commons-net-3.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="jaxen-1.1.6" level="project" />
|
||||
<orderEntry type="library" exported="" name="GraphView-3.1.3" level="project" />
|
||||
<orderEntry type="library" exported="" name="support-annotations-21.0.0" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
@ -34,6 +34,6 @@ android {
|
|||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
// You must install or update the Support Repository through the SDK manager to use this dependency.
|
||||
compile 'com.android.support:support-v4:19.1.+'
|
||||
compile 'com.android.support:support-v4:+'
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,13 +40,14 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
public static final String BEHAVIOUR_SAVE_FILE = "behaviour_list.json";
|
||||
|
||||
|
||||
/** Fragments **/
|
||||
/* Fragments */
|
||||
private StatusFragment statusFragment;
|
||||
private BehaviourListFragment behaviourListFragment;
|
||||
private MenuItem action_execute;
|
||||
private MenuItem action_mark;
|
||||
private boolean backButtonPressed = false;
|
||||
|
||||
/* Static Data */
|
||||
private static UeControlExecutor currentExecutor;
|
||||
private static CSVWriter csvLogger;
|
||||
private static int uid;
|
||||
|
|
@ -68,14 +69,6 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
// Setup Debugging
|
||||
setupDebugLogging();
|
||||
|
||||
// Setup Main GUI
|
||||
setContentView(R.layout.activity_main);
|
||||
statusFragment = (StatusFragment)
|
||||
getFragmentManager().findFragmentById(R.id.status_fragment);
|
||||
behaviourListFragment = new BehaviourListFragment();
|
||||
getFragmentManager().beginTransaction()
|
||||
.replace(R.id.container, behaviourListFragment).commit();
|
||||
|
||||
// Setup Executor
|
||||
if(currentExecutor == null) {
|
||||
log.info("Creating new instance of executor");
|
||||
|
|
@ -101,8 +94,16 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
log.info("Using existing executor");
|
||||
}
|
||||
|
||||
currentExecutor.setThroughputListener(statusFragment.getThroughputListener());
|
||||
|
||||
// Setup Main GUI
|
||||
setContentView(R.layout.activity_main);
|
||||
statusFragment = (StatusFragment)
|
||||
getFragmentManager().findFragmentById(R.id.status_fragment);
|
||||
behaviourListFragment = (BehaviourListFragment)
|
||||
getFragmentManager().findFragmentById(R.id.behaviour_list_fragment);
|
||||
|
||||
|
||||
currentExecutor.setThroughputListener(statusFragment.getThroughputListener());
|
||||
updateExecutionState();
|
||||
}
|
||||
|
||||
|
|
@ -225,7 +226,8 @@ public class MainActivity extends FragmentActivity implements OnSharedPreference
|
|||
try {
|
||||
if(tag.equals("import")) {
|
||||
currentExecutor.read(file.getAbsolutePath());
|
||||
behaviourListFragment.onResume();
|
||||
if(behaviourListFragment != null)
|
||||
behaviourListFragment.onResume();
|
||||
}
|
||||
else if(tag.equals("export")) {
|
||||
currentExecutor.save(file.getAbsolutePath());
|
||||
|
|
|
|||
|
|
@ -61,8 +61,10 @@ public class BehaviourListFragment extends Fragment {
|
|||
|
||||
@Override
|
||||
public void onResume() {
|
||||
adapter.generateIds();
|
||||
adapter.notifyDataSetChanged();
|
||||
if(adapter != null) {
|
||||
adapter.generateIds();
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,12 +65,14 @@ public class StatusFragment extends Fragment {
|
|||
LineGraphView graphView = new LineGraphView(this.getActivity(), "GraphView");
|
||||
graphView.addSeries(downGraph);
|
||||
graphView.addSeries(upGraph);
|
||||
//graphView.setDrawDataPoints(true);
|
||||
graphView.setViewPort(0, 120);
|
||||
graphView.setScrollable(true);
|
||||
graphView.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
||||
graphView.getGraphViewStyle().setGridStyle(GraphViewStyle.GridStyle.BOTH);
|
||||
graphView.setShowVerticalLabels(false);
|
||||
//graphView.setDrawDataPoints(true);
|
||||
graphView.setViewPort(0, 120);
|
||||
graphView.setScrollable(true);
|
||||
graphView.setDisableTouch(true);
|
||||
graphView.scrollToEnd();
|
||||
|
||||
LinearLayout layout = (LinearLayout) view.findViewById(R.id.graph);
|
||||
layout.addView(graphView);
|
||||
|
|
|
|||
22
app/src/main/res/layout-land/activity_main.xml
Executable file
22
app/src/main/res/layout-land/activity_main.xml
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
|
||||
<android.support.v4.widget.DrawerLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/drawer_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<fragment android:id="@+id/status_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:name="com.ericsson.uecontrol.gui.fragments.StatusFragment"
|
||||
tools:layout="@layout/fragment_status" />
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v4.widget.DrawerLayout>
|
||||
|
|
@ -12,7 +12,8 @@
|
|||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<fragment android:id="@+id/status_fragment"
|
||||
<fragment
|
||||
android:id="@+id/status_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:name="com.ericsson.uecontrol.gui.fragments.StatusFragment"
|
||||
|
|
@ -20,10 +21,12 @@
|
|||
|
||||
<!-- As the main content view, the view below consumes the entire
|
||||
space available using match_parent in both dimensions. -->
|
||||
<FrameLayout
|
||||
android:id="@+id/container"
|
||||
<fragment
|
||||
android:id="@+id/behaviour_list_fragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:name="com.ericsson.uecontrol.gui.fragments.BehaviourListFragment"
|
||||
tools:layout="@layout/fragment_item" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue