add beginnings of settings fragment

pull/12/head
geeksville 2020-04-08 18:42:17 -07:00
rodzic 749103cd09
commit c286c56067
6 zmienionych plików z 138 dodań i 17 usunięć

Wyświetl plik

@ -28,10 +28,7 @@ import com.geeksville.android.ServiceClient
import com.geeksville.mesh.model.TextMessage
import com.geeksville.mesh.model.UIViewModel
import com.geeksville.mesh.service.*
import com.geeksville.mesh.ui.ChannelFragment
import com.geeksville.mesh.ui.MapFragment
import com.geeksville.mesh.ui.MessagesFragment
import com.geeksville.mesh.ui.UsersFragment
import com.geeksville.mesh.ui.*
import com.geeksville.util.Exceptions
import com.geeksville.util.exceptionReporter
import com.google.android.gms.auth.api.signin.GoogleSignIn
@ -124,24 +121,21 @@ class MainActivity : AppCompatActivity(), Logging,
R.drawable.ic_twotone_people_24,
UsersFragment()
),
TabInfo(
"Map",
R.drawable.ic_twotone_map_24,
MapFragment()
),
TabInfo(
"Channel",
R.drawable.ic_twotone_contactless_24,
ChannelFragment()
),
TabInfo(
"Map",
R.drawable.ic_twotone_map_24,
MapFragment()
)
/*
TabInfo(
"Settings",
R.drawable.ic_twotone_settings_applications_24,
BTScanFragment("Settings", 2) { SettingsContent() }) */
SettingsFragment()
)
)
private

Wyświetl plik

@ -1,5 +1,33 @@
package com.geeksville.mesh.ui
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.activityViewModels
import com.geeksville.android.Logging
import com.geeksville.mesh.R
import com.geeksville.mesh.model.UIViewModel
class SettingsFragment : ScreenFragment("Settings"), Logging {
private val model: UIViewModel by activityViewModels()
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.settings_fragment, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}
/*
@Model

Wyświetl plik

@ -48,9 +48,9 @@
android:layout_height="wrap_content"
android:layout_marginEnd="16dp"
android:layout_weight="1"
android:backgroundTint="#FFFFFFFF"
android:contentDescription="@string/connection_status"
android:tint="#FFFFFF"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

Wyświetl plik

@ -6,7 +6,6 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/channelNameView"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="64dp"

Wyświetl plik

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/warningNotPaired"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:ems="10"
android:gravity="start|top"
android:text="@string/warning_not_paired"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:hint="@string/your_name"
app:layout_constraintEnd_toEndOf="@+id/warningNotPaired"
app:layout_constraintStart_toStartOf="@+id/warningNotPaired"
app:layout_constraintTop_toBottomOf="@+id/warningNotPaired">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/username_unset" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textview.MaterialTextView
android:id="@+id/scanStatusText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:text="@string/looking_for_meshtastic_devices"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout2" />
<ProgressBar
android:id="@+id/scanProgressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/deviceRadioGroup" />
<RadioGroup
android:id="@+id/deviceRadioGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/scanStatusText">
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/test__devname1" />
<RadioButton
android:id="@+id/radioButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/test_devname2" />
</RadioGroup>
<CheckBox
android:id="@+id/analyticsOkayCheckbox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:checked="true"
android:text="@string/analytics_okay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

Wyświetl plik

@ -14,4 +14,11 @@
<string name="sample_message">hey I found the cache, it is over here next to the big tiger. I\'m kinda scared.</string>
<string name="some_username">Some Username</string>
<string name="send_text">Send Text</string>
<string name="warning_not_paired">You haven\'t yet paired a Meshtastic compatible radio with this phone. Please pair a device and set your username.\n\nThis open-source application is in alpha-testing, if you find problems please post on our website chat.\n\nFor more information see our web page - www.meshtastic.org.</string>
<string name="username_unset">Username unset</string>
<string name="your_name">Your Name</string>
<string name="analytics_okay">Anonymous usage statistics and crash reports.</string>
<string name="looking_for_meshtastic_devices">Looking for Meshtastic devices...</string>
<string name="test__devname1">Meshtastic_ac23</string>
<string name="test_devname2">Meshtastic_1267</string>
</resources>