mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-25 12:45:12 +00:00
removed microg settings button
This commit is contained in:
parent
1d2667fb7d
commit
e008bb6c73
4 changed files with 26 additions and 57 deletions
|
@ -14,7 +14,7 @@ ext.langs = getLanguages()
|
|||
|
||||
android {
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.2"
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.vanced.manager"
|
||||
|
@ -113,18 +113,18 @@ dependencies {
|
|||
|
||||
// AndroidX
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.browser:browser:1.2.0'
|
||||
implementation 'androidx.browser:browser:1.3.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'androidx.core:core-ktx:1.3.2'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.2.5'
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-core-ktx:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
||||
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.1'
|
||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2'
|
||||
implementation 'androidx.navigation:navigation-ui-ktx:2.3.2'
|
||||
implementation 'androidx.preference:preference-ktx:1.1.1'
|
||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.3.0-alpha03'
|
||||
implementation 'com.google.android.material:material:1.3.0-alpha04'
|
||||
|
||||
// JSON parser
|
||||
implementation 'com.beust:klaxon:5.4'
|
||||
|
|
|
@ -46,11 +46,6 @@ class AppListAdapter(
|
|||
dataModel?.appPkg?.let { it1 -> viewModel.uninstallPackage(it1) }
|
||||
}
|
||||
appUninstall.isVisible = dataModel?.isAppInstalled?.value == true
|
||||
appSettings.setOnClickListener {
|
||||
viewModel.openMicrogSettings()
|
||||
}
|
||||
appSettings.isVisible =
|
||||
apps[position] == context.getString(R.string.microg) && dataModel?.isAppInstalled?.value == true
|
||||
dataModel?.versionName?.observe(this@AppListAdapter.lifecycleOwner) {
|
||||
appRemoteVersion.text = it
|
||||
}
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
package com.vanced.manager.ui.viewmodels
|
||||
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
import androidx.databinding.ObservableField
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.lifecycle.ViewModel
|
||||
|
@ -60,20 +56,6 @@ open class HomeViewModel(private val activity: FragmentActivity): ViewModel() {
|
|||
|
||||
private val microgToast = Toast.makeText(activity, R.string.no_microg, Toast.LENGTH_LONG)
|
||||
|
||||
fun openMicrogSettings() {
|
||||
try {
|
||||
val intent = Intent()
|
||||
intent.component = ComponentName(
|
||||
"com.mgoogle.android.gms",
|
||||
"org.microg.gms.ui.SettingsActivity"
|
||||
)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
startActivity(activity, intent, null)
|
||||
} catch (e: ActivityNotFoundException) {
|
||||
Toast.makeText(activity, "Error", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
fun openUrl(url: String) {
|
||||
val color: Int =
|
||||
when (url) {
|
||||
|
|
|
@ -48,17 +48,6 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/app_install_button"
|
||||
app:tint="?colorLinkImage" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/app_settings"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:background="@android:color/transparent"
|
||||
android:src="@drawable/ic_app_settings_black_24dp"
|
||||
app:layout_constraintEnd_toStartOf="@id/app_uninstall"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_install_button"
|
||||
app:tint="?colorLinkImage" />
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/app_remote_version_container"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -80,25 +69,28 @@
|
|||
android:layout_marginStart="4dp" />
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/app_installed_version_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:flexWrap="wrap"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/app_install_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_remote_version_container">
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@+id/app_installed_version_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:flexWrap="wrap"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/app_install_button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/app_remote_version_container">
|
||||
|
||||
<TextView
|
||||
style="@style/AppVersionText"
|
||||
android:text="@string/version_installed" />
|
||||
<TextView
|
||||
style="@style/AppVersionText"
|
||||
android:text="@string/version_installed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_installed_version"
|
||||
style="@style/AppVersionText"
|
||||
android:layout_marginStart="4dp" />
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/app_installed_version"
|
||||
style="@style/AppVersionText"
|
||||
android:layout_marginStart="4dp" />
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
Loading…
Reference in a new issue