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.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
android:launchMode="singleInstance"
|
||||
android:excludeFromRecents="true"
|
||||
android:taskAffinity=""
|
||||
android:theme="@style/PopupTheme.QuickSwitch">
|
||||
android:theme="@style/Theme.Material.Dialog">
|
||||
<intent-filter>
|
||||
<action android:name="com.github.shadowsocks.QUICK_SWITCH" />
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
|
||||
@@ -1,24 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.v7.widget.CardView
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
app:cardElevation="5dp"
|
||||
app:cardBackgroundColor="#EEEEEE">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
<include layout="@layout/toolbar_light_dark"/>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/profilesList"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include layout="@layout/toolbar_light_dark"/>
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/profilesList"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?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 @@
|
||||
</style>
|
||||
|
||||
<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="colorAccent">@color/material_accent_500</item>
|
||||
<item name="colorButtonNormal">@color/material_accent_500</item>
|
||||
@@ -16,38 +14,11 @@
|
||||
<item name="colorPrimaryDark">@color/material_accent_700</item>
|
||||
</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="colorPrimary">@color/material_accent_500</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="android:windowActionBar">false</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user