Skip to content

Commit 46b745d

Browse files
committed
Reformatted code
1 parent ed9cd98 commit 46b745d

File tree

3 files changed

+57
-45
lines changed

3 files changed

+57
-45
lines changed

app/src/main/java/io/neurolab/activities/MemoryGraphParent.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class MemoryGraphParent extends AppCompatActivity {
1717

1818
private String filePath;
1919
public static final String MEMORY_GRAPH_FLAG = "Memory";
20+
private static Fragment defaultProgram = MemoryGraphFragment.newInstance();
2021

2122
@Override
2223
protected void onCreate(Bundle savedInstanceState) {
@@ -49,12 +50,11 @@ protected void onCreate(Bundle savedInstanceState) {
4950
selectedFragment.setArguments(bundle);
5051
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
5152
transaction.replace(R.id.frame_layout, selectedFragment);
53+
defaultProgram = selectedFragment;
5254
transaction.commit();
5355
return true;
5456
});
55-
5657
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
57-
Fragment defaultProgram = MemoryGraphFragment.newInstance();
5858
defaultProgram.setArguments(bundle);
5959
transaction.replace(R.id.frame_layout, defaultProgram);
6060
transaction.commit();
@@ -70,6 +70,7 @@ public boolean onSupportNavigateUp(){
7070
public void onBackPressed() {
7171
super.onBackPressed();
7272
StatisticsFragment.parsedData = null;
73+
defaultProgram = MemoryGraphFragment.newInstance();
7374
}
7475

7576
public void setActionBarTitle(String title) {

app/src/main/res/layout/fragment_spectrum.xml

+47-42
Original file line numberDiff line numberDiff line change
@@ -15,61 +15,66 @@
1515
android:textColor="@android:color/white"
1616
android:textSize="@dimen/text_size_small" />
1717

18-
<LinearLayout
18+
<ScrollView
1919
android:layout_width="match_parent"
2020
android:layout_height="match_parent"
21-
android:background="@color/memory_graph_background"
22-
android:orientation="vertical">
23-
24-
<com.github.mikephil.charting.charts.LineChart
25-
android:id="@+id/frequency_spectrum_chart"
26-
android:layout_width="match_parent"
27-
android:layout_height="@dimen/spectrum_screen_height"
28-
android:background="@color/memory_graph_background">
29-
30-
</com.github.mikephil.charting.charts.LineChart>
21+
android:background="@color/memory_graph_background">
3122

3223
<LinearLayout
3324
android:layout_width="match_parent"
34-
android:layout_height="wrap_content"
35-
android:layout_margin="@dimen/padding_medium"
36-
android:orientation="horizontal">
25+
android:layout_height="match_parent"
26+
android:background="@color/memory_graph_background"
27+
android:orientation="vertical">
28+
29+
<com.github.mikephil.charting.charts.LineChart
30+
android:id="@+id/frequency_spectrum_chart"
31+
android:layout_width="match_parent"
32+
android:layout_height="@dimen/spectrum_screen_height"
33+
android:background="@color/memory_graph_background">
3734

38-
<ImageView
39-
android:layout_width="@dimen/card_margin_large"
40-
android:layout_height="@dimen/card_margin_large"
41-
android:src="@android:color/holo_red_dark" />
35+
</com.github.mikephil.charting.charts.LineChart>
4236

43-
<TextView
44-
android:layout_width="wrap_content"
37+
<LinearLayout
38+
android:layout_width="match_parent"
4539
android:layout_height="wrap_content"
46-
android:layout_marginLeft="@dimen/padding_small"
47-
android:text="@string/anger_range"
48-
android:textSize="@dimen/text_size_small"
49-
android:textColor="@android:color/white" />
40+
android:layout_margin="@dimen/padding_medium"
41+
android:orientation="horizontal">
5042

51-
</LinearLayout>
43+
<ImageView
44+
android:layout_width="@dimen/card_margin_large"
45+
android:layout_height="@dimen/card_margin_large"
46+
android:src="@android:color/holo_red_dark" />
5247

53-
<LinearLayout
54-
android:layout_width="match_parent"
55-
android:layout_height="wrap_content"
56-
android:layout_margin="@dimen/padding_medium"
57-
android:orientation="horizontal">
48+
<TextView
49+
android:layout_width="wrap_content"
50+
android:layout_height="wrap_content"
51+
android:layout_marginLeft="@dimen/padding_small"
52+
android:text="@string/anger_range"
53+
android:textColor="@android:color/white"
54+
android:textSize="@dimen/text_size_small" />
5855

59-
<ImageView
60-
android:layout_width="@dimen/card_margin_large"
61-
android:layout_height="@dimen/card_margin_large"
62-
android:src="@color/calm_green" />
56+
</LinearLayout>
6357

64-
<TextView
65-
android:layout_width="wrap_content"
58+
<LinearLayout
59+
android:layout_width="match_parent"
6660
android:layout_height="wrap_content"
67-
android:layout_marginLeft="@dimen/padding_small"
68-
android:text="@string/calm_range"
69-
android:textSize="@dimen/text_size_small"
70-
android:textColor="@android:color/white" />
61+
android:layout_margin="@dimen/padding_medium"
62+
android:orientation="horizontal">
7163

72-
</LinearLayout>
73-
</LinearLayout>
64+
<ImageView
65+
android:layout_width="@dimen/card_margin_large"
66+
android:layout_height="@dimen/card_margin_large"
67+
android:src="@color/calm_green" />
7468

69+
<TextView
70+
android:layout_width="wrap_content"
71+
android:layout_height="wrap_content"
72+
android:layout_marginLeft="@dimen/padding_small"
73+
android:text="@string/calm_range"
74+
android:textColor="@android:color/white"
75+
android:textSize="@dimen/text_size_small" />
76+
77+
</LinearLayout>
78+
</LinearLayout>
79+
</ScrollView>
7580
</LinearLayout>

app/src/main/res/layout/fragment_statistics.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
android:layout_height="match_parent"
88
tools:context=".fragments.StatisticsFragment">
99

10-
<include layout="@layout/stat_items" />
10+
<ScrollView
11+
android:layout_width="match_parent"
12+
android:layout_height="match_parent">
13+
14+
<include layout="@layout/stat_items" />
15+
16+
</ScrollView>
1117

1218
</android.support.constraint.ConstraintLayout>

0 commit comments

Comments
 (0)