diff --git a/build.sbt b/build.sbt index 9cdd60a1..460fe606 100644 --- a/build.sbt +++ b/build.sbt @@ -31,7 +31,6 @@ resolvers += Resolver.jcenterRepo useSupportVectors libraryDependencies ++= Seq( - "com.android.support" % "cardview-v7" % "24.2.0", "com.android.support" % "design" % "24.2.0", "com.android.support" % "gridlayout-v7" % "24.2.0", "com.github.clans" % "fab" % "1.6.4", diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 65bf5e09..7f3931b4 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -109,7 +109,7 @@ android:launchMode="singleInstance" android:excludeFromRecents="true" android:taskAffinity="" - android:theme="@style/PopupTheme.QuickSwitch"> + android:theme="@style/Theme.Material.Dialog"> diff --git a/src/main/res/layout/layout_quick_switch.xml b/src/main/res/layout/layout_quick_switch.xml index 954a7e56..9142aff5 100644 --- a/src/main/res/layout/layout_quick_switch.xml +++ b/src/main/res/layout/layout_quick_switch.xml @@ -1,24 +1,14 @@ - + android:layout_height="wrap_content"> - + + - - - - - - + android:layout_height="wrap_content"/> + diff --git a/src/main/res/values-v21/styles.xml b/src/main/res/values-v21/styles.xml deleted file mode 100644 index 3d6dc203..00000000 --- a/src/main/res/values-v21/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/src/main/scala/com/github/shadowsocks/preferences/KcpCliPreference.scala b/src/main/scala/com/github/shadowsocks/preferences/KcpCliPreference.scala index a97b089b..79354bb9 100644 --- a/src/main/scala/com/github/shadowsocks/preferences/KcpCliPreference.scala +++ b/src/main/scala/com/github/shadowsocks/preferences/KcpCliPreference.scala @@ -3,7 +3,6 @@ package com.github.shadowsocks.preferences import android.app.AlertDialog import android.content.{Context, DialogInterface} import android.util.AttributeSet -import android.view.ViewGroup import eu.chainfire.libsuperuser.Shell import scala.collection.JavaConversions._ @@ -14,27 +13,21 @@ import scala.collection.JavaConversions._ class KcpCliPreference(context: Context, attrs: AttributeSet) extends SummaryEditTextPreference(context, attrs) { override def onPrepareDialogBuilder(builder: AlertDialog.Builder) { super.onPrepareDialogBuilder(builder) - builder.setNeutralButton("?", ((_, _) => { - val dialog = new AlertDialog.Builder(context) - .setTitle("?") - .setMessage(asScalaBuffer(Shell.SH.run(context.getApplicationInfo.dataDir + "/kcptun --help")) - .dropWhile(line => line != "GLOBAL OPTIONS:") - .drop(1) - .takeWhile(line => line.length() > 3) - .filter(line => - !line.startsWith(" --localaddr ") && - !line.startsWith(" --remoteaddr ") && - !line.startsWith(" --path ") && - !line.startsWith(" --help,") && - !line.startsWith(" --version,")) - .mkString("\n") - .replaceAll("[ ]{2,}", "\n") - .substring(1)) // remove 1st \n - .show() - val window = dialog.getWindow - val attrs = window.getAttributes - attrs.width = ViewGroup.LayoutParams.MATCH_PARENT - window.setAttributes(attrs) - }): DialogInterface.OnClickListener) + builder.setNeutralButton("?", ((_, _) => new AlertDialog.Builder(context) + .setTitle("?") + .setMessage(asScalaBuffer(Shell.SH.run(context.getApplicationInfo.dataDir + "/kcptun --help")) + .dropWhile(line => line != "GLOBAL OPTIONS:") + .drop(1) + .takeWhile(line => line.length() > 3) + .filter(line => + !line.startsWith(" --localaddr ") && + !line.startsWith(" --remoteaddr ") && + !line.startsWith(" --path ") && + !line.startsWith(" --help,") && + !line.startsWith(" --version,")) + .mkString("\n") + .replaceAll("[ ]{2,}", "\n") + .substring(1)) // remove 1st \n + .show()): DialogInterface.OnClickListener) } }