Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
HopeBaron 2020-04-10 17:11:28 +03:00
commit d7fc5cb46f
11 changed files with 63 additions and 100 deletions

View File

@ -0,0 +1,10 @@
<component name="ProjectDictionaryState">
<dictionary name="Xinto">
<words>
<w>installbtn</w>
<w>microg</w>
<w>semibold</w>
<w>vanced</w>
</words>
</dictionary>
</component>

View File

@ -5,19 +5,19 @@ Hi, my name is Steve Cock, I'm the main UI designer for the upcoming Vanced Mana
No one really thought there would be problems with this format, because installation was pretty simple, at least that's what xfile thought...
## Problems with .apks format
Main problems with new format were either with device CPU architecture or MemeUI shit with MiUI optimisations. We wrote instructions for VancedHelper but no one used it for troubleshooting. Then some users complained about new format and refused to upgrade to newest version (We don't give a fuck about that) because "I dOn'T WaNT To HaVe OnE MoRE apP To insTalL VanCeD" so we decided to make an installer for vanced
Main problems with new format were either with device CPU architecture or MemeUI shit with MiUI optimisations. We wrote instructions for VancedHelper but no one used it for troubleshooting. Then some users complained about new format and refused to upgrade to newest version (We don't give a fuck about that) because "I dOn'T WaNT To HaVe OnE MoRE apP To insTalL VanCeD" so we decided to make an installer for Vanced
# Vanced Manager
Ladies and gentlemen, I'm very proud to introduce the new **Vanced Manager ci Alpha Ui Preview Test Build 0.1.9™** which doesn't fucking work at the tme because of shit material UI problems and i have no idea ho-
So... Vanced Manager is an universal utility for installing/updating Vanced and MicroG. It will push notifications once the update is ready and for root users, it can also automatically download and install them (Now that's pwetty epic).
Vanced manager comes with a slick UI ~~that was stolen from the new Magisk Manager (I'm very sorry john but i looked your code for about 100 times).~~ Actually, while UI may look very similar to new Magisk Manager's UI, It's still very different (that's a blatant lie, I know).
Ladies and gentlemen, I'm very proud to introduce the new **Vanced Manager ci Alpha Ui Preview Test Build 0.1.9™** which only has a UI at the time lol
Vanced Manager is an universal utility for installing/updating Vanced and MicroG. It will push notifications once the update is ready and for root users, it can also automatically download and install them (Now that's pwetty epic).
Vanced manager comes with a slick UI ~~that was stolen from the new Magisk Manager (I'm very sorry John but I looked your code for about 100 times).~~ Actually, while UI may look very similar to new Magisk Manager's UI, It's still very different (that's a blatant lie, I know).
##### I'll probably forget this later so I should put a comment here saying that we should put some screenshots from manager once the UI is ready because why not
## Credits
Vanced Manager developers:
### Vanced Manager developers:
- MrDodojo (API)
- Hope (API Implementation)
- Hope (API Implementation into the app)
- moosd (Installer)
- X1nto (UI, animations and basic functionality (Hope helped me alot tho))
### And of course Vanced Team
- X1nto (UI, animations and basic functionality (Hope helped me a lot tho))
### And of course The Vanced Team:
- xfileFIN
![xfileFIN](https://i.imgur.com/hLdzTVq.png)
- KevinX8

View File

@ -9,7 +9,8 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true">
android:supportsRtl="true"
android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar">
<activity
android:name=".SplashScreenActivity"
@ -24,15 +25,13 @@
<activity
android:name=".ui.MainActivity"
android:label="@string/app_name"
android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar">
android:label="@string/app_name">
</activity>
<activity
android:name=".ui.AboutActivity"
android:parentActivityName=".ui.MainActivity"
android:label="@string/app_name"
android:theme="@style/Theme.MaterialComponents.DayNight.NoActionBar">
android:label="@string/app_name">
</activity>
<meta-data

View File

@ -25,21 +25,6 @@ class HomeFragment : Fragment() {
savedInstanceState: Bundle?
): View? {
val homefragment = inflater.inflate(R.layout.fragment_home, container, false)
val toolbar = view?.findViewById<Toolbar>(R.id.home_toolbar)
toolbar?.title = "Home"
toolbar?.inflateMenu(R.menu.toolbar_menu)
toolbar?.setOnMenuItemClickListener {
if (it.itemId == R.id.about) {
val intent = Intent()
intent.component = ComponentName(
"com.vanced.manager",
"com.vanced.manager.ui.AboutActivity"
)
startActivity(intent)
}
true
}
return homefragment

View File

@ -1,61 +1,30 @@
package com.vanced.manager
import android.content.ComponentName
import android.content.Intent
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.widget.Toolbar
import androidx.preference.ListPreference
import androidx.preference.PreferenceFragmentCompat
import com.vanced.manager.ui.MainActivity
class SettingsFragment : PreferenceFragmentCompat() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val settingsfragment = inflater.inflate(R.layout.fragment_home, container, false)
val toolbar = view?.findViewById<Toolbar>(R.id.home_toolbar)
toolbar?.title = "Settings"
toolbar?.inflateMenu(R.menu.toolbar_menu)
toolbar?.setOnMenuItemClickListener {
if (it.itemId == R.id.about) {
val intent = Intent()
intent.component = ComponentName(
"com.vanced.manager",
"com.vanced.manager.ui.AboutActivity"
)
startActivity(intent)
}
true
}
return settingsfragment
}
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.preferences, rootKey)
(activity as MainActivity).supportActionBar?.title = getString(R.string.settings)
val themeSwitch: ListPreference? = findPreference("theme_modes")
themeSwitch?.setOnPreferenceChangeListener { _, _ ->
val currentVal: String = themeSwitch.value
when (currentVal.toInt()){
0 -> {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
activity?.recreate()
}
1 -> {
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
activity?.recreate()
}
else ->{
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
activity?.recreate()
}
}
true

View File

@ -1,31 +1,40 @@
package com.vanced.manager.ui
import android.content.Intent
import android.content.res.Configuration
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import androidx.appcompat.app.AlertDialog
import com.google.android.material.bottomnavigation.BottomNavigationView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.widget.Toolbar
import androidx.fragment.app.FragmentTransaction
import com.vanced.manager.HomeFragment
import com.vanced.manager.R
import com.vanced.manager.SettingsFragment
import androidx.preference.ListPreference
import androidx.preference.PreferenceFragmentCompat
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
lateinit var homeFragment: HomeFragment
lateinit var settingsFragment: SettingsFragment
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.getDefaultNightMode())
super.onCreate(null)
setContentView(R.layout.activity_main)
setSupportActionBar(toolbar)
supportActionBar?.title = getString(R.string.title_home)
val prefs = getSharedPreferences("prefs", MODE_PRIVATE)
val firstStart = prefs.getBoolean("firstStart", true)
if (firstStart) {
showGayDialog()
showSecurityDialog()
}
val navView : BottomNavigationView = findViewById(R.id.bottom_nav)
@ -67,11 +76,27 @@ class MainActivity : AppCompatActivity() {
false
}
}
private fun showGayDialog() {
val clientList = arrayOf("Newpipe", "Vanced")
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.toolbar_menu, menu)
return super .onCreateOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
R.id.about -> {
val intent = Intent(this, AboutActivity::class.java)
startActivity(intent)
true
}
else -> {
super.onOptionsItemSelected(item)
}
}
private fun showSecurityDialog() {
AlertDialog.Builder(this)
.setTitle("Welcome!")
.setMessage("Just letting you know that NewPipe > Vanced, amirite ladies and gals? up top!\nIf you use Vanced you are fooking gae")
.setMessage("Before we implement a proper security system to check whether app was modified or not, please be sure that you downloaded manager from vanced.app/github")
.setPositiveButton("close"
) { dialog, which -> dialog.dismiss() }
.create().show()

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"

View File

@ -7,7 +7,7 @@
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/home_toolbar"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.Toolbar
android:id="@+id/home_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/rectangle_2"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/ic_info_black_24dp"
android:backgroundTint="#ffffff"
android:layout_gravity="end"
android:layout_marginEnd="@dimen/eightdp"/>
</androidx.appcompat.widget.Toolbar>
</LinearLayout>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="DarkMode" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<style name="MainTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">#1490D7</item>
<item name="colorPrimaryVariant">#804EAFF5</item>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LightMode" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<style name="MainTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">#1490D7</item>
<item name="colorPrimaryVariant">#2C7EB9</item>