0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-15 23:35:06 +00:00

UI update

This commit is contained in:
X1nto 2020-03-18 22:10:54 +04:00
parent 2b031033b7
commit 85a0892098
12 changed files with 240 additions and 182 deletions

1
.idea/.name Normal file
View file

@ -0,0 +1 @@
Vanced Manager

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RenderSettings">
<option name="quality" value="0.0" />
</component>
</project>

View file

@ -42,15 +42,18 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.fragment:fragment-ktx:1.2.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.0.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.0.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.navigation:navigation-fragment:2.2.1'
implementation 'androidx.navigation:navigation-ui:2.2.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

View file

@ -0,0 +1,23 @@
package com.vanced.manager
import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
/**
* A simple [Fragment] subclass.
*/
class HomeFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.fragment_home, container, false)
}
}

View file

@ -3,24 +3,45 @@ package com.vanced.manager
import android.os.Bundle
import com.google.android.material.bottomnavigation.BottomNavigationView
import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentTransaction
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
class MainActivity : AppCompatActivity() {
lateinit var homeFragment: HomeFragment
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val navView: BottomNavigationView = findViewById(R.id.navigation_home)
val navController = findNavController(R.id.mobile_navigation)
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
val appBarConfiguration = AppBarConfiguration(setOf(
R.id.navigation_home))
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
val navView : BottomNavigationView = findViewById(R.id.bottom_nav)
homeFragment = HomeFragment()
supportFragmentManager
.beginTransaction()
.replace(R.id.frame_layout, homeFragment)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit()
navView.setOnNavigationItemSelectedListener { item ->
when (item.itemId) {
R.id.home -> {
homeFragment = HomeFragment()
supportFragmentManager
.beginTransaction()
.replace(R.id.frame_layout, homeFragment)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit()
}
}
true
}
}
}

View file

@ -22,7 +22,7 @@ class HomeFragment : Fragment() {
homeViewModel =
ViewModelProviders.of(this).get(HomeViewModel::class.java)
val root = inflater.inflate(R.layout.fragment_home, container, false)
val textView: TextView = root.findViewById(R.id.text_home)
val textView: TextView = root.findViewById(R.id.Home)
homeViewModel.text.observe(viewLifecycleOwner, Observer {
textView.text = it
})

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"
<RelativeLayout
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:id="@+id/container"
@ -8,160 +9,22 @@
android:paddingTop="?attr/actionBarSize">
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/bottom_nav"
android:layout_width="match_parent"
android:layout_height="63dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="@menu/bottom_nav_menu" />
app:menu="@menu/bottom_nav_menu"
/>
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginBottom="620dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/rectangle_2" />
<FrameLayout
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/bottom_nav"
android:background="@color/white">
<TextView
android:id="@+id/Home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/exo_bold"
android:text="@string/home"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="@+id/imageView"
app:layout_constraintEnd_toEndOf="@+id/imageView"
app:layout_constraintHorizontal_bias="0.034"
app:layout_constraintStart_toStartOf="@+id/imageView"
app:layout_constraintTop_toTopOf="@+id/imageView"
app:layout_constraintVertical_bias="0.45" />
</FrameLayout>
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/rectangle_3"
tools:layout_editor_absoluteX="14dp"
tools:layout_editor_absoluteY="67dp" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView2"
app:srcCompat="@drawable/rectangle_3" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="384dp"
android:layout_height="454dp"
app:srcCompat="@drawable/rectangle_4"
tools:layout_editor_absoluteX="12dp"
tools:layout_editor_absoluteY="306dp" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/rectangle_6"
tools:layout_editor_absoluteX="31dp"
tools:layout_editor_absoluteY="379dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:fontFamily="@font/exo_semibold"
android:text="@string/vanced_medias"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toTopOf="@+id/imageView5" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="31dp"
android:layout_marginBottom="45dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/rectangle_7" />
<Button
android:id="@+id/button"
android:layout_width="172dp"
android:layout_height="96dp"
android:background="@drawable/rectangle_5"
android:fontFamily="@font/exo_semibold"
android:text="@string/support_us_"
android:textAllCaps="false"
android:textColor="@android:color/white"
tools:layout_editor_absoluteX="31dp"
tools:layout_editor_absoluteY="498dp" />
<Button
android:id="@+id/button2"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="171dp"
android:layout_height="92dp"
android:background="@drawable/rectangle_8"
android:fontFamily="@font/exo_semibold"
android:text="@string/website_text"
android:textAllCaps="false"
android:textColor="#FFFFFF"
tools:layout_editor_absoluteX="208dp"
tools:layout_editor_absoluteY="501dp" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="11dp"
android:layout_marginTop="4dp"
android:fontFamily="@font/exo_bold"
android:text="@string/website"
android:textColor="#FFFFFF"
app:layout_constraintStart_toStartOf="@+id/button"
app:layout_constraintTop_toTopOf="@+id/button" />
<Button
android:id="@+id/button3"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="9dp"
android:fontFamily="@font/exo_semibold"
android:text="@string/install"
android:textAppearance="@style/install"
app:layout_constraintBottom_toBottomOf="@+id/imageView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.983"
app:layout_constraintStart_toEndOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/imageView"
app:layout_constraintVertical_bias="0.013" />
<ImageView
android:id="@+id/imageView9"
android:layout_width="36dp"
android:layout_height="29dp"
app:srcCompat="@drawable/outline_cloud_download_black_18"
tools:layout_editor_absoluteX="295dp"
tools:layout_editor_absoluteY="80dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>

View file

@ -6,17 +6,150 @@
android:layout_height="match_parent"
tools:context=".ui.home.HomeFragment">
<TextView
android:id="@+id/text_home"
android:layout_width="match_parent"
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:textAlignment="center"
android:textSize="20sp"
android:layout_marginTop="0dp"
android:layout_marginBottom="620dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0"
app:srcCompat="@drawable/rectangle_2" />
<TextView
android:id="@+id/Home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/exo_bold"
android:text="@string/home"
android:textColor="#FFFFFF"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="@+id/imageView"
app:layout_constraintEnd_toEndOf="@+id/imageView"
app:layout_constraintHorizontal_bias="0.034"
app:layout_constraintStart_toStartOf="@+id/imageView"
app:layout_constraintTop_toTopOf="@+id/imageView"
app:layout_constraintVertical_bias="0.45" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/rectangle_3"
tools:layout_editor_absoluteX="14dp"
tools:layout_editor_absoluteY="67dp" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/imageView2"
app:srcCompat="@drawable/rectangle_3" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="384dp"
android:layout_height="454dp"
app:srcCompat="@drawable/rectangle_4"
tools:layout_editor_absoluteX="12dp"
tools:layout_editor_absoluteY="306dp" />
<ImageView
android:id="@+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/rectangle_6"
tools:layout_editor_absoluteX="31dp"
tools:layout_editor_absoluteY="379dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:fontFamily="@font/exo_semibold"
android:text="@string/vanced_medias"
android:textColor="#FFFFFF"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="@+id/imageView5"
app:layout_constraintTop_toTopOf="@+id/imageView5" />
<ImageView
android:id="@+id/imageView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="31dp"
android:layout_marginBottom="45dp"
app:layout_constraintBottom_toBottomOf="@+id/imageView4"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/rectangle_7" />
<Button
android:id="@+id/button"
android:layout_width="172dp"
android:layout_height="96dp"
android:background="@drawable/rectangle_5"
android:fontFamily="@font/exo_semibold"
android:text="@string/support_us_"
android:textAllCaps="false"
android:textColor="@android:color/white"
tools:layout_editor_absoluteX="31dp"
tools:layout_editor_absoluteY="498dp" />
<Button
android:id="@+id/button2"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="172dp"
android:layout_height="96dp"
android:background="@drawable/rectangle_8"
android:fontFamily="@font/exo_semibold"
android:text="@string/website_text"
android:textAllCaps="false"
android:textColor="#FFFFFF"
tools:layout_editor_absoluteX="208dp"
tools:layout_editor_absoluteY="498dp" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="11dp"
android:layout_marginTop="4dp"
android:fontFamily="@font/exo_bold"
android:text="@string/website"
android:textColor="#FFFFFF"
app:layout_constraintStart_toStartOf="@+id/button"
app:layout_constraintTop_toTopOf="@+id/button" />
<Button
android:id="@+id/button3"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="9dp"
android:fontFamily="@font/exo_semibold"
android:text="@string/install"
android:textAppearance="@style/install"
app:layout_constraintBottom_toBottomOf="@+id/imageView2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.983"
app:layout_constraintStart_toEndOf="@+id/imageView6"
app:layout_constraintTop_toBottomOf="@+id/imageView"
app:layout_constraintVertical_bias="0.013" />
<ImageView
android:id="@+id/imageView9"
android:layout_width="36dp"
android:layout_height="29dp"
app:srcCompat="@drawable/outline_cloud_download_black_18"
tools:layout_editor_absoluteX="295dp"
tools:layout_editor_absoluteY="77dp" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -5,5 +5,9 @@
android:id="@+id/navigation_home"
android:icon="@drawable/ic_home_black_24dp"
android:title="@string/home" />
<item
android:id="@+id/navigation_settings"
android:icon="@drawable/vectorsetting_icon"
android:title="@string/settings" />
</menu>

View file

@ -3,4 +3,5 @@
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
<color name="white">#ffffff</color>
</resources>

View file

@ -22,4 +22,7 @@
<string name="github_manager">Manager</string>
<string name="github_bot">Bot</string>
<string name="github_website">Website</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>

View file

@ -1,7 +1,7 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>