Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Commit

Permalink
[] Enhance advanced view
Browse files Browse the repository at this point in the history
           high-level explanation of what the changes do.

[](https://fivestars.atlassian.net/browse/)
  • Loading branch information
darran-kelinske-fivestars committed Jun 5, 2019
1 parent 6fc5b16 commit b354436
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.view.View
import androidx.annotation.FloatRange
import androidx.appcompat.app.AppCompatActivity
import com.fivestars.wifihealthcheck.R
import com.fivestars.wifihealthcheck.model.AllTheData
import com.fivestars.wifihealthcheck.usecase.WifiScanData
import com.github.mikephil.charting.components.AxisBase
import com.github.mikephil.charting.data.BarData
Expand Down Expand Up @@ -79,15 +80,24 @@ class MainActivity : AppCompatActivity(), CoroutineScope {
progress_bar.progress = progress
}

fun showResults(wifiScanData: WifiScanData, pass: Boolean) {
fun showResults(
allTheData: AllTheData,
wifiScanData: WifiScanData,
pass: Boolean
) {
progress_frame_layout.visibility = View.GONE
pass_fail_layout.visibility = View.VISIBLE
advanced_button.visibility = View.VISIBLE

this.network_info.text = "Network Name: " + allTheData.networkInfo.networkName
this.wifi_info.text = "Link Speed: " + allTheData.wifiInfo.linkSpeed
this.speed_results.text = "Download: " +allTheData.speedTestResults + " Upload: " +allTheData.speedTestResults.upload

pass_fail_view.text = when {
pass -> "Pass"
else -> "Fail"
}

showChart(wifiScanData)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class WifiHealthPresenter(private val mainActivity: MainActivity) {
pass = false
}

mainActivity.showResults(wifiScanData, pass)
mainActivity.showResults(, wifiScanData, pass)

}

Expand Down
40 changes: 20 additions & 20 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,30 @@
android:gravity="top"
android:visibility="gone">

<!--<TextView-->
<!--android:id="@+id/wifi_info"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content" />-->
<TextView
android:id="@+id/wifi_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<!--<TextView-->
<!--android:id="@+id/network_info"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content" />-->
<TextView
android:id="@+id/network_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<!--<TextView-->
<!--android:id="@+id/wifi_scan"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"/>-->
<TextView
android:id="@+id/wifi_scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<!--<TextView-->
<!--android:id="@+id/speed_results"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"/>-->
<TextView
android:id="@+id/speed_results"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<!--<TextView-->
<!--android:id="@+id/link_speed_text_view"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content" />-->
<TextView
android:id="@+id/link_speed_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<com.github.mikephil.charting.charts.BarChart
android:id="@+id/chart1"
Expand Down

0 comments on commit b354436

Please sign in to comment.