Add settings menu
This commit is contained in:
parent
f2e7e3dd02
commit
7a3c844099
@ -4,7 +4,6 @@ import android.os.Bundle
|
|||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TextView
|
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import com.example.myapplication.databinding.FragmentSettingsBinding
|
import com.example.myapplication.databinding.FragmentSettingsBinding
|
||||||
@ -24,15 +23,15 @@ class SettingsFragment : Fragment() {
|
|||||||
savedInstanceState: Bundle?
|
savedInstanceState: Bundle?
|
||||||
): View {
|
): View {
|
||||||
val homeViewModel =
|
val homeViewModel =
|
||||||
ViewModelProvider(this).get(SettingsViewModel::class.java)
|
ViewModelProvider(this)[SettingsViewModel::class.java]
|
||||||
|
|
||||||
_binding = FragmentSettingsBinding.inflate(inflater, container, false)
|
_binding = FragmentSettingsBinding.inflate(inflater, container, false)
|
||||||
val root: View = binding.root
|
val root: View = binding.root
|
||||||
|
|
||||||
val textView: TextView = binding.textSettings
|
// val textView: TextView = binding.textSettings
|
||||||
homeViewModel.text.observe(viewLifecycleOwner) {
|
// homeViewModel.text.observe(viewLifecycleOwner) {
|
||||||
textView.text = it
|
// textView.text = it
|
||||||
}
|
// }
|
||||||
return root
|
return root
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,22 +1,60 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".ui.settings.SettingsFragment">
|
tools:context=".ui.settings.SettingsFragment">
|
||||||
|
|
||||||
<TextView
|
<ScrollView
|
||||||
android:id="@+id/text_settings"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent">
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:layout_marginTop="8dp"
|
<RadioGroup
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_width="match_parent"
|
||||||
android:textAlignment="center"
|
android:layout_height="wrap_content">
|
||||||
android:textSize="20sp"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
<TextView
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
android:id="@+id/setting_video_group"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
android:layout_width="match_parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/settings_video_size" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/setting_default_size_video"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/settings_default_size" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/setting_big_size_video"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/settings_big_size" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/setting_huge_size"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/settings_huge_size" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/setting_custom_size_video"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/settings_custom_size" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/setting_custom_size_video_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autofillHints=""
|
||||||
|
android:ems="10"
|
||||||
|
android:hint="@string/settings_custom_size_hint"
|
||||||
|
android:inputType="numberSigned"
|
||||||
|
android:minHeight="48dp"
|
||||||
|
android:textColorHint="#757575" />
|
||||||
|
|
||||||
|
</RadioGroup>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -3,4 +3,11 @@
|
|||||||
<string name="title_compressing">Compressing</string>
|
<string name="title_compressing">Compressing</string>
|
||||||
<string name="title_completed">Completed</string>
|
<string name="title_completed">Completed</string>
|
||||||
<string name="title_settings">Settings</string>
|
<string name="title_settings">Settings</string>
|
||||||
|
<string name="settings_video_size">Video Size</string>
|
||||||
|
<string name="settings_image_size">Image Size</string>
|
||||||
|
<string name="settings_default_size">8mb</string>
|
||||||
|
<string name="settings_big_size">50mb</string>
|
||||||
|
<string name="settings_huge_size">500mb</string>
|
||||||
|
<string name="settings_custom_size">Custom</string>
|
||||||
|
<string name="settings_custom_size_hint">Enter Size in MB</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue
Block a user