Commit 1a5584cb authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Removed the design library

parent 2daf5e50
......@@ -100,12 +100,12 @@ dependencies {
implementation 'com.frostnerd.utilskt:navigationdraweractivity:1.3.17'
implementation 'com.frostnerd.utilskt:encrypteddnstunnelproxy:1.5.112'
implementation 'com.frostnerd.utilskt:general:1.0.15'
implementation 'com.frostnerd.utils:design:1.0.17'
implementation 'com.frostnerd.utilskt:networking:1.0.3'
implementation 'com.frostnerd.utilskt:adapters:1.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0-beta01'
implementation "androidx.preference:preference:1.1.0-beta01"
implementation "com.google.android.material:material:1.1.0-alpha07"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
......
......@@ -37,7 +37,7 @@ class DnsRuleDialog(context: Context, dnsRule: DnsRule? = null, onRuleCreated: (
val view = layoutInflater.inflate(R.layout.dialog_create_dnsrule, null, false)
setView(view)
setTitle(R.string.dialog_newdnsrule_title)
setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(R.string.cancel)) { dialog, _ ->
setButton(DialogInterface.BUTTON_NEGATIVE, context.getString(android.R.string.cancel)) { dialog, _ ->
dialog.dismiss()
}
setButton(DialogInterface.BUTTON_POSITIVE, context.getString(android.R.string.ok)) { _, _ ->
......
package com.frostnerd.smokescreen.dialog
import android.content.Context
import android.view.View
import android.widget.TextView
import androidx.annotation.StringRes
import com.frostnerd.lifecyclemanagement.BaseDialog
import com.frostnerd.smokescreen.R
import com.frostnerd.smokescreen.getPreferences
import kotlinx.android.synthetic.main.dialog_loading.view.*
/*
* 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 LoadingDialog(context:Context, title:String, private var message: String?) :BaseDialog(context, context.getPreferences().theme.dialogStyle) {
constructor(context: Context, @StringRes title:Int):this(context, context.getString(title), null)
constructor(context: Context, @StringRes title:Int, @StringRes message:Int):this(context, context.getString(title), context.getString(message))
constructor(context: Context, title:String):this(context, title, null)
private val messageView:TextView
init {
setCancelable(false)
setTitle(title)
val view: View = layoutInflater.inflate(R.layout.dialog_loading, null, false)
setView(view)
messageView = view.text
messageView.text = message
}
override fun setMessage(message: CharSequence?) {
messageView.text = message
this.message = message.toString()
}
fun appendToMessage(string: String) {
messageView.text = (message ?: "") + string
}
override fun destroy() {}
}
\ No newline at end of file
......@@ -16,13 +16,13 @@ import androidx.preference.CheckBoxPreference
import androidx.preference.EditTextPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import com.frostnerd.design.dialogs.LoadingDialog
import com.frostnerd.general.isInt
import com.frostnerd.smokescreen.*
import com.frostnerd.smokescreen.activity.MainActivity
import com.frostnerd.smokescreen.database.getDatabase
import com.frostnerd.smokescreen.dialog.AppChoosalDialog
import com.frostnerd.smokescreen.dialog.CrashReportingEnableDialog
import com.frostnerd.smokescreen.dialog.LoadingDialog
import com.frostnerd.smokescreen.dialog.QueryGeneratorDialog
import com.frostnerd.smokescreen.util.preferences.Theme
import io.sentry.Sentry
......
......@@ -4,10 +4,10 @@ import android.content.Context
import android.graphics.Rect
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.frostnerd.design.DesignUtil
class SpaceItemDecorator(context: Context, spaceDp:Int = 12) : RecyclerView.ItemDecoration() {
private val decorationHeight: Int = DesignUtil.dpToPixels(spaceDp.toFloat(), context).toInt()
class SpaceItemDecorator(context: Context, spaceDp: Int = 12) : RecyclerView.ItemDecoration() {
private val decorationHeight: Int =
spaceDp * (context.resources.displayMetrics.densityDpi.toFloat() / 160.0f).toInt()
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
super.getItemOffsets(outRect, view, parent, state)
......
......@@ -36,7 +36,7 @@
android:layout_width="match_parent"
android:id="@+id/nameTil"
app:errorEnabled="true"
android:hint="@string/search"
android:hint="@string/hint_search"
android:textColorHint="?attr/foregroundElementColor"
android:layout_toStartOf="@id/clearSearch"
android:layout_alignParentStart="true"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<ProgressBar
android:id="@+id/progress"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/progress"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:gravity="center"
android:textSize="17sp" />
</RelativeLayout>
\ No newline at end of file
......@@ -31,7 +31,6 @@
android:hint="@string/dialog_newserver_name"
android:textColorHint="?attr/foregroundElementColor"
android:layout_marginTop="8dp"
app:openKeyboardOnFocus="true"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
......@@ -52,7 +51,6 @@
android:hint="@string/dialog_newserver_primaryserver"
android:textColorHint="?attr/foregroundElementColor"
android:layout_marginTop="8dp"
app:openKeyboardOnFocus="true"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
......@@ -73,7 +71,6 @@
android:hint="@string/dialog_newserver_secondaryserver"
android:textColorHint="?attr/foregroundElementColor"
android:layout_marginTop="8dp"
app:openKeyboardOnFocus="true"
android:layout_height="wrap_content">
<com.google.android.material.textfield.TextInputEditText
......
......@@ -10,4 +10,5 @@
<string name="contentdescription_stop_app">Stop the app</string>
<string name="hint_searchterm">Term to be searched</string>
<string name="hint_search">Search</string>
</resources>
\ No newline at end of file
......@@ -14,8 +14,6 @@
<item name="android:textColorSecondary">#EEEEEE</item>
<item name="android:textColorHighlight">#EEEEEE</item>
<item name="android:editTextColor">#EEEEEE</item>
<item name="cardColor">#42A5F5</item>
<item name="cardStrokeColor">#42A5F5</item>
<item name="inputElementColor">#42A5F5</item>
<item name="foregroundElementColor">#FFF</item>
......@@ -44,8 +42,6 @@
<item name="android:textColorSecondary">#E0E0E0</item>
<item name="android:textColorHighlight">#E0E0E0</item>
<item name="android:editTextColor">#BDBDBD</item>
<item name="cardColor">#757575</item>
<item name="cardStrokeColor">#757575</item>
<item name="inputElementColor">#757575</item>
<item name="foregroundElementColor">#EEEEEE</item>
......@@ -74,8 +70,6 @@
<item name="android:textColorSecondary">#BDBDBD</item>
<item name="android:textColorHighlight">#B0BEC5</item>
<item name="android:editTextColor">#E0E0E0</item>
<item name="cardColor">#90A4AE</item>
<item name="cardStrokeColor">#90A4AE</item>
<item name="inputElementColor">#90A4AE</item>
<item name="foregroundElementColor">#FFF</item>
......@@ -109,8 +103,6 @@
<item name="android:textColorSecondary">#9E9E9E</item>
<item name="android:textColorHighlight">#9E9E9E</item>
<item name="android:editTextColor">#9E9E9E</item>
<item name="cardColor">#37474F</item>
<item name="cardStrokeColor">#37474F</item>
<item name="inputElementColor">#37474F</item>
<item name="foregroundElementColor">#9E9E9E</item>
......@@ -143,9 +135,6 @@
<item name="foregroundElementColor">#FFF</item>
<item name="color">#EEEEEE</item>
<item name="cardColor">#42A5F5</item>
<item name="cardStrokeColor">#42A5F5</item>
<item name="inputElementColor">#42A5F5</item>
<item name="android:windowNoTitle">true</item>
......@@ -171,9 +160,6 @@
<item name="foregroundElementColor">#FFF</item>
<item name="color">#E0E0E0</item>
<item name="cardColor">#90A4AE</item>
<item name="cardStrokeColor">#90A4AE</item>
<item name="inputElementColor">#90A4AE</item>
<item name="android:windowNoTitle">true</item>
......@@ -199,9 +185,6 @@
<item name="foregroundElementColor">#EEEEEE</item>
<item name="color">#BDBDBD</item>
<item name="cardColor">#757575</item>
<item name="cardStrokeColor">#757575</item>
<item name="inputElementColor">#757575</item>
<item name="android:windowNoTitle">true</item>
......@@ -227,9 +210,6 @@
<item name="foregroundElementColor">#9E9E9E</item>
<item name="color">#424242</item>
<item name="cardColor">#37474F</item>
<item name="cardStrokeColor">#37474F</item>
<item name="inputElementColor">#37474F</item>
<item name="android:windowNoTitle">true</item>
......@@ -250,9 +230,6 @@
<item name="android:textColorHighlight">@color/preference_primary_color</item>
<item name="android:editTextColor">@color/preference_primary_color</item>
<item name="foregroundElementColor">#FFF</item>
<item name="cardColor">#42A5F5</item>
<item name="cardStrokeColor">#42A5F5</item>
<item name="inputElementColor">#42A5F5</item>
<item name="android:dialogTheme">@style/DialogTheme_Blue</item>
......@@ -272,9 +249,6 @@
<item name="android:textColorHighlight">@color/preference_primary_color_dark</item>
<item name="android:editTextColor">@color/preference_primary_color_dark</item>
<item name="foregroundElementColor">#FFF</item>
<item name="cardColor">#757575</item>
<item name="cardStrokeColor">#757575</item>
<item name="inputElementColor">#757575</item>
<item name="dialogTheme">@style/DialogTheme_Dark</item>
......@@ -297,8 +271,6 @@
<item name="android:editTextColor">@color/preference_primary_color_mono</item>
<item name="foregroundElementColor">#FFF</item>
<item name="cardColor">#90A4AE</item>
<item name="cardStrokeColor">#90A4AE</item>
<item name="inputElementColor">#90A4AE</item>
<item name="dialogTheme">@style/DialogTheme_Mono</item>
......@@ -320,8 +292,6 @@
<item name="android:textColorHighlight">@color/preference_primary_color_true_black</item>
<item name="android:editTextColor">@color/preference_primary_color_true_black</item>
<item name="cardColor">#37474F</item>
<item name="cardStrokeColor">#37474F</item>
<item name="inputElementColor">#37474F</item>
<item name="foregroundElementColor">#9E9E9E</item>
......
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