Commit 4d05f0d1 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Added button to the main view which opens an (empty) activity with the host sources

parent 93e0017c
......@@ -175,6 +175,7 @@
android:theme="@style/AppTheme_Mono"
android:label="@string/activity_label_speed_test"
/>
<activity android:name=".fragment.DnsRuleActivity"/>
<service
android:name=".service.DnsVpnService"
......
package com.frostnerd.smokescreen.fragment
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
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 DnsRuleActivity : BaseActivity() {
override fun getConfiguration(): Configuration {
return Configuration.withDefaults()
}
}
\ No newline at end of file
......@@ -119,6 +119,9 @@ class MainFragment : Fragment() {
startActivity(i)
}
}
dnsRules.setOnClickListener {
startActivity(Intent(context!!, DnsRuleActivity::class.java))
}
GlobalScope.launch {
val context = context
if (isAdded && !isDetached && context != null) {
......
......@@ -51,7 +51,6 @@
<RelativeLayout
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="wrap_content">
<ImageButton
......@@ -85,6 +84,16 @@
android:layout_marginEnd="8dp"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:layout_height="wrap_content"/>
<Button
android:layout_width="match_parent"
android:id="@+id/dnsRules"
android:layout_marginTop="12dp"
android:layout_below="@id/startButton"
style="@style/Base.Widget.AppCompat.Button.Borderless.Colored"
android:text="@string/button_main_dnsrules"
android:background="@drawable/main_roundbuttons"
android:layout_height="wrap_content"/>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -60,4 +60,5 @@
<string name="window_speedtest_runtest">Start the test</string>
<string name="window_speedtest_useserver">Use this server</string>
<string name="button_main_dnsrules">DNS rules</string>
</resources>
Supports Markdown
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