Archived
Ringtones may be customised; settings intent for Oreo+, custom solution otherwise
This commit is contained in:
Generated
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
+2
-2
@@ -10,8 +10,8 @@ android {
|
|||||||
applicationId "com.denizd.substitutionplan"
|
applicationId "com.denizd.substitutionplan"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 28
|
versionCode 29
|
||||||
versionName "2.2.5"
|
versionName "2.2.6"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:required="true"/>
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:required="true"/>
|
||||||
<uses-permission android:name="android.permission.INTERNET" android:required="true"/>
|
<uses-permission android:name="android.permission.INTERNET" android:required="true"/>
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" android:required="true"/>
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" android:required="true"/>
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK" android:required="true"/>
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import android.content.Context
|
|||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.media.RingtoneManager
|
import android.media.RingtoneManager
|
||||||
|
import android.net.Uri
|
||||||
import android.os.AsyncTask
|
import android.os.AsyncTask
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
@@ -87,6 +88,9 @@ class DataFetcher(isplan: Boolean, ismenu: Boolean, isjobservice: Boolean, conte
|
|||||||
val rows = doc.select("tr")
|
val rows = doc.select("tr")
|
||||||
val paragraphs = doc.select("p")
|
val paragraphs = doc.select("p")
|
||||||
|
|
||||||
|
val coursePreference = prefs.getString("courses", "") ?: ""
|
||||||
|
val classPreference = prefs.getString("classes", "") ?: ""
|
||||||
|
|
||||||
for (i in 0 until paragraphs.size) {
|
for (i in 0 until paragraphs.size) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
informational = paragraphs[i].text()
|
informational = paragraphs[i].text()
|
||||||
@@ -110,17 +114,17 @@ class DataFetcher(isplan: Boolean, ismenu: Boolean, isjobservice: Boolean, conte
|
|||||||
priority--
|
priority--
|
||||||
|
|
||||||
if (jobservice && prefs.getBoolean("notif", true)) {
|
if (jobservice && prefs.getBoolean("notif", true)) {
|
||||||
if ((prefs.getString("courses", "") ?: "").isEmpty() && (prefs.getString("classes", "") ?: "").isNotEmpty()) {
|
if (coursePreference.isEmpty() && classPreference.isNotEmpty()) {
|
||||||
if (group.isNotEmpty() && group != "") {
|
if (group.isNotEmpty() && group != "") {
|
||||||
if ((prefs.getString("classes", "") ?: "").contains(group) || group.contains((prefs.getString("classes", "") ?: "").toString())) {
|
if (classPreference.contains(group) || group.contains(classPreference)) {
|
||||||
|
|
||||||
notifText += "${if (notifText.isNotEmpty()) ",\n" else ""}$course: ${if (additional.isNotEmpty()) additional else "---"}"
|
notifText += "${if (notifText.isNotEmpty()) ",\n" else ""}$course: ${if (additional.isNotEmpty()) additional else "---"}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ((prefs.getString("classes", "") ?: "").isNotEmpty() && (prefs.getString("courses", "") ?: "").isNotEmpty()) {
|
} else if (classPreference.isNotEmpty() && coursePreference.isNotEmpty()) {
|
||||||
if (group != "" && course != "") {
|
if (group != "" && course != "") {
|
||||||
if ((prefs.getString("courses", "") ?: "").contains(course)) {
|
if (coursePreference.contains(course)) {
|
||||||
if ((prefs.getString("classes", "") ?: "").contains(group) || group.contains((prefs.getString("classes", "") ?: "").toString())) {
|
if (classPreference.contains(group) || group.contains(classPreference)) {
|
||||||
|
|
||||||
notifText += "${if (notifText.isNotEmpty()) ",\n" else ""}$course: ${if (additional.isNotEmpty()) additional else "---"}"
|
notifText += "${if (notifText.isNotEmpty()) ",\n" else ""}$course: ${if (additional.isNotEmpty()) additional else "---"}"
|
||||||
}
|
}
|
||||||
@@ -158,10 +162,18 @@ class DataFetcher(isplan: Boolean, ismenu: Boolean, isjobservice: Boolean, conte
|
|||||||
.setSmallIcon(R.drawable.ic_avh)
|
.setSmallIcon(R.drawable.ic_avh)
|
||||||
.setContentIntent(openAppPending)
|
.setContentIntent(openAppPending)
|
||||||
.setAutoCancel(true)
|
.setAutoCancel(true)
|
||||||
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
|
|
||||||
.setColor(ContextCompat.getColor(mContext, R.color.colorAccent))
|
.setColor(ContextCompat.getColor(mContext, R.color.colorAccent))
|
||||||
.build()
|
|
||||||
manager.notify(1, notification)
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||||
|
val sound = if ((prefs.getString("ringtoneUri", "") ?: "").isNotEmpty()) {
|
||||||
|
Uri.parse(prefs.getString("ringtoneUri", "") ?: "")
|
||||||
|
} else {
|
||||||
|
RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
|
||||||
|
}
|
||||||
|
notification.setSound(sound)
|
||||||
|
}
|
||||||
|
|
||||||
|
manager.notify(1, notification.build())
|
||||||
}
|
}
|
||||||
|
|
||||||
edit.putString("timeNew", currentTime).apply()
|
edit.putString("timeNew", currentTime).apply()
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.denizd.substitutionplan
|
||||||
|
|
||||||
|
import android.net.Uri
|
||||||
|
|
||||||
|
class Ringtone(val name: String, val uri: String)
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.denizd.substitutionplan
|
||||||
|
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.google.android.material.card.MaterialCardView
|
||||||
|
|
||||||
|
class RingtoneAdapter(private var _ringtones: List<Ringtone>, onClickListener: OnClickListener) : RecyclerView.Adapter<RingtoneAdapter.RingtoneViewHolder>() {
|
||||||
|
|
||||||
|
val _onClickListener = onClickListener
|
||||||
|
|
||||||
|
class RingtoneViewHolder(view: View, clickListener: OnClickListener) : RecyclerView.ViewHolder(view), View.OnClickListener {
|
||||||
|
val name: TextView = view.findViewById(R.id.item_text)
|
||||||
|
val uri: TextView = view.findViewById(R.id.item_text_no_lang)
|
||||||
|
val cardView: MaterialCardView = view.findViewById(R.id.cardView)
|
||||||
|
val _clickListener = clickListener
|
||||||
|
init { view.setOnClickListener(this) }
|
||||||
|
|
||||||
|
override fun onClick(v: View?) { _clickListener.onRingtoneClick(adapterPosition, name.text.toString(), uri.text.toString()) }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RingtoneViewHolder {
|
||||||
|
val v = LayoutInflater.from(parent.context).inflate(R.layout.list_item, parent, false)
|
||||||
|
return RingtoneViewHolder(v, _onClickListener)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBindViewHolder(holder: RingtoneViewHolder, position: Int) {
|
||||||
|
val currentItem = _ringtones[position]
|
||||||
|
|
||||||
|
holder.name.text = currentItem.name
|
||||||
|
holder.uri.text = currentItem.uri
|
||||||
|
holder.cardView.setCardBackgroundColor(ContextCompat.getColor(holder.cardView.context, R.color.colorBackground))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemCount(): Int = _ringtones.size
|
||||||
|
|
||||||
|
fun setRingtones(ringtones: List<Ringtone>) {
|
||||||
|
_ringtones = ringtones
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnClickListener {
|
||||||
|
fun onRingtoneClick(position: Int, name: String, uri: String)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,10 +4,13 @@ import android.content.ActivityNotFoundException
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import android.database.Cursor
|
||||||
|
import android.media.RingtoneManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.preference.PreferenceManager
|
import android.preference.PreferenceManager
|
||||||
|
import android.provider.Settings
|
||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
@@ -28,7 +31,8 @@ import com.google.firebase.messaging.FirebaseMessaging
|
|||||||
import com.jaredrummler.android.device.DeviceName
|
import com.jaredrummler.android.device.DeviceName
|
||||||
import kotlin.collections.ArrayList
|
import kotlin.collections.ArrayList
|
||||||
|
|
||||||
class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListener, CompoundButton.OnCheckedChangeListener, ColourAdapter.OnClickListener {
|
class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListener,
|
||||||
|
CompoundButton.OnCheckedChangeListener, ColourAdapter.OnClickListener, RingtoneAdapter.OnClickListener {
|
||||||
|
|
||||||
private var name = ""
|
private var name = ""
|
||||||
private var model = ""
|
private var model = ""
|
||||||
@@ -41,6 +45,8 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
|||||||
private var cs: Int = 7
|
private var cs: Int = 7
|
||||||
private var window: Window? = null
|
private var window: Window? = null
|
||||||
private lateinit var colourRecycler: RecyclerView
|
private lateinit var colourRecycler: RecyclerView
|
||||||
|
private lateinit var ringtoneCustomiserDialog: AlertDialog
|
||||||
|
private lateinit var currentRingtone: TextView
|
||||||
|
|
||||||
override fun onAttach(context: Context) {
|
override fun onAttach(context: Context) {
|
||||||
super.onAttach(context)
|
super.onAttach(context)
|
||||||
@@ -68,6 +74,8 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
|||||||
val helpClasses = view.findViewById<ImageButton>(R.id.chipHelpClasses)
|
val helpClasses = view.findViewById<ImageButton>(R.id.chipHelpClasses)
|
||||||
val btnCustomiseColours = view.findViewById<LinearLayout>(R.id.btnCustomiseColours)
|
val btnCustomiseColours = view.findViewById<LinearLayout>(R.id.btnCustomiseColours)
|
||||||
val btnVersion = view.findViewById<LinearLayout>(R.id.btnVersion)
|
val btnVersion = view.findViewById<LinearLayout>(R.id.btnVersion)
|
||||||
|
currentRingtone = view.findViewById(R.id.txtCustomiseRingtone2)
|
||||||
|
setRingtoneText()
|
||||||
|
|
||||||
switchDisableGreeting.setOnCheckedChangeListener(this)
|
switchDisableGreeting.setOnCheckedChangeListener(this)
|
||||||
switchDark.setOnCheckedChangeListener(this)
|
switchDark.setOnCheckedChangeListener(this)
|
||||||
@@ -77,6 +85,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
|||||||
helpCourses.setOnClickListener(this)
|
helpCourses.setOnClickListener(this)
|
||||||
helpClasses.setOnClickListener(this)
|
helpClasses.setOnClickListener(this)
|
||||||
btnCustomiseColours.setOnClickListener(this)
|
btnCustomiseColours.setOnClickListener(this)
|
||||||
|
view.findViewById<LinearLayout>(R.id.btnCustomiseRingtone).setOnClickListener(this)
|
||||||
view.findViewById<LinearLayout>(R.id.btnWebsite).setOnClickListener(this)
|
view.findViewById<LinearLayout>(R.id.btnWebsite).setOnClickListener(this)
|
||||||
view.findViewById<LinearLayout>(R.id.btnLicences).setOnClickListener(this)
|
view.findViewById<LinearLayout>(R.id.btnLicences).setOnClickListener(this)
|
||||||
view.findViewById<LinearLayout>(R.id.btnTerms).setOnClickListener(this)
|
view.findViewById<LinearLayout>(R.id.btnTerms).setOnClickListener(this)
|
||||||
@@ -132,6 +141,7 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
|||||||
R.id.chipHelpCourses -> createDialog(getString(R.string.enterCoursesHelpTitle), getString(R.string.enterCoursesHelp))
|
R.id.chipHelpCourses -> createDialog(getString(R.string.enterCoursesHelpTitle), getString(R.string.enterCoursesHelp))
|
||||||
R.id.chipHelpClasses -> createDialog(getString(R.string.enterGradeHelpTitle), getString(R.string.enterGradeHelp))
|
R.id.chipHelpClasses -> createDialog(getString(R.string.enterGradeHelpTitle), getString(R.string.enterGradeHelp))
|
||||||
R.id.btnCustomiseColours -> createColourDialog()
|
R.id.btnCustomiseColours -> createColourDialog()
|
||||||
|
R.id.btnCustomiseRingtone -> createRingtoneDialog()
|
||||||
R.id.btnWebsite -> {
|
R.id.btnWebsite -> {
|
||||||
try {
|
try {
|
||||||
customTabsIntent.launchUrl(mContext, Uri.parse("http://307.joomla.schule.bremen.de"))
|
customTabsIntent.launchUrl(mContext, Uri.parse("http://307.joomla.schule.bremen.de"))
|
||||||
@@ -301,6 +311,73 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
|||||||
return colours
|
return colours
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun createRingtoneDialog() {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
val intent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS).apply {
|
||||||
|
putExtra(Settings.EXTRA_APP_PACKAGE, mContext.applicationContext.packageName)
|
||||||
|
putExtra(Settings.EXTRA_CHANNEL_ID, "general")
|
||||||
|
}
|
||||||
|
startActivity(intent)
|
||||||
|
} else {
|
||||||
|
val ringtoneCustomiserBuilder = AlertDialog.Builder(mContext, R.style.AlertDialog)
|
||||||
|
|
||||||
|
val dialogView = LayoutInflater.from(mContext).inflate(R.layout.recycler_dialog, null)
|
||||||
|
val titleText = dialogView.findViewById<TextView>(R.id.empty_textviewtitle)
|
||||||
|
titleText.text = getString(R.string.pickRingtone)
|
||||||
|
|
||||||
|
val recycler = dialogView.findViewById<RecyclerView>(R.id.recyclerView)
|
||||||
|
recycler.apply {
|
||||||
|
hasFixedSize()
|
||||||
|
layoutManager = GridLayoutManager(mContext, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
ringtoneCustomiserDialog = ringtoneCustomiserBuilder.setView(dialogView).create()
|
||||||
|
ringtoneCustomiserDialog.show()
|
||||||
|
|
||||||
|
recycler.postDelayed({
|
||||||
|
val ringtones = getRingtones().toList()
|
||||||
|
recycler.adapter = RingtoneAdapter(ringtones, this)
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getRingtones(): ArrayList<Ringtone> {
|
||||||
|
lateinit var _cursor: Cursor
|
||||||
|
val ringtoneManager = RingtoneManager(activity).apply {
|
||||||
|
setType(RingtoneManager.TYPE_NOTIFICATION)
|
||||||
|
_cursor = cursor
|
||||||
|
}
|
||||||
|
val alarms = ArrayList<Ringtone>()
|
||||||
|
|
||||||
|
while (!_cursor.isAfterLast && _cursor.moveToNext()) {
|
||||||
|
val position = _cursor.position
|
||||||
|
alarms.add(Ringtone(ringtoneManager.getRingtone(position).getTitle(mContext), ringtoneManager.getRingtoneUri(position).toString()))
|
||||||
|
}
|
||||||
|
return alarms
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onRingtoneClick(position: Int, name: String, uri: String) {
|
||||||
|
prefs.edit().apply {
|
||||||
|
putString("ringtoneName", name)
|
||||||
|
putString("ringtoneUri", uri)
|
||||||
|
}.apply()
|
||||||
|
setRingtoneText()
|
||||||
|
ringtoneCustomiserDialog.dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setRingtoneText() {
|
||||||
|
currentRingtone.text = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
mContext.getString(R.string.deviceSettingsRedirect)
|
||||||
|
} else {
|
||||||
|
val tone = if ((prefs.getString("ringtoneName", "") ?: "").isNotEmpty()) {
|
||||||
|
prefs.getString("ringtoneName", "")
|
||||||
|
} else {
|
||||||
|
mContext.getString(R.string.defaultRingtone)
|
||||||
|
}
|
||||||
|
mContext.getString(R.string.setRingtone2, tone)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onClick(position: Int, title: String, titleNoLang: String) {
|
override fun onClick(position: Int, title: String, titleNoLang: String) {
|
||||||
val colourPickerBuilder = AlertDialog.Builder(mContext, R.style.AlertDialog)
|
val colourPickerBuilder = AlertDialog.Builder(mContext, R.style.AlertDialog)
|
||||||
val pickerDialogView = LayoutInflater.from(mContext).inflate(R.layout.empty_dialog, null)
|
val pickerDialogView = LayoutInflater.from(mContext).inflate(R.layout.empty_dialog, null)
|
||||||
@@ -338,7 +415,6 @@ class SettingsFragment : Fragment(R.layout.content_settings), View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun debugMenu(): Boolean {
|
private fun debugMenu(): Boolean {
|
||||||
|
|
||||||
DeviceName.with(mContext).request { deviceInfo, _ ->
|
DeviceName.with(mContext).request { deviceInfo, _ ->
|
||||||
name = deviceInfo.marketName
|
name = deviceInfo.marketName
|
||||||
model = deviceInfo.model
|
model = deviceInfo.model
|
||||||
|
|||||||
@@ -162,7 +162,7 @@
|
|||||||
android:text="@string/customiseColoursIndividually"
|
android:text="@string/customiseColoursIndividually"
|
||||||
android:textColor="@color/colorHint"
|
android:textColor="@color/colorHint"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toTopOf="@+id/txtNotifications"
|
||||||
app:layout_constraintStart_toStartOf="@+id/txtCustomiseColours1"
|
app:layout_constraintStart_toStartOf="@+id/txtCustomiseColours1"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours1" />
|
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours1" />
|
||||||
|
|
||||||
@@ -176,10 +176,84 @@
|
|||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtRestart" />
|
app:layout_constraintTop_toBottomOf="@+id/txtRestart"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/txtNotifications"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtNotifications"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="@string/enableNotifications"
|
||||||
|
android:textColor="@color/colorText"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/txtCustomiseColours2"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseColours2" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtNotifiedAbout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="@string/enablesBackgroundSync"
|
||||||
|
android:textAlignment="textStart"
|
||||||
|
android:textColor="@color/colorHint"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/txtNotifications"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txtNotifications"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/txtCustomiseRingtone"/>
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/switchNotifications"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:gravity="end|center"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/txtCustomiseRingtone"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/txtNotifications"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/txtNotifications" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtCustomiseRingtone"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="@string/setRingtone"
|
||||||
|
android:textColor="@color/colorText"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/txtNotifiedAbout"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txtNotifiedAbout" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtCustomiseRingtone2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="@string/setRingtone2"
|
||||||
|
android:textColor="@color/colorHint"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/txtCustomiseRingtone"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txtCustomiseRingtone"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/btnCustomiseRingtone"
|
||||||
|
style="@style/SelectableItemBackground"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txtNotifiedAbout"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
@@ -262,14 +336,16 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
android:hint="@string/courses"
|
android:hint="@string/courses"
|
||||||
android:importantForAutofill="no"
|
android:importantForAutofill="no"
|
||||||
android:textColorHint="@color/colorHint"
|
android:textColorHint="@color/colorHint"
|
||||||
app:boxStrokeColor="@color/colorAccent"
|
app:boxStrokeColor="@color/colorAccent"
|
||||||
app:boxStrokeWidth="1dp"
|
app:boxStrokeWidth="1dp"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/chipHelpCourses"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/txtLayoutClasses"
|
app:layout_constraintStart_toStartOf="@+id/txtLayoutClasses"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtLayoutClasses">
|
app:layout_constraintTop_toBottomOf="@+id/txtLayoutClasses"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/chipHelpCourses">
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:id="@+id/txtCourses"
|
android:id="@+id/txtCourses"
|
||||||
@@ -298,42 +374,6 @@
|
|||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/txtLayoutCourses" />
|
app:layout_constraintTop_toTopOf="@+id/txtLayoutCourses" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtNotifications"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="16dp"
|
|
||||||
android:text="@string/enableNotifications"
|
|
||||||
android:textColor="@color/colorText"
|
|
||||||
android:textSize="14sp"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/txtFilter"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtLayoutCourses" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/txtNotifiedAbout"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="16dp"
|
|
||||||
android:text="@string/enablesBackgroundSync"
|
|
||||||
android:textAlignment="textStart"
|
|
||||||
android:textColor="@color/colorHint"
|
|
||||||
android:textSize="12sp"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/txtNotifications"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtNotifications"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:id="@+id/switchNotifications"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:gravity="end|center"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/txtNotifications"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/txtNotifications" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
android:id="@+id/recyclerView"
|
android:id="@+id/recyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scrollbars="vertical"/>
|
android:scrollbars="vertical"
|
||||||
|
android:layoutAnimation="@anim/layout_animation_fall_down"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -127,4 +127,11 @@
|
|||||||
<item>Hey, %s!</item>
|
<item>Hey, %s!</item>
|
||||||
<item>Hi %s!</item>
|
<item>Hi %s!</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string name="setRingtone">Benutzerdefinierter Benachrichtungston</string>
|
||||||
|
<string name="setRingtone2">Derzeit: %s</string>
|
||||||
|
<string name="pickRingtone">Wähle einen Benachrichtigungston</string>
|
||||||
|
<string name="noRingtonesFound">Keine Klingeltöne gefunden</string>
|
||||||
|
<string name="deviceSettingsRedirect">Öffnet Geräteinstellungen</string>
|
||||||
|
<string name="defaultRingtone">Standard</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -141,4 +141,11 @@
|
|||||||
<item>Hey, %s!</item>
|
<item>Hey, %s!</item>
|
||||||
<item>Hi %s!</item>
|
<item>Hi %s!</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<string name="setRingtone">Customise notification ringtone</string>
|
||||||
|
<string name="setRingtone2">Currently: %s</string>
|
||||||
|
<string name="pickRingtone">Pick a notification ringtone</string>
|
||||||
|
<string name="noRingtonesFound">No ringtones found</string>
|
||||||
|
<string name="deviceSettingsRedirect">Redirects to device settings</string>
|
||||||
|
<string name="defaultRingtone">Default</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user