Commit 512eff4b authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Added a button to the main layout which opens the speed test activity

parent f75c6347
Pipeline #4763 passed with stage
in 36 seconds
......@@ -170,6 +170,7 @@
<action android:name="com.twofortyfouram.locale.intent.action.EDIT_SETTING"/>
</intent-filter>
</activity>
<activity android:name=".activity.SpeedTestActivity"/>
<service
android:name=".service.DnsVpnService"
......
package com.frostnerd.smokescreen.activity
import com.frostnerd.lifecyclemanagement.BaseActivity
/*
* Copyright (C) 2019 Daniel Wolf (Ch4t4r)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* You can contact the developer at daniel.wolf@frostnerd.com.
*/
class SpeedTestActivity :BaseActivity() {
override fun getConfiguration(): Configuration {
return Configuration.withDefaults()
}
}
\ No newline at end of file
......@@ -18,6 +18,7 @@ import androidx.fragment.app.Fragment
import com.frostnerd.dnstunnelproxy.DnsServerInformation
import com.frostnerd.general.service.isServiceRunning
import com.frostnerd.smokescreen.R
import com.frostnerd.smokescreen.activity.SpeedTestActivity
import com.frostnerd.smokescreen.dialog.ServerChoosalDialog
import com.frostnerd.smokescreen.getPreferences
import com.frostnerd.smokescreen.registerLocalReceiver
......@@ -77,6 +78,9 @@ class MainFragment : Fragment() {
}
updateVpnIndicators()
}
speedTest.setOnClickListener {
startActivity(Intent(context!!, SpeedTestActivity::class.java))
}
vpnStateReceiver = requireContext().registerLocalReceiver(
listOf(
DnsVpnService.BROADCAST_VPN_ACTIVE,
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M1,9l2,2c4.97,-4.97 13.03,-4.97 18,0l2,-2C16.93,2.93 7.08,2.93 1,9zM9,17l3,3 3,-3c-1.65,-1.66 -4.34,-1.66 -6,0zM5,13l2,2c2.76,-2.76 7.24,-2.76 10,0l2,-2C15.14,9.14 8.87,9.14 5,13z"/>
</vector>
......@@ -54,6 +54,17 @@
android:orientation="horizontal"
android:layout_height="wrap_content">
<ImageButton
android:id="@+id/speedTest"
android:src="@drawable/ic_wifi"
android:background="@drawable/main_roundbuttons"
android:tint="?android:attr/textColor"
android:layout_width="48dp"
android:layout_toStartOf="@id/serverButton"
android:layout_marginEnd="8dp"
android:contentDescription="@string/contentdescription_main_servericon"
android:layout_height="48dp"/>
<ImageButton
android:id="@+id/serverButton"
android:src="@drawable/ic_main_server"
......@@ -70,7 +81,7 @@
android:id="@+id/startButton"
android:background="@drawable/main_roundbuttons"
android:text="Start"
android:layout_toStartOf="@id/serverButton"
android:layout_toStartOf="@id/speedTest"
android:layout_marginEnd="8dp"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_height="wrap_content"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment