Commit f8ddea3f authored by Mygod's avatar Mygod

Fix build

parent 20a7fece
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<lint> <lint>
<issue id="InvalidPackage"> <!-- Check is buggy: https://issuetracker.google.com/issues/112159117 -->
<ignore regexp="ormlite-core" /> <issue id="AppCompatResource" severity="ignore" />
</issue>
<issue id="ImpliedQuantity" severity="warning" /> <issue id="ImpliedQuantity" severity="warning" />
<issue id="ExtraTranslation" severity="warning" /> <issue id="ExtraTranslation" severity="warning" />
<issue id="MissingDefaultResource" severity="warning" /> <issue id="MissingDefaultResource" severity="warning" />
......
...@@ -34,7 +34,6 @@ import android.os.Bundle ...@@ -34,7 +34,6 @@ import android.os.Bundle
import android.os.SystemClock import android.os.SystemClock
import android.text.format.Formatter import android.text.format.Formatter
import android.util.Log import android.util.Log
import android.view.Gravity
import android.view.MenuItem import android.view.MenuItem
import android.view.View import android.view.View
import android.widget.TextView import android.widget.TextView
...@@ -45,6 +44,7 @@ import androidx.browser.customtabs.CustomTabsIntent ...@@ -45,6 +44,7 @@ import androidx.browser.customtabs.CustomTabsIntent
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.core.content.getSystemService import androidx.core.content.getSystemService
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout import androidx.drawerlayout.widget.DrawerLayout
import androidx.preference.PreferenceDataStore import androidx.preference.PreferenceDataStore
import com.crashlytics.android.Crashlytics import com.crashlytics.android.Crashlytics
...@@ -342,7 +342,7 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, OnPre ...@@ -342,7 +342,7 @@ class MainActivity : AppCompatActivity(), ShadowsocksConnection.Interface, OnPre
} }
override fun onBackPressed() { override fun onBackPressed() {
if (drawer.isDrawerOpen(Gravity.START)) drawer.closeDrawers() else { if (drawer.isDrawerOpen(GravityCompat.START)) drawer.closeDrawers() else {
val currentFragment = supportFragmentManager.findFragmentById(R.id.fragment_holder) as ToolbarFragment val currentFragment = supportFragmentManager.findFragmentById(R.id.fragment_holder) as ToolbarFragment
if (!currentFragment.onBackPressed()) { if (!currentFragment.onBackPressed()) {
if (currentFragment is ProfilesFragment) super.onBackPressed() else { if (currentFragment is ProfilesFragment) super.onBackPressed() else {
......
...@@ -21,9 +21,9 @@ ...@@ -21,9 +21,9 @@
package com.github.shadowsocks package com.github.shadowsocks
import android.os.Bundle import android.os.Bundle
import android.view.Gravity
import android.view.View import android.view.View
import androidx.appcompat.widget.Toolbar import androidx.appcompat.widget.Toolbar
import androidx.core.view.GravityCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
/** /**
...@@ -36,7 +36,7 @@ open class ToolbarFragment : Fragment() { ...@@ -36,7 +36,7 @@ open class ToolbarFragment : Fragment() {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
toolbar = view.findViewById(R.id.toolbar) toolbar = view.findViewById(R.id.toolbar)
toolbar.setNavigationIcon(R.drawable.ic_navigation_menu) toolbar.setNavigationIcon(R.drawable.ic_navigation_menu)
toolbar.setNavigationOnClickListener { (activity as MainActivity).drawer.openDrawer(Gravity.START) } toolbar.setNavigationOnClickListener { (activity as MainActivity).drawer.openDrawer(GravityCompat.START) }
} }
open fun onTrafficUpdated(profileId: Long, txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long) { } open fun onTrafficUpdated(profileId: Long, txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long) { }
......
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