mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-23 11:45:11 +00:00
UI tests
This commit is contained in:
parent
90d8164f64
commit
f89ad86cb0
4 changed files with 9 additions and 6 deletions
|
@ -81,12 +81,12 @@ class MicrogDownloadService: Service() {
|
||||||
if (intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) == downloadId) {
|
if (intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) == downloadId) {
|
||||||
//prefs?.edit()?.putBoolean("isMicrogDownloading", false)?.apply()
|
//prefs?.edit()?.putBoolean("isMicrogDownloading", false)?.apply()
|
||||||
//cancelNotif(channel, this@MicrogDownloadService)
|
//cancelNotif(channel, this@MicrogDownloadService)
|
||||||
val bIntent = Intent(this@MicrogDownloadService, AppInstaller::class.java)
|
val mIntent = Intent()
|
||||||
bIntent.putExtra("path", "${filesDir.path}/microg.apk")
|
|
||||||
bIntent.putExtra("pkg", "com.mgoogle.android.gms")
|
|
||||||
val mIntent = Intent(HomeFragment.MICROG_DOWNLOADED)
|
|
||||||
mIntent.action = HomeFragment.MICROG_DOWNLOADED
|
mIntent.action = HomeFragment.MICROG_DOWNLOADED
|
||||||
LocalBroadcastManager.getInstance(this@MicrogDownloadService).sendBroadcast(mIntent)
|
LocalBroadcastManager.getInstance(this@MicrogDownloadService).sendBroadcast(mIntent)
|
||||||
|
val bIntent = Intent(this@MicrogDownloadService, AppInstaller::class.java)
|
||||||
|
bIntent.putExtra("path", "${getExternalFilesDir("apk")}/microg.apk")
|
||||||
|
bIntent.putExtra("pkg", "com.mgoogle.android.gms")
|
||||||
startService(bIntent)
|
startService(bIntent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ class DevSettingsFragment: PreferenceFragmentCompat() {
|
||||||
override fun onReceive(context: Context?, intent: Intent?) {
|
override fun onReceive(context: Context?, intent: Intent?) {
|
||||||
if (intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) == downloadId) {
|
if (intent?.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, -1) == downloadId) {
|
||||||
activity?.let {
|
activity?.let {
|
||||||
val apk = File("${activity?.filesDir?.path}/manager.apk")
|
val apk = File("${activity?.getExternalFilesDir("apk")}/manager.apk")
|
||||||
val uri =
|
val uri =
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||||
FileProvider.getUriForFile(activity!!, "${activity?.packageName}.provider", apk)
|
FileProvider.getUriForFile(activity!!, "${activity?.packageName}.provider", apk)
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
style="@style/ButtonStyle"
|
style="@style/ButtonStyle"
|
||||||
android:text="@{viewModel.vancedInstallButtonTxt}"
|
android:text="@{viewModel.vancedInstallButtonTxt}"
|
||||||
android:textColor="@{viewModel.shouldBeDisabled ? @color/LightGray : @color/White}"
|
android:textColor="@{viewModel.shouldBeDisabled ? @color/LightGray : @color/White}"
|
||||||
android:backgroundTint="@{viewModel.shouldBeDisabled ? @color/Gray : @color/Accent}"
|
android:backgroundTint="@{viewModel.shouldBeDisabled ? @drawable/Gray : @drawable/Accent}"
|
||||||
app:icon="@{viewModel.vancedInstallButtonIcon}"
|
app:icon="@{viewModel.vancedInstallButtonIcon}"
|
||||||
android:clickable="@{!viewModel.shouldBeDisabled}"
|
android:clickable="@{!viewModel.shouldBeDisabled}"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -16,4 +16,7 @@
|
||||||
|
|
||||||
<color name="Accent">?attr/colorPrimary</color>
|
<color name="Accent">?attr/colorPrimary</color>
|
||||||
|
|
||||||
|
<drawable name="Accent">?attr/colorPrimary</drawable>
|
||||||
|
<drawable name="Gray">@color/Gray</drawable>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue