Commit 25cfb162 authored by Mygod's avatar Mygod

Remove all the extravagant styles

These styles are either introduced by @AnyOfYou, or exist because of a bug in Android support library. Anyway they can be removed now.
parent c9ce515c
...@@ -31,7 +31,6 @@ resolvers += Resolver.jcenterRepo ...@@ -31,7 +31,6 @@ resolvers += Resolver.jcenterRepo
useSupportVectors useSupportVectors
libraryDependencies ++= Seq( libraryDependencies ++= Seq(
"com.android.support" % "cardview-v7" % "24.2.0",
"com.android.support" % "design" % "24.2.0", "com.android.support" % "design" % "24.2.0",
"com.android.support" % "gridlayout-v7" % "24.2.0", "com.android.support" % "gridlayout-v7" % "24.2.0",
"com.github.clans" % "fab" % "1.6.4", "com.github.clans" % "fab" % "1.6.4",
......
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:excludeFromRecents="true" android:excludeFromRecents="true"
android:taskAffinity="" android:taskAffinity=""
android:theme="@style/PopupTheme.QuickSwitch"> android:theme="@style/Theme.Material.Dialog">
<intent-filter> <intent-filter>
<action android:name="com.github.shadowsocks.QUICK_SWITCH" /> <action android:name="com.github.shadowsocks.QUICK_SWITCH" />
<category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.DEFAULT"/>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_margin="8dp" android:layout_height="wrap_content">
android:layout_gravity="center_vertical"
app:cardElevation="5dp"
app:cardBackgroundColor="#EEEEEE">
<LinearLayout <include layout="@layout/toolbar_light_dark"/>
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<include layout="@layout/toolbar_light_dark"/>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/profilesList" android:id="@+id/profilesList"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"/>
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Material.Dialog" parent="Theme.Material.DialogBase"/>
<style name="Theme.Material.Dialog.Alert" parent="Theme.Material.Dialog.AlertBase"/>
</resources>
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
</style> </style>
<style name="Theme.Material" parent="Theme.AppCompat.Light.NoActionBar"> <style name="Theme.Material" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:alertDialogTheme">@style/Theme.Material.Dialog.Alert</item>
<item name="android:dialogTheme">@style/Theme.Material.Dialog</item>
<item name="android:navigationBarColor">@color/material_accent_700</item> <item name="android:navigationBarColor">@color/material_accent_700</item>
<item name="colorAccent">@color/material_accent_500</item> <item name="colorAccent">@color/material_accent_500</item>
<item name="colorButtonNormal">@color/material_accent_500</item> <item name="colorButtonNormal">@color/material_accent_500</item>
...@@ -16,38 +14,11 @@ ...@@ -16,38 +14,11 @@
<item name="colorPrimaryDark">@color/material_accent_700</item> <item name="colorPrimaryDark">@color/material_accent_700</item>
</style> </style>
<style name="Theme.Material.DialogBase" parent="Theme.AppCompat.Light.Dialog"> <style name="Theme.Material.Dialog" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/material_accent_500</item> <item name="colorAccent">@color/material_accent_500</item>
<item name="colorPrimary">@color/material_accent_500</item> <item name="colorPrimary">@color/material_accent_500</item>
<item name="colorPrimaryDark">@color/material_accent_700</item> <item name="colorPrimaryDark">@color/material_accent_700</item>
</style>
<style name="Theme.Material.Dialog.AlertBase" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">@color/material_accent_500</item>
<item name="colorPrimary">@color/material_accent_500</item>
<item name="colorPrimaryDark">@color/material_accent_700</item>
</style>
<style name="Theme.Material.Dialog" parent="Theme.Material.DialogBase">
<item name="android:windowBackground">@android:color/transparent</item>
</style>
<style name="Theme.Material.Dialog.Alert" parent="Theme.Material.Dialog.AlertBase">
<item name="android:windowBackground">@android:color/transparent</item>
</style>
<style name="PopupTheme" parent="Theme.Material.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowSoftInputMode">stateAlwaysHidden</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
<style name="PopupTheme.QuickSwitch" parent="PopupTheme">
<item name="windowNoTitle">true</item> <item name="windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
</style> </style>
</resources> </resources>
...@@ -3,7 +3,6 @@ package com.github.shadowsocks.preferences ...@@ -3,7 +3,6 @@ package com.github.shadowsocks.preferences
import android.app.AlertDialog import android.app.AlertDialog
import android.content.{Context, DialogInterface} import android.content.{Context, DialogInterface}
import android.util.AttributeSet import android.util.AttributeSet
import android.view.ViewGroup
import eu.chainfire.libsuperuser.Shell import eu.chainfire.libsuperuser.Shell
import scala.collection.JavaConversions._ import scala.collection.JavaConversions._
...@@ -14,27 +13,21 @@ import scala.collection.JavaConversions._ ...@@ -14,27 +13,21 @@ import scala.collection.JavaConversions._
class KcpCliPreference(context: Context, attrs: AttributeSet) extends SummaryEditTextPreference(context, attrs) { class KcpCliPreference(context: Context, attrs: AttributeSet) extends SummaryEditTextPreference(context, attrs) {
override def onPrepareDialogBuilder(builder: AlertDialog.Builder) { override def onPrepareDialogBuilder(builder: AlertDialog.Builder) {
super.onPrepareDialogBuilder(builder) super.onPrepareDialogBuilder(builder)
builder.setNeutralButton("?", ((_, _) => { builder.setNeutralButton("?", ((_, _) => new AlertDialog.Builder(context)
val dialog = new AlertDialog.Builder(context) .setTitle("?")
.setTitle("?") .setMessage(asScalaBuffer(Shell.SH.run(context.getApplicationInfo.dataDir + "/kcptun --help"))
.setMessage(asScalaBuffer(Shell.SH.run(context.getApplicationInfo.dataDir + "/kcptun --help")) .dropWhile(line => line != "GLOBAL OPTIONS:")
.dropWhile(line => line != "GLOBAL OPTIONS:") .drop(1)
.drop(1) .takeWhile(line => line.length() > 3)
.takeWhile(line => line.length() > 3) .filter(line =>
.filter(line => !line.startsWith(" --localaddr ") &&
!line.startsWith(" --localaddr ") && !line.startsWith(" --remoteaddr ") &&
!line.startsWith(" --remoteaddr ") && !line.startsWith(" --path ") &&
!line.startsWith(" --path ") && !line.startsWith(" --help,") &&
!line.startsWith(" --help,") && !line.startsWith(" --version,"))
!line.startsWith(" --version,")) .mkString("\n")
.mkString("\n") .replaceAll("[ ]{2,}", "\n")
.replaceAll("[ ]{2,}", "\n") .substring(1)) // remove 1st \n
.substring(1)) // remove 1st \n .show()): DialogInterface.OnClickListener)
.show()
val window = dialog.getWindow
val attrs = window.getAttributes
attrs.width = ViewGroup.LayoutParams.MATCH_PARENT
window.setAttributes(attrs)
}): DialogInterface.OnClickListener)
} }
} }
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