Commit 582a6e44 authored by Mygod's avatar Mygod

Revert "Donwload fonts through support library. #1515"

This reverts commit 6c89207e.
parent 6c89207e
...@@ -34,6 +34,9 @@ ...@@ -34,6 +34,9 @@
android:value="@integer/google_play_services_version"/> android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.google.android.backup.api_key" <meta-data android:name="com.google.android.backup.api_key"
android:value="AEdPqrEAAAAI_zVxZthz2HDuz9toTvkYvL0L5GA-OjeUIfBeXg"/> android:value="AEdPqrEAAAAI_zVxZthz2HDuz9toTvkYvL0L5GA-OjeUIfBeXg"/>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts"/>
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
......
...@@ -24,7 +24,6 @@ import android.app.Activity ...@@ -24,7 +24,6 @@ import android.app.Activity
import android.app.backup.BackupManager import android.app.backup.BackupManager
import android.content.ActivityNotFoundException import android.content.ActivityNotFoundException
import android.content.Intent import android.content.Intent
import android.graphics.Typeface
import android.net.Uri import android.net.Uri
import android.net.VpnService import android.net.VpnService
import android.nfc.NdefMessage import android.nfc.NdefMessage
...@@ -34,7 +33,6 @@ import android.os.SystemClock ...@@ -34,7 +33,6 @@ import android.os.SystemClock
import android.support.customtabs.CustomTabsIntent import android.support.customtabs.CustomTabsIntent
import android.support.design.widget.Snackbar import android.support.design.widget.Snackbar
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.support.v4.content.res.ResourcesCompat
import android.support.v7.app.AlertDialog import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import android.support.v7.content.res.AppCompatResources import android.support.v7.content.res.AppCompatResources
...@@ -215,7 +213,6 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe ...@@ -215,7 +213,6 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.layout_main) setContentView(R.layout.layout_main)
val drawerBuilder = DrawerBuilder() val drawerBuilder = DrawerBuilder()
.withActivity(this) .withActivity(this)
.withTranslucentStatusBar(true) .withTranslucentStatusBar(true)
...@@ -276,12 +273,6 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe ...@@ -276,12 +273,6 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, Drawe
}) })
} else drawer = drawerBuilder.build() } else drawer = drawerBuilder.build()
val drawerTitle = drawer.getHeader().findViewById<TextView>(R.id.drawer_title)
ResourcesCompat.getFont(this, R.font.iceland, object : ResourcesCompat.FontCallback() {
override fun onFontRetrievalFailed(reason: Int) {} // Do nothing
override fun onFontRetrieved(typeface: Typeface) { drawerTitle.setTypeface(typeface) }
}, null)
if (savedInstanceState == null) displayFragment(ProfilesFragment()) if (savedInstanceState == null) displayFragment(ProfilesFragment())
previousSelectedDrawer = drawer.currentSelection previousSelectedDrawer = drawer.currentSelection
statusText = findViewById(R.id.status) statusText = findViewById(R.id.status)
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android" <font-family xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:fontProviderAuthority="com.google.android.gms.fonts" app:fontProviderAuthority="com.google.android.gms.fonts"
app:fontProviderPackage="com.google.android.gms" app:fontProviderPackage="com.google.android.gms"
app:fontProviderQuery="Iceland" app:fontProviderQuery="Iceland"
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs" app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
android:fontProviderAuthority="com.google.android.gms.fonts" </font-family>
android:fontProviderPackage="com.google.android.gms"
android:fontProviderQuery="Iceland"
android:fontProviderCerts="@array/com_google_android_gms_fonts_certs" />
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:fontFamily="@font/iceland"
android:gravity="center" android:gravity="center"
android:text="shadowsocks" android:text="shadowsocks"
android:textColor="@android:color/white" android:textColor="@android:color/white"
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<array name="preloaded_fonts" translatable="false">
<item>@font/iceland</item>
</array>
</resources>
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