fixed missing dependencies

This commit is contained in:
X1nto 2020-07-29 09:47:50 +04:00
parent d5ec9f8e7b
commit 7cf14ca401
13 changed files with 16 additions and 88 deletions

View File

@ -42,8 +42,14 @@ dependencies {
implementation "androidx.appcompat:appcompat:$appcompatVersion"
implementation "androidx.mediarouter:mediarouter:$mediarouterVersion"
implementation "androidx.preference:preference:$preferenceVersion"
implementation "androidx.navigation:navigation-fragment:$navigationVersion"
implementation "androidx.navigation:navigation-ui:$navigationVersion"
implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"
implementation "androidx.lifecycle:lifecycle-service:$lifecycleVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
}
android {

View File

@ -11,8 +11,8 @@ import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import com.google.android.gms.R
import com.google.android.gms.databinding.DeviceRegistrationFragmentBinding
import com.mgoogle.android.gms.R
import com.mgoogle.android.gms.databinding.DeviceRegistrationFragmentBinding
import org.microg.gms.checkin.CheckinPrefs
class DeviceRegistrationFragment : Fragment(R.layout.device_registration_fragment) {

View File

@ -11,7 +11,7 @@ import android.text.format.DateUtils
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import com.google.android.gms.R
import com.mgoogle.android.gms.R
import org.microg.gms.checkin.CheckinPrefs
import org.microg.gms.checkin.LastCheckinInfo

View File

@ -14,7 +14,7 @@ import androidx.navigation.fragment.findNavController
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import com.google.android.gms.R
import com.mgoogle.android.gms.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.microg.gms.gcm.GcmDatabase

View File

@ -17,8 +17,8 @@ import androidx.appcompat.content.res.AppCompatResources
import androidx.fragment.app.Fragment
import androidx.fragment.app.findFragment
import androidx.lifecycle.lifecycleScope
import com.google.android.gms.R
import com.google.android.gms.databinding.PushNotificationAppFragmentBinding
import com.mgoogle.android.gms.R
import com.mgoogle.android.gms.databinding.PushNotificationAppFragmentBinding
class PushNotificationAppFragment : Fragment(R.layout.push_notification_fragment) {

View File

@ -13,7 +13,7 @@ import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.TwoStatePreference
import com.google.android.gms.R
import com.mgoogle.android.gms.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.microg.gms.gcm.GcmDatabase

View File

@ -9,8 +9,8 @@ import android.view.*
import androidx.fragment.app.Fragment
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import com.google.android.gms.R
import com.google.android.gms.databinding.PushNotificationFragmentBinding
import com.mgoogle.android.gms.R
import com.mgoogle.android.gms.databinding.PushNotificationFragmentBinding
import org.microg.gms.checkin.CheckinPrefs
import org.microg.gms.gcm.GcmPrefs

View File

@ -14,7 +14,7 @@ import androidx.navigation.fragment.findNavController
import androidx.preference.Preference
import androidx.preference.PreferenceCategory
import androidx.preference.PreferenceFragmentCompat
import com.google.android.gms.R
import com.mgoogle.android.gms.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.microg.gms.gcm.GcmDatabase

View File

@ -1,61 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.ui
import android.os.Bundle
import android.view.*
import androidx.fragment.app.Fragment
import androidx.navigation.fragment.findNavController
import com.google.android.gms.R
import com.google.android.gms.databinding.SafetyNetFragmentBinding
import org.microg.gms.checkin.CheckinPrefs
import org.microg.gms.snet.SafetyNetPrefs
class SafetyNetFragment : Fragment(R.layout.safety_net_fragment) {
private lateinit var binding: SafetyNetFragmentBinding
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
binding = SafetyNetFragmentBinding.inflate(inflater, container, false)
binding.switchBarCallback = object : PreferenceSwitchBarCallback {
override fun onChecked(newStatus: Boolean) {
SafetyNetPrefs.get(requireContext()).isEnabled = newStatus
binding.safetynetEnabled = newStatus
}
}
return binding.root
}
override fun onResume() {
super.onResume()
binding.checkinEnabled = CheckinPrefs.get(requireContext()).isEnabled
binding.safetynetEnabled = SafetyNetPrefs.get(requireContext()).isEnabled
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
setHasOptionsMenu(true)
}
override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) {
menu.add(0, MENU_ADVANCED, 0, R.string.menu_advanced)
super.onCreateOptionsMenu(menu, inflater)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
MENU_ADVANCED -> {
findNavController().navigate(R.id.openSafetyNetAdvancedSettings)
true
}
else -> super.onOptionsItemSelected(item)
}
}
companion object {
private const val MENU_ADVANCED = Menu.FIRST
}
}

View File

@ -1,17 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
package org.microg.gms.ui
import android.os.Bundle
import androidx.preference.PreferenceFragmentCompat
import com.google.android.gms.R
class SafetyNetPreferencesFragment : PreferenceFragmentCompat() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.preferences_safetynet)
}
}