Skip to content

Commit

Permalink
KAA-465: improve design, fix gauge chart scaling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
batytskyy committed Apr 30, 2015
1 parent 709aa08 commit 4c42df1
Show file tree
Hide file tree
Showing 8 changed files with 223 additions and 97 deletions.
3 changes: 2 additions & 1 deletion examples/powerplant-android/AndroidManifest.xml
Expand Up @@ -38,7 +38,8 @@
android:name=".PowerPlantActivity" android:name=".PowerPlantActivity"
android:screenOrientation="landscape" android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation|screenSize" android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/app_name" > android:label="@string/app_name"
android:hardwareAccelerated="false">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
Expand Down
25 changes: 25 additions & 0 deletions examples/powerplant-android/res/drawable-mdpi/drop_shadow_down.xml
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Copyright 2014-2015 CyberVision, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#ACACAC"
android:endColor="#E0E0E0"
android:angle="270">
</gradient>
</shape>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Copyright 2014-2015 CyberVision, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#ACACAC"
android:endColor="#E0E0E0"
android:angle="0">
</gradient>
</shape>
83 changes: 71 additions & 12 deletions examples/powerplant-android/res/layout/fragment_dashboard.xml
Expand Up @@ -26,13 +26,12 @@
android:background="#E0E0E0" android:background="#E0E0E0"
android:layout_marginTop="10dp"> android:layout_marginTop="10dp">


<RelativeLayout <RelativeLayout
android:id="@+id/lineChartLayout" android:id="@+id/lineChartLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:background="#FFFFFF" android:background="#FFFFFF"
android:layout_marginBottom="15dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"> android:layout_marginRight="10dp">
<TextView <TextView
Expand All @@ -56,7 +55,6 @@
android:layout_below="@+id/lineChartYAxisText" android:layout_below="@+id/lineChartYAxisText"
android:layout_above="@+id/lineChartXAxisText"> android:layout_above="@+id/lineChartXAxisText">
</lecho.lib.hellocharts.view.LineChartView> </lecho.lib.hellocharts.view.LineChartView>

<TextView <TextView
android:id="@+id/lineChartXAxisText" android:id="@+id/lineChartXAxisText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
Expand All @@ -66,7 +64,21 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:gravity="center" android:gravity="center"
/> />
<View
android:layout_width="3dp"
android:layout_height="fill_parent"
android:background="@drawable/drop_shadow_right"
android:layout_alignParentRight="true">
</View>
</RelativeLayout> </RelativeLayout>
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="@drawable/drop_shadow_down"
android:layout_below="@+id/lineChartLayout"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp">
</View>


<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
Expand All @@ -75,9 +87,10 @@
android:orientation="horizontal" android:orientation="horizontal"
android:weightSum="50" android:weightSum="50"
android:baselineAligned="false" android:baselineAligned="false"
android:layout_marginTop="15dp"
android:layout_marginBottom="10dp"> android:layout_marginBottom="10dp">


<LinearLayout <LinearLayout
android:id="@+id/gaugeChartMainLayout" android:id="@+id/gaugeChartMainLayout"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="0dp" android:layout_width="0dp"
Expand Down Expand Up @@ -117,6 +130,12 @@
custom:panel_name="Panel 3" custom:panel_name="Panel 3"
custom:update_time_s="2"> custom:update_time_s="2">
</org.kaaproject.kaa.demo.powerplant.view.GaugeChart> </org.kaaproject.kaa.demo.powerplant.view.GaugeChart>
<View
android:layout_width="3dp"
android:layout_height="fill_parent"
android:background="@drawable/drop_shadow_right"
android:layout_alignParentRight="true">
</View>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/gaugeChartBottomLayout" android:id="@+id/gaugeChartBottomLayout"
Expand Down Expand Up @@ -149,7 +168,20 @@
custom:panel_name="Panel 6" custom:panel_name="Panel 6"
custom:update_time_s="2"> custom:update_time_s="2">
</org.kaaproject.kaa.demo.powerplant.view.GaugeChart> </org.kaaproject.kaa.demo.powerplant.view.GaugeChart>
<View
android:layout_width="3dp"
android:layout_height="fill_parent"
android:background="@drawable/drop_shadow_right"
android:layout_alignParentRight="true">
</View>
</LinearLayout> </LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="@drawable/drop_shadow_down"
android:layout_below="@+id/gaugeChartMainLayout">
</View>

</LinearLayout> </LinearLayout>


<RelativeLayout <RelativeLayout
Expand All @@ -161,9 +193,10 @@
android:id="@+id/pieChart" android:id="@+id/pieChart"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="15dp"> android:layout_marginLeft="18dp">
</lecho.lib.hellocharts.view.PieChartView> </lecho.lib.hellocharts.view.PieChartView>
<LinearLayout <LinearLayout
android:id="@+id/linearLayoutForPieChart"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_alignLeft="@+id/pieChart" android:layout_alignLeft="@+id/pieChart"
Expand Down Expand Up @@ -230,17 +263,29 @@
android:text="total" android:text="total"
android:textColor="#00BDF0" android:textColor="#00BDF0"
/> />

</LinearLayout> </LinearLayout>

<View
android:layout_width="3dp"
android:layout_height="fill_parent"
android:background="@drawable/drop_shadow_right"
android:layout_alignParentRight="true">
</View>
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="@drawable/drop_shadow_down"
android:layout_marginLeft="18dp"
android:layout_alignBottom="@+id/pieChart">
</View>
</RelativeLayout> </RelativeLayout>



<RelativeLayout <RelativeLayout
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_weight="15" android:layout_weight="15"
android:background="#FFFFFF" android:background="#FFFFFF"
android:layout_marginLeft="15dp" android:layout_marginLeft="18dp"
android:layout_marginRight="10dp"> android:layout_marginRight="10dp">
<TextView <TextView
android:id="@+id/logBox" android:id="@+id/logBox"
Expand All @@ -251,15 +296,29 @@
android:clickable="false" android:clickable="false"
android:cursorVisible="false" android:cursorVisible="false"
android:editable="false" android:editable="false"
android:gravity="left" android:gravity="bottom"
android:isScrollContainer="true"
android:longClickable="false" android:longClickable="false"
android:maxLines = "50"
android:scrollbars="vertical" android:scrollbars="vertical"
android:textSize="14dp" android:textSize="14sp"
android:lineSpacingMultiplier="1.2" android:lineSpacingMultiplier="1.2"
android:inputType="textMultiLine" android:inputType="textMultiLine"
android:paddingTop="15dp" android:paddingTop="15dp"
android:paddingBottom="16dp"/> android:paddingBottom="16dp"
android:paddingRight="2dp">
</TextView>
<View
android:layout_width="3dp"
android:layout_height="fill_parent"
android:background="@drawable/drop_shadow_right"
android:layout_alignParentRight="true">
</View>
<View
android:layout_width="fill_parent"
android:layout_height="3dp"
android:background="@drawable/drop_shadow_down"
android:layout_alignBottom="@+id/logBox">
</View>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>


Expand Down
2 changes: 1 addition & 1 deletion examples/powerplant-android/res/values/strings.xml
Expand Up @@ -18,7 +18,7 @@


<resources> <resources>


<string name="app_name">City Guide Demo</string> <string name="app_name">Power plant</string>
<string name="please_wait">Please wait...</string> <string name="please_wait">Please wait...</string>


</resources> </resources>
Expand Up @@ -25,7 +25,7 @@
public class RestDataEndpoint extends AbstractDataEndpoint { public class RestDataEndpoint extends AbstractDataEndpoint {
private static final String TAG = RestDataEndpoint.class.getSimpleName(); private static final String TAG = RestDataEndpoint.class.getSimpleName();


private static final String BASE_URL = "http://10.2.2.89:10000/api/data"; private static final String BASE_URL = "http://192.168.13.100:10000/api/data";
private static final String LATEST_URL = BASE_URL + "/latest"; private static final String LATEST_URL = BASE_URL + "/latest";


@Override @Override
Expand Down

0 comments on commit 4c42df1

Please sign in to comment.