UI update, mark details
@@ -1 +1 @@
|
||||
Solen
|
||||
Solon
|
||||
@@ -43,8 +43,8 @@ dependencies {
|
||||
implementation("androidx.constraintlayout:constraintlayout:2.1.4")
|
||||
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0")
|
||||
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0")
|
||||
implementation("androidx.navigation:navigation-fragment-ktx:2.7.6")
|
||||
implementation("androidx.navigation:navigation-ui-ktx:2.7.6")
|
||||
implementation("androidx.navigation:navigation-fragment-ktx:2.7.7")
|
||||
implementation("androidx.navigation:navigation-ui-ktx:2.7.7")
|
||||
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.7.0")
|
||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
||||
implementation("androidx.viewpager2:viewpager2:1.0.0")
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.Solen">
|
||||
android:theme="@style/Theme.Solen"
|
||||
android:windowSoftInputMode="adjustResize">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ import kotlin.math.abs
|
||||
class AboutFragment : DialogFragment() {
|
||||
private lateinit var gestureDetector: GestureDetector
|
||||
private var initialTouchY: Float = 0f
|
||||
private val SWIPETHRESHOLD = 100
|
||||
private val SWIPEVELOCITYTHRESHOLD = 100
|
||||
private val swipeThreshold = 100
|
||||
private val swipeVelocityThreshold = 100
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -43,6 +43,7 @@ class AboutFragment : DialogFragment() {
|
||||
|
||||
// Attach the gesture detector to the root layout
|
||||
view.setOnTouchListener { _, event ->
|
||||
view.performClick()
|
||||
handleTouchEvent(event)
|
||||
}
|
||||
|
||||
@@ -59,7 +60,7 @@ class AboutFragment : DialogFragment() {
|
||||
underlinedText2.setSpan(UnderlineSpan(), 1, srcLink.text.length, 0)
|
||||
|
||||
srcLink.text = underlinedText2
|
||||
makeTextViewClickable(srcLink, "https://gitlab.com/Odweta/solen")
|
||||
makeTextViewClickable(srcLink, "https://gitlab.com/Odweta/solon")
|
||||
|
||||
return view
|
||||
}
|
||||
@@ -108,7 +109,7 @@ class AboutFragment : DialogFragment() {
|
||||
velocityY: Float
|
||||
): Boolean {
|
||||
val diffY = e1?.let { e2.y.minus(it.y) } ?: 0f
|
||||
if (diffY > SWIPETHRESHOLD && abs(velocityY) > SWIPEVELOCITYTHRESHOLD) {
|
||||
if (diffY > swipeThreshold && abs(velocityY) > swipeVelocityThreshold) {
|
||||
// Swiped down
|
||||
dismiss()
|
||||
return true
|
||||
@@ -117,6 +118,7 @@ class AboutFragment : DialogFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("SameReturnValue", "SameReturnValue", "SameReturnValue")
|
||||
private fun handleTouchEvent(event: MotionEvent): Boolean {
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
|
||||
@@ -7,6 +7,7 @@ import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -41,7 +42,7 @@ class CalWeekFragment : Fragment() {
|
||||
val adapter = DayPagerAdapter(childFragmentManager, viewLifecycleOwner.lifecycle)
|
||||
|
||||
for (i in 0 until Vars.days.size) {
|
||||
adapter.addFragment(DayFragment(i, view))
|
||||
adapter.addFragment(DayFragment(i))
|
||||
}
|
||||
|
||||
viewPager.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
|
||||
@@ -55,8 +56,6 @@ class CalWeekFragment : Fragment() {
|
||||
viewPager.offscreenPageLimit = adapter.itemCount
|
||||
viewPager.currentItem = Vars.selectedDay
|
||||
|
||||
view.tag = "timetable_root"
|
||||
|
||||
return view
|
||||
}
|
||||
}
|
||||
@@ -79,7 +78,7 @@ class DayPagerAdapter(fragmentManager: FragmentManager, lifecycle: Lifecycle) :
|
||||
}
|
||||
}
|
||||
|
||||
class DayFragment(private val position: Int, private val rootView: View) : Fragment(R.layout.fragment_day) {
|
||||
class DayFragment(private val i: Int) : Fragment() {
|
||||
private val handler = Handler(Looper.getMainLooper())
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@@ -89,11 +88,9 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
val view = inflater.inflate(R.layout.fragment_day, container, false)
|
||||
view.tag = "day_${position}_root"
|
||||
|
||||
val dayLayout: LinearLayout = view.findViewById(R.id.layoutDayMain)
|
||||
dayLayout.tag = "day_${position}_layout"
|
||||
Vars.dayMap[position]?.let { createDayView(it, dayLayout, resources) }
|
||||
Vars.dayMap[i]?.let { createDayView(it, dayLayout, resources) }
|
||||
|
||||
return view
|
||||
}
|
||||
@@ -109,11 +106,11 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
override fun run() {
|
||||
subjectDrawable.setStroke(0, 0)
|
||||
|
||||
var now = LocalTime.now()
|
||||
var nowD = LocalDate.now().dayOfMonth
|
||||
var nowH = now.hour
|
||||
var nowM = now.minute
|
||||
var nowT = LocalTime.of(nowH, nowM)
|
||||
val now = LocalTime.now()
|
||||
val nowD = LocalDate.now().dayOfMonth
|
||||
val nowH = now.hour
|
||||
val nowM = now.minute
|
||||
val nowT = LocalTime.of(nowH, nowM)
|
||||
|
||||
lateinit var subjST: LocalTime
|
||||
lateinit var subjET: LocalTime
|
||||
@@ -223,7 +220,8 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
}
|
||||
}
|
||||
|
||||
rootView.postInvalidate()
|
||||
requireView().postInvalidate()
|
||||
// repeat every 40 seconds
|
||||
handler.postDelayed(this, 40000L)
|
||||
}
|
||||
}, 0L)
|
||||
@@ -245,7 +243,7 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
dayLayout.orientation = LinearLayout.VERTICAL
|
||||
|
||||
val nameDateTextView = TextView(requireContext())
|
||||
nameDateTextView.text = "${day.name} ${day.date}"
|
||||
nameDateTextView.text = String.format("%s %s", day.name, day.date)
|
||||
nameDateTextView.setTypeface(customFont, Typeface.BOLD_ITALIC)
|
||||
nameDateTextView.textSize = 27f
|
||||
nameDateTextView.setTextColor(
|
||||
@@ -254,7 +252,7 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
nameDateTextView.setPadding(10, 40, 10, 40)
|
||||
nameDateTextView.setPadding(10, 0, 10, 40)
|
||||
nameDateTextView.gravity = Gravity.CENTER_HORIZONTAL
|
||||
|
||||
rootLayout.addView(nameDateTextView)
|
||||
@@ -269,8 +267,6 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
prevSubj.end = ""
|
||||
prevSubj.free = false
|
||||
|
||||
var firstDone = false
|
||||
|
||||
for ((i, subj) in day.subjects.withIndex()) {
|
||||
val subjectBackground = when (subj.substitute) {
|
||||
"0" -> if (subj.place != "Volno") {
|
||||
@@ -329,8 +325,6 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
subjectLayout.orientation = LinearLayout.HORIZONTAL
|
||||
subjectLayout.gravity = Gravity.CENTER_VERTICAL
|
||||
subjectLayout.background = subjectDrawable
|
||||
// set the tag for later use (used as an id)
|
||||
subjectLayout.tag = subj.number
|
||||
|
||||
val subjectNumberDrawable = GradientDrawable()
|
||||
subjectNumberDrawable.shape = GradientDrawable.RECTANGLE
|
||||
@@ -341,13 +335,6 @@ class DayFragment(private val position: Int, private val rootView: View) : Fragm
|
||||
subjectBackground
|
||||
)
|
||||
)
|
||||
/*subjectNumberDrawable.setStroke(
|
||||
10,
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
subjectStroke
|
||||
)
|
||||
)*/
|
||||
|
||||
val subjectNumberTextView = TextView(requireContext())
|
||||
subjectNumberTextView.typeface = customFont
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
package com.odweta.solon
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.content.res.Resources
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
|
||||
class Dialogs {
|
||||
@SuppressLint("InflateParams")
|
||||
class LanguageChange(context: Context) : AlertDialog(context) {
|
||||
init {
|
||||
// Initialize your dialog properties
|
||||
@@ -12,6 +18,7 @@ class Dialogs {
|
||||
setCancelable(true)
|
||||
// Inflate the layout for the dialog
|
||||
val view = LayoutInflater.from(context).inflate(R.layout.radio_group_language, null)
|
||||
window?.setBackgroundDrawableResource(R.drawable.alert_dialog_background)
|
||||
setView(view)
|
||||
|
||||
// Set positive button (e.g., "OK" button)
|
||||
@@ -20,7 +27,6 @@ class Dialogs {
|
||||
"OK"
|
||||
) { _, _ ->
|
||||
// functionality here
|
||||
|
||||
dismiss()
|
||||
}
|
||||
|
||||
@@ -32,5 +38,15 @@ class Dialogs {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
|
||||
val okButton = getButton(BUTTON_POSITIVE)
|
||||
okButton?.setTextColor(ContextCompat.getColor(context, R.color.white))
|
||||
val cancelButton = getButton(BUTTON_NEGATIVE)
|
||||
Log.d("debug", "$okButton $cancelButton")
|
||||
cancelButton?.setTextColor(ContextCompat.getColor(context, R.color.white))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.odweta.solon
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.Button
|
||||
@@ -43,21 +42,6 @@ class MainActivity : AppCompatActivity(), MainActivityListener {
|
||||
fun callLaunchPhase1() {
|
||||
intfc?.launchPhase1()
|
||||
}
|
||||
|
||||
fun quit(context: Context) {
|
||||
// Create an Intent to launch the home screen
|
||||
val homeIntent = Intent(Intent.ACTION_MAIN)
|
||||
homeIntent.addCategory(Intent.CATEGORY_HOME)
|
||||
homeIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
|
||||
// Start the home screen activity
|
||||
context.startActivity(homeIntent)
|
||||
|
||||
// If the context is an Activity, finish it to close the current activity
|
||||
if (context is AppCompatActivity) {
|
||||
context.finish()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,36 +76,35 @@ class MainActivity : AppCompatActivity(), MainActivityListener {
|
||||
val btn = view.findViewById<Button>(R.id.signInButton)
|
||||
|
||||
while (!checked) {
|
||||
delay(300)
|
||||
btn.text = String.format("%s", "Přihlašování")
|
||||
|
||||
if (!checked) {
|
||||
delay(300)
|
||||
btn.text = "Přihlašování"
|
||||
btn.text = String.format("%s", "Přihlašování.")
|
||||
}
|
||||
if (!checked) {
|
||||
delay(300)
|
||||
btn.text = "Přihlašování."
|
||||
btn.text = String.format("%s", "Přihlašování..")
|
||||
}
|
||||
if (!checked) {
|
||||
delay(300)
|
||||
btn.text = "Přihlašování.."
|
||||
btn.text = String.format("%s", "Přihlašování...")
|
||||
}
|
||||
if (!checked) {
|
||||
delay(300)
|
||||
btn.text = "Přihlašování..."
|
||||
btn.text = String.format("%s", "Přihlašování..")
|
||||
}
|
||||
if (!checked) {
|
||||
delay(300)
|
||||
btn.text = "Přihlašování.."
|
||||
btn.text = String.format("%s", "Přihlašování.")
|
||||
}
|
||||
if (!checked) {
|
||||
delay(300)
|
||||
btn.text = "Přihlašování."
|
||||
}
|
||||
if (!checked) {
|
||||
delay(300)
|
||||
btn.text = "Přihlašování"
|
||||
btn.text = String.format("%s", "Přihlašování")
|
||||
}
|
||||
}
|
||||
btn.text = "Přihlásit se"
|
||||
btn.text = String.format("%s", "Přihlásit se")
|
||||
}
|
||||
|
||||
lifecycleScope.launch {
|
||||
@@ -349,13 +332,4 @@ class MainActivity : AppCompatActivity(), MainActivityListener {
|
||||
|
||||
ft.commit()
|
||||
}
|
||||
|
||||
// without animations
|
||||
private fun ft(container: Int, frag: Fragment) {
|
||||
val ft = supportFragmentManager.beginTransaction()
|
||||
|
||||
ft.replace(container, frag)
|
||||
|
||||
ft.commit()
|
||||
}
|
||||
}
|
||||
@@ -43,10 +43,16 @@ class MainFragment : Fragment() {
|
||||
JSONObject(Util.fileToString(Vars.userDataFilePath)).has("fullName")
|
||||
) {
|
||||
toolbar.text =
|
||||
JSONObject(Util.fileToString(Vars.userDataFilePath)).getString("fullName") +
|
||||
role
|
||||
String.format(
|
||||
"%s",
|
||||
"${JSONObject(
|
||||
Util.fileToString(
|
||||
Vars.userDataFilePath
|
||||
)
|
||||
).getString("fullName")}$role"
|
||||
)
|
||||
} else {
|
||||
toolbar.text = "Přihlašte se, prosím."
|
||||
toolbar.text = String.format("%s", "Přihlašte se, prosím.")
|
||||
}
|
||||
|
||||
navbar = view.findViewById(R.id.bottomNav)
|
||||
@@ -125,7 +131,7 @@ class MainFragment : Fragment() {
|
||||
}
|
||||
} else if (!Vars.internetAvail) {
|
||||
Vars.internetAvail = Util.internetAvail(requireContext())
|
||||
toolbar.text = "Bez připojení k internetu."
|
||||
toolbar.text = String.format("%s", "Bez připojení k internetu.")
|
||||
} else {
|
||||
Vars.internetAvail = Util.internetAvail(requireContext())
|
||||
}
|
||||
@@ -138,19 +144,19 @@ class MainFragment : Fragment() {
|
||||
lifecycleScope.launch {
|
||||
done = false
|
||||
while (!done) {
|
||||
toolbar.text = "Načítání nových dat"
|
||||
toolbar.text = String.format("%s", "Načítání nových dat")
|
||||
delay(300)
|
||||
toolbar.text = "Načítání nových dat."
|
||||
toolbar.text = String.format("%s", "Načítání nových dat.")
|
||||
delay(300)
|
||||
toolbar.text = "Načítání nových dat.."
|
||||
toolbar.text = String.format("%s", "Načítání nových dat..")
|
||||
delay(300)
|
||||
toolbar.text = "Načítání nových dat..."
|
||||
toolbar.text = String.format("%s", "Načítání nových dat...")
|
||||
delay(300)
|
||||
toolbar.text = "Načítání nových dat.."
|
||||
toolbar.text = String.format("%s", "Načítání nových dat..")
|
||||
delay(300)
|
||||
toolbar.text = "Načítání nových dat."
|
||||
toolbar.text = String.format("%s", "Načítání nových dat.")
|
||||
delay(300)
|
||||
toolbar.text = "Načítání nových dat"
|
||||
toolbar.text = String.format("%s", "Načítání nových dat")
|
||||
delay(300)
|
||||
}
|
||||
|
||||
@@ -161,8 +167,14 @@ class MainFragment : Fragment() {
|
||||
}
|
||||
|
||||
toolbar.text =
|
||||
JSONObject(Util.fileToString(Vars.userDataFilePath)).getString("fullName") +
|
||||
role
|
||||
String.format(
|
||||
"%s",
|
||||
"${JSONObject(
|
||||
Util.fileToString(
|
||||
Vars.userDataFilePath
|
||||
)
|
||||
).getString("fullName")}$role"
|
||||
)
|
||||
}
|
||||
|
||||
lifecycleScope.launch {
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
package com.odweta.solon
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Dialog
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.GestureDetector
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import android.widget.TableLayout
|
||||
import android.widget.TableRow
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import java.text.SimpleDateFormat
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
// details for the marks of one subject
|
||||
class MarkDetailsFragment(private val marks: MutableList<Mark>, private var idx: Int?) : DialogFragment() {
|
||||
private lateinit var gestureDetector: GestureDetector
|
||||
private var initialTouchY: Float = 0f
|
||||
private val swipeThreshold = 100
|
||||
private val swipeVelocityThreshold = 100
|
||||
private lateinit var rootLayout: LinearLayout
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// set the style so the dialog is fullscreen
|
||||
setStyle(STYLE_NORMAL, R.style.Theme_Solen)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
// inflate the layout
|
||||
val view = inflater.inflate(R.layout.activity_mark_details, container, false)
|
||||
|
||||
// get the root layout
|
||||
rootLayout = view.findViewById(R.id.one_mark_root)
|
||||
|
||||
if (idx == null) {
|
||||
return null
|
||||
}
|
||||
|
||||
// set up gestures
|
||||
gestures(view)
|
||||
|
||||
// construct the view
|
||||
construct()
|
||||
|
||||
// return the view
|
||||
return view
|
||||
}
|
||||
|
||||
private fun gestures(view: View) {
|
||||
// Set up GestureDetector
|
||||
gestureDetector = GestureDetector(requireContext(), SwipeGestureListener())
|
||||
|
||||
// Attach the gesture detector to the root layout
|
||||
view.setOnTouchListener { _, event ->
|
||||
view.performClick()
|
||||
handleTouchEvent(event)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: MAKE CONSTRUCT()
|
||||
@SuppressLint("SetTextI18n", "ClickableViewAccessibility")
|
||||
private fun construct() {
|
||||
/* show all the marks in separate views with yet another onclick listener for even more
|
||||
* details
|
||||
*/
|
||||
|
||||
// TV == TextView
|
||||
// LL == LinearLayout
|
||||
// DR == Drawable
|
||||
// FL == FrameLayout
|
||||
// SV == ScrollView
|
||||
|
||||
/*val bgColor = if (!marks.contains(Mark().none())) {
|
||||
Util.getAvgBgColor(requireContext(), Util.avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange
|
||||
)
|
||||
}
|
||||
val bgStroke = if (!marks.contains(Mark().none())) {
|
||||
Util.getAvgStrokeColor(requireContext(), Util.avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange
|
||||
)
|
||||
}
|
||||
val bg = GradientDrawable()
|
||||
bg.setColor(bgColor)
|
||||
bg.setStroke(10, bgStroke)
|
||||
bg.cornerRadius = resources.getDimension(R.dimen.corner_radius)*/
|
||||
|
||||
/* subject: <subject>
|
||||
* desc: <desc>
|
||||
* date: <date>
|
||||
* weight: <weight>
|
||||
*/
|
||||
|
||||
val font = context?.let { ResourcesCompat.getFont(it, R.font.roboto) }
|
||||
val gradeTV = TextView(requireContext())
|
||||
gradeTV.text = marks[idx!!].grade
|
||||
gradeTV.textSize = 60f
|
||||
gradeTV.setTypeface(font, Typeface.BOLD)
|
||||
gradeTV.background = Util.getAvgDrawable(requireContext(), marks[idx!!].grade)
|
||||
gradeTV.gravity = Gravity.CENTER
|
||||
val pr = LinearLayout.LayoutParams(
|
||||
300,
|
||||
300
|
||||
)
|
||||
pr.setMargins(0, 50, 0, 50)
|
||||
gradeTV.layoutParams = pr
|
||||
gradeTV.setPadding(20, 20, 20, 20)
|
||||
gradeTV.setTextColor(ContextCompat.getColor(requireContext(), R.color.white))
|
||||
|
||||
|
||||
val subjectDesc = makeTV("Předmět: ", Typeface.BOLD, Util.getDisplayWidth(requireContext())/3)
|
||||
val subjectTV = makeTV(Vars.subjectNameMap[marks[idx!!].subject] ?: marks[idx!!].subject, Typeface.ITALIC, 22f)
|
||||
|
||||
val descDesc = makeTV("Popis: ", Typeface.BOLD, Util.getDisplayWidth(requireContext())/3)
|
||||
val descTV = makeTV(marks[idx!!].theme, Typeface.ITALIC, 22f)
|
||||
|
||||
val dateDesc = makeTV("Datum: ", Typeface.BOLD, Util.getDisplayWidth(requireContext())/3)
|
||||
val dateTV = makeTV(getDate(marks[idx!!].date), Typeface.ITALIC, 22f)
|
||||
|
||||
val weightDesc = makeTV("Váha: ", Typeface.BOLD, Util.getDisplayWidth(requireContext())/3)
|
||||
val weightTV = makeTV(marks[idx!!].weight, Typeface.ITALIC, 22f)
|
||||
|
||||
val subjectRow = makeRow(subjectDesc, subjectTV)
|
||||
val descRow = makeRow(descDesc, descTV)
|
||||
val dateRow = makeRow(dateDesc, dateTV)
|
||||
val weightRow = makeRow(weightDesc, weightTV)
|
||||
|
||||
rootLayout.addView(gradeTV)
|
||||
rootLayout.addView(subjectRow)
|
||||
rootLayout.addView(descRow)
|
||||
rootLayout.addView(dateRow)
|
||||
rootLayout.addView(weightRow)
|
||||
}
|
||||
|
||||
private fun getDate(dateIn: String): String {
|
||||
val dateList = dateIn
|
||||
.split("T")[0]
|
||||
.split("-")
|
||||
|
||||
return "${dateList[2]}. ${dateList[1]}. ${dateList[0]}"
|
||||
}
|
||||
|
||||
private fun makeTV(text: String, typeface: Int, width: Int): TextView {
|
||||
val font = context?.let { ResourcesCompat.getFont(it, R.font.roboto) }
|
||||
val tv = TextView(requireContext())
|
||||
tv.text = text
|
||||
tv.textSize = 25f
|
||||
tv.setPadding(40, 20, 20, 20)
|
||||
tv.setTypeface(font, typeface)
|
||||
tv.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
val p = LinearLayout.LayoutParams(
|
||||
width,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
p.setMargins(20, 60, 20, 20)
|
||||
tv.layoutParams = p
|
||||
tv.background = ResourcesCompat.getDrawable(resources, R.drawable.button_background, null)!!
|
||||
tv.gravity = Gravity.CENTER_VERTICAL
|
||||
tv.ellipsize = null
|
||||
tv.setHorizontallyScrolling(false)
|
||||
|
||||
return tv
|
||||
}
|
||||
|
||||
private fun makeTV(text: String, typeface: Int, size: Float): TextView {
|
||||
val font = context?.let { ResourcesCompat.getFont(it, R.font.roboto) }
|
||||
val tv = TextView(requireContext())
|
||||
tv.text = text
|
||||
tv.textSize = size
|
||||
tv.setPadding(40, 20, 20, 20)
|
||||
tv.background = ResourcesCompat.getDrawable(resources, R.drawable.pastel_yellow_no_stroke, null)!!
|
||||
val p = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
p.setMargins(20, 0, 20, 0)
|
||||
tv.layoutParams = p
|
||||
tv.setTypeface(font, typeface)
|
||||
tv.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
tv.gravity = Gravity.CENTER_VERTICAL
|
||||
tv.ellipsize = null
|
||||
tv.setHorizontallyScrolling(false)
|
||||
|
||||
return tv
|
||||
}
|
||||
|
||||
private fun makeRow(left: TextView, right: TextView): LinearLayout {
|
||||
val ll = LinearLayout(requireContext())
|
||||
ll.orientation = LinearLayout.VERTICAL
|
||||
ll.addView(left)
|
||||
ll.addView(right)
|
||||
|
||||
return ll
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = super.onCreateDialog(savedInstanceState)
|
||||
dialog.window?.attributes?.windowAnimations = R.style.Theme_Solen_DialogAnimation
|
||||
dialog.window?.requestFeature(Window.FEATURE_NO_TITLE)
|
||||
dialog.setCancelable(true)
|
||||
|
||||
return dialog
|
||||
}
|
||||
|
||||
inner class SwipeGestureListener : GestureDetector.SimpleOnGestureListener() {
|
||||
override fun onDown(e: MotionEvent): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onFling(
|
||||
e1: MotionEvent?,
|
||||
e2: MotionEvent,
|
||||
velocityX: Float,
|
||||
velocityY: Float
|
||||
): Boolean {
|
||||
val diffY = e1?.let { e2.y.minus(it.y) } ?: 0f
|
||||
if (diffY > swipeThreshold && abs(velocityY) > swipeVelocityThreshold) {
|
||||
// Swiped down
|
||||
dismiss()
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("SameReturnValue")
|
||||
private fun handleTouchEvent(event: MotionEvent): Boolean {
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
initialTouchY = event.rawY
|
||||
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
val deltaY = event.rawY - initialTouchY
|
||||
dialog?.window?.attributes?.y = deltaY.toInt()
|
||||
dialog?.window?.attributes?.windowAnimations = 0
|
||||
dialog?.show()
|
||||
|
||||
// Check if the dialog has been dragged beyond a threshold and dismiss if necessary
|
||||
if (deltaY > 200) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_UP -> {
|
||||
initialTouchY = 0f
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,12 @@ package com.odweta.solon
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.HorizontalScrollView
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.Space
|
||||
import android.widget.TextView
|
||||
@@ -18,13 +18,20 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
// TODO: MARK DETAILS
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
class MarksFragment : Fragment() {
|
||||
private lateinit var inflater: LayoutInflater
|
||||
private var container: ViewGroup? = null
|
||||
private var savedInstanceState: Bundle? = null
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
this.inflater = inflater
|
||||
this.container = container
|
||||
this.savedInstanceState = savedInstanceState
|
||||
|
||||
if (Vars.marksAvailOffline && !Util.fileIsEmpty(Vars.marksFilePath)) {
|
||||
Vars.marksJSON = Util.fileToString(Vars.marksFilePath)
|
||||
Vars.marksAvailOffline = Util.saveStringToFile(Vars.marksFilePath, Vars.marksJSON)
|
||||
@@ -55,10 +62,11 @@ class MarksFragment : Fragment() {
|
||||
|
||||
val root = view.findViewById<LinearLayout>(R.id.root)
|
||||
|
||||
root.addView(createSpace())
|
||||
for (subject in Vars.marks.keys) {
|
||||
for ((i, subject) in Vars.marks.keys.withIndex()) {
|
||||
root.addView(Vars.marks[subject]?.let { createMarkView(it) })
|
||||
root.addView(createSpace())
|
||||
if (i < Vars.marks.keys.size-1) {
|
||||
root.addView(createSpace())
|
||||
}
|
||||
}
|
||||
|
||||
return view
|
||||
@@ -75,68 +83,33 @@ class MarksFragment : Fragment() {
|
||||
return space
|
||||
}
|
||||
|
||||
private fun avg(marks: MutableList<Mark>): String {
|
||||
var sum = 0f
|
||||
var len = 0
|
||||
|
||||
for (mark in marks) {
|
||||
len += 1
|
||||
sum += (mark.grade.toFloat() * mark.weight.toFloat())
|
||||
}
|
||||
|
||||
val weights = mutableListOf<Float>()
|
||||
|
||||
for (mark in marks) {
|
||||
weights.add(mark.weight.toFloat())
|
||||
}
|
||||
|
||||
return String.format("%.2f", (sum / sum(weights))).replace(',', '.')
|
||||
}
|
||||
|
||||
private fun sum(nums: List<Float>): Float {
|
||||
var sum = 0f
|
||||
for (num in nums) {
|
||||
sum += num
|
||||
}
|
||||
|
||||
return sum
|
||||
}
|
||||
|
||||
private fun getAvgBgColor(avg: String): Int {
|
||||
var color: Int = R.color.pastel_orange_transparent
|
||||
|
||||
if (avg.toFloat() in 1f..<2f) {
|
||||
color = R.color.pastel_green_transparent
|
||||
} else if (avg.toFloat() in 2f..<3f) {
|
||||
color = R.color.pastel_yellow_transparent
|
||||
} else if (avg.toFloat() in 3f..<4f) {
|
||||
color = R.color.pastel_orange_transparent
|
||||
} else if (avg.toFloat() in 4f..5f) {
|
||||
color = R.color.pastel_red_transparent
|
||||
}
|
||||
|
||||
return ContextCompat.getColor(
|
||||
requireContext(),
|
||||
color
|
||||
private fun makeDR(marks: MutableList<Mark>): GradientDrawable {
|
||||
val avgDrawable = GradientDrawable()
|
||||
avgDrawable.shape = GradientDrawable.RECTANGLE
|
||||
avgDrawable.cornerRadius = resources.getDimension(R.dimen.corner_radius)
|
||||
avgDrawable.setColor(
|
||||
if (!marks.contains(Mark().none())) {
|
||||
Util.getAvgBgColor(requireContext(), Util.avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange_transparent
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
private fun getAvgStrokeColor(avg: String): Int {
|
||||
var color: Int = R.color.pastel_orange
|
||||
|
||||
if (avg.toFloat() in 1f..<2f) {
|
||||
color = R.color.pastel_green
|
||||
} else if (avg.toFloat() in 2f..<3f) {
|
||||
color = R.color.pastel_yellow
|
||||
} else if (avg.toFloat() in 3f..<4f) {
|
||||
color = R.color.pastel_orange
|
||||
} else if (avg.toFloat() in 4f..5f) {
|
||||
color = R.color.pastel_red
|
||||
}
|
||||
|
||||
return ContextCompat.getColor(
|
||||
requireContext(),
|
||||
color
|
||||
avgDrawable.setStroke(
|
||||
10,
|
||||
if (!marks.contains(Mark().none())) {
|
||||
Util.getAvgStrokeColor(requireContext(), Util.avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
return avgDrawable
|
||||
}
|
||||
|
||||
private fun createMarkView(marks: MutableList<Mark>): LinearLayout {
|
||||
@@ -144,36 +117,25 @@ class MarksFragment : Fragment() {
|
||||
markRoot.orientation = LinearLayout.HORIZONTAL
|
||||
val params = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
params.setMargins(20, 0, 20, 0)
|
||||
params.height = 210
|
||||
markRoot.layoutParams = params
|
||||
markRoot.gravity = Gravity.CENTER_VERTICAL
|
||||
|
||||
val customFont = context?.let { ResourcesCompat.getFont(it, R.font.roboto) }
|
||||
|
||||
val markDrawable = GradientDrawable()
|
||||
markDrawable.shape = GradientDrawable.RECTANGLE
|
||||
markDrawable.cornerRadius = resources.getDimension(R.dimen.corner_radius)
|
||||
markDrawable.setColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.primary_transparent_bg
|
||||
)
|
||||
)
|
||||
markDrawable.setStroke(
|
||||
10,
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.primary
|
||||
)
|
||||
)
|
||||
markRoot.background = markDrawable
|
||||
val rootDR = makeDR(marks)
|
||||
val flDR = makeDR(marks)
|
||||
val separatorDR = makeDR(marks)
|
||||
|
||||
markRoot.background = rootDR
|
||||
|
||||
if (marks[0].subject == "Zatím žádné známky.") {
|
||||
markRoot.gravity = Gravity.CENTER
|
||||
val tv = TextView(requireContext())
|
||||
tv.text = "Zatím žádné známky."
|
||||
tv.text = String.format("%s", "Zatím žádné známky.")
|
||||
tv.textSize = 30f
|
||||
tv.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
@@ -189,68 +151,10 @@ class MarksFragment : Fragment() {
|
||||
return markRoot
|
||||
}
|
||||
|
||||
val avgDrawable = GradientDrawable()
|
||||
avgDrawable.shape = GradientDrawable.RECTANGLE
|
||||
avgDrawable.cornerRadius = resources.getDimension(R.dimen.corner_radius)
|
||||
avgDrawable.setColor(
|
||||
if (!marks.contains(Mark().none())) {
|
||||
getAvgBgColor(avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange_transparent
|
||||
)
|
||||
}
|
||||
)
|
||||
avgDrawable.setStroke(
|
||||
10,
|
||||
if (!marks.contains(Mark().none())) {
|
||||
getAvgStrokeColor(avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
val avgTextView = TextView(requireContext())
|
||||
avgTextView.typeface = customFont
|
||||
|
||||
val text = if (!marks.contains(Mark().none())) {
|
||||
avg(marks)
|
||||
} else {
|
||||
"-"
|
||||
}
|
||||
avgTextView.text = text
|
||||
avgTextView.textSize = 30f
|
||||
avgTextView.setPadding(20, 20, 20, 20)
|
||||
avgTextView.gravity = Gravity.CENTER // Center text vertically
|
||||
avgTextView.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
avgTextView.background = avgDrawable
|
||||
|
||||
val frameLayout = FrameLayout(requireContext())
|
||||
val layoutParams = LinearLayout.LayoutParams(
|
||||
210,
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
)
|
||||
frameLayout.layoutParams = layoutParams
|
||||
frameLayout.addView(avgTextView)
|
||||
|
||||
markRoot.addView(frameLayout)
|
||||
|
||||
val nameAndMarksLayout = LinearLayout(requireContext())
|
||||
nameAndMarksLayout.orientation = LinearLayout.VERTICAL
|
||||
nameAndMarksLayout.gravity = Gravity.START
|
||||
|
||||
val subjectTextView = TextView(requireContext())
|
||||
subjectTextView.text = marks[0].subject.uppercase()
|
||||
subjectTextView.setPadding(20, 15, 20, 0)
|
||||
subjectTextView.setPadding(20, 20, 20, 20)
|
||||
subjectTextView.textSize = 30f
|
||||
subjectTextView.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
@@ -258,9 +162,86 @@ class MarksFragment : Fragment() {
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
subjectTextView.gravity = Gravity.CENTER
|
||||
subjectTextView.setTypeface(customFont, Typeface.BOLD)
|
||||
|
||||
nameAndMarksLayout.addView(subjectTextView)
|
||||
val fl2 = FrameLayout(requireContext())
|
||||
fl2.layoutParams = LinearLayout.LayoutParams(
|
||||
210,
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
)
|
||||
fl2.addView(subjectTextView)
|
||||
|
||||
|
||||
val avgTextView = TextView(requireContext())
|
||||
avgTextView.typeface = customFont
|
||||
|
||||
val text = if (!marks.contains(Mark().none())) {
|
||||
Util.avg(marks)
|
||||
} else {
|
||||
"-"
|
||||
}
|
||||
avgTextView.text = text
|
||||
avgTextView.textSize = 30f
|
||||
avgTextView.setPadding(0, 20, 30, 20)
|
||||
avgTextView.gravity = Gravity.CENTER // Center text vertically
|
||||
avgTextView.setTypeface(customFont, Typeface.ITALIC)
|
||||
avgTextView.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
|
||||
val frameLayout = FrameLayout(requireContext())
|
||||
frameLayout.layoutParams = LinearLayout.LayoutParams(
|
||||
210,
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
)
|
||||
frameLayout.addView(avgTextView)
|
||||
|
||||
val flLL = LinearLayout(requireContext())
|
||||
flLL.layoutParams = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
flLL.orientation = LinearLayout.HORIZONTAL
|
||||
flLL.background = flDR
|
||||
|
||||
val separator = LinearLayout(requireContext())
|
||||
separator.layoutParams = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
separator.gravity = Gravity.CENTER_VERTICAL
|
||||
separator.background = separatorDR
|
||||
|
||||
val space = TextView(requireContext())
|
||||
space.setPadding(0, 40, 0, 40)
|
||||
space.gravity = Gravity.CENTER_VERTICAL
|
||||
space.text = " "
|
||||
space.textSize = 22f
|
||||
space.setTextColor(
|
||||
if (!marks.contains(Mark().none())) {
|
||||
Util.getAvgBgColor(requireContext(), Util.avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange_transparent
|
||||
)
|
||||
}
|
||||
)
|
||||
space.layoutParams = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
separator.addView(space)
|
||||
|
||||
flLL.addView(fl2)
|
||||
flLL.addView(separator)
|
||||
flLL.addView(frameLayout)
|
||||
|
||||
markRoot.addView(flLL)
|
||||
|
||||
val marksTextView = TextView(requireContext())
|
||||
var markString = ""
|
||||
@@ -271,7 +252,7 @@ class MarksFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
marksTextView.text = markString
|
||||
marksTextView.setPadding(20, -15, 20, 0)
|
||||
marksTextView.setPadding(20, 20, 20, 20)
|
||||
marksTextView.textSize = 23f
|
||||
marksTextView.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
@@ -279,13 +260,19 @@ class MarksFragment : Fragment() {
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
marksTextView.gravity = Gravity.CENTER_VERTICAL
|
||||
marksTextView.ellipsize = null
|
||||
marksTextView.setHorizontallyScrolling(false)
|
||||
|
||||
val marksScrollView = HorizontalScrollView(requireContext())
|
||||
marksScrollView.addView(marksTextView)
|
||||
markRoot.addView(marksTextView)
|
||||
|
||||
nameAndMarksLayout.addView(marksScrollView)
|
||||
|
||||
markRoot.addView(nameAndMarksLayout)
|
||||
// add an onclick event listener for mark details
|
||||
markRoot.setOnClickListener {
|
||||
/* mark details will be a DialogFragment
|
||||
* and will slide up from the bottom
|
||||
*/
|
||||
MarksOneSubjectFragment(marks).show(requireFragmentManager(), "fragment_mark_details")
|
||||
}
|
||||
|
||||
return markRoot
|
||||
}
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
package com.odweta.solon
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Dialog
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.GestureDetector
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import kotlin.math.abs
|
||||
|
||||
|
||||
// details for the marks of one subject
|
||||
@Suppress("DEPRECATION")
|
||||
class MarksOneSubjectFragment(private val marks: MutableList<Mark>) : DialogFragment() {
|
||||
private var initialTouchY: Float = 0f
|
||||
private lateinit var rootLayout: LinearLayout
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
// set the style so the dialog is fullscreen
|
||||
setStyle(STYLE_NORMAL, R.style.Theme_Solen)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
// inflate the layout
|
||||
val view = inflater.inflate(R.layout.activity_marks_one_subject, container, false)
|
||||
|
||||
// get the root layout
|
||||
rootLayout = view.findViewById(R.id.mark_details_root)
|
||||
|
||||
// set up gestures
|
||||
gestures(view)
|
||||
|
||||
// construct the view
|
||||
construct()
|
||||
|
||||
// return the view
|
||||
return view
|
||||
}
|
||||
|
||||
private fun gestures(view: View) {
|
||||
// Attach the gesture detector to the root layout
|
||||
view.setOnTouchListener { _, event ->
|
||||
view.performClick()
|
||||
handleTouchEvent(event, null)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n", "ClickableViewAccessibility")
|
||||
private fun construct() {
|
||||
/* show all the marks in separate views with yet another onclick listener for even more
|
||||
* details
|
||||
*/
|
||||
|
||||
// TV == TextView
|
||||
// LL == LinearLayout
|
||||
// DR == Drawable
|
||||
// FL == FrameLayout
|
||||
// SV == ScrollView
|
||||
|
||||
val customFont = context?.let { ResourcesCompat.getFont(it, R.font.roboto) }
|
||||
val bgColor = if (!marks.contains(Mark().none())) {
|
||||
Util.getAvgBgColor(requireContext(), Util.avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange
|
||||
)
|
||||
}
|
||||
val bgStroke = if (!marks.contains(Mark().none())) {
|
||||
Util.getAvgStrokeColor(requireContext(), Util.avg(marks))
|
||||
} else {
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.pastel_orange
|
||||
)
|
||||
}
|
||||
val bg = GradientDrawable()
|
||||
bg.setColor(bgColor)
|
||||
bg.setStroke(10, bgStroke)
|
||||
bg.cornerRadius = resources.getDimension(R.dimen.corner_radius)
|
||||
|
||||
// the view for all the details of one subject (not the marks)
|
||||
// e.g. average in that subject, hours per week maybe idk
|
||||
val subjectDetailsLL = LinearLayout(requireContext())
|
||||
subjectDetailsLL.orientation = LinearLayout.HORIZONTAL
|
||||
subjectDetailsLL.setPadding(20, 20, 20, 20)
|
||||
subjectDetailsLL.background = bg
|
||||
val params = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
params.setMargins(0, 40, 0, 40)
|
||||
subjectDetailsLL.layoutParams = params
|
||||
|
||||
/* items:
|
||||
* - whole name of the subject
|
||||
* - avg
|
||||
* - maybe more idk
|
||||
*/
|
||||
val wholeNameTV = TextView(requireContext())
|
||||
// index by the abbrev and get the name (if null just fallback to the abbrev)
|
||||
wholeNameTV.text = Vars.subjectNameMap[marks[0].subject] ?: marks[0].subject
|
||||
wholeNameTV.textSize = 28f
|
||||
wholeNameTV.gravity = Gravity.CENTER
|
||||
wholeNameTV.setPadding(20, 30, 10, 30)
|
||||
wholeNameTV.setTypeface(customFont, Typeface.BOLD)
|
||||
wholeNameTV.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
wholeNameTV.ellipsize = null
|
||||
wholeNameTV.setHorizontallyScrolling(false)
|
||||
subjectDetailsLL.addView(wholeNameTV)
|
||||
|
||||
val avgTV = TextView(requireContext())
|
||||
avgTV.text = "${Util.avg(marks)} " // plus a space for the italic stuff
|
||||
avgTV.textSize = 28f
|
||||
avgTV.setTypeface(customFont, Typeface.BOLD_ITALIC)
|
||||
avgTV.textAlignment = View.TEXT_ALIGNMENT_TEXT_END
|
||||
avgTV.layoutParams = LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT
|
||||
)
|
||||
avgTV.setPadding(30, 30, 30, 30)
|
||||
avgTV.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
|
||||
subjectDetailsLL.addView(avgTV)
|
||||
|
||||
|
||||
|
||||
// a vertical LL for individual marks
|
||||
val marksLL = LinearLayout(requireContext())
|
||||
marksLL.orientation = LinearLayout.VERTICAL
|
||||
|
||||
for ((i, mark) in marks.withIndex()) {
|
||||
val markLL = LinearLayout(requireContext())
|
||||
markLL.orientation = LinearLayout.HORIZONTAL
|
||||
markLL.gravity = Gravity.CENTER_VERTICAL
|
||||
|
||||
val markTV = TextView(requireContext())
|
||||
markTV.text = mark.grade
|
||||
markTV.setPadding(20, 20, 20, 20)
|
||||
markTV.textSize = 30f
|
||||
markTV.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
|
||||
val descTV = TextView(requireContext())
|
||||
descTV.text = "${mark.theme} "
|
||||
descTV.setPadding(20, 20, 20, 20)
|
||||
descTV.textSize = 20f
|
||||
descTV.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.white
|
||||
)
|
||||
)
|
||||
|
||||
descTV.setOnTouchListener { _, event ->
|
||||
handleTouchEvent(event, i)
|
||||
}
|
||||
descTV.setTypeface(customFont, Typeface.ITALIC)
|
||||
descTV.ellipsize = null
|
||||
descTV.setHorizontallyScrolling(false)
|
||||
|
||||
markLL.setOnTouchListener { _, event ->
|
||||
handleTouchEvent(event, i)
|
||||
}
|
||||
|
||||
markLL.addView(markTV)
|
||||
markLL.addView(descTV)
|
||||
|
||||
marksLL.addView(markLL)
|
||||
}
|
||||
|
||||
// add everything to the root layout
|
||||
rootLayout.addView(subjectDetailsLL)
|
||||
rootLayout.addView(marksLL)
|
||||
}
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
val dialog = super.onCreateDialog(savedInstanceState)
|
||||
dialog.window?.attributes?.windowAnimations = R.style.Theme_Solen_DialogAnimation
|
||||
dialog.window?.requestFeature(Window.FEATURE_NO_TITLE)
|
||||
dialog.setCancelable(true)
|
||||
|
||||
return dialog
|
||||
}
|
||||
|
||||
@Suppress("SameReturnValue", "DEPRECATION")
|
||||
private fun handleTouchEvent(event: MotionEvent, i: Int? = null): Boolean {
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
initialTouchY = event.rawY
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
val deltaY = event.rawY - initialTouchY
|
||||
dialog?.window?.attributes?.y = deltaY.toInt()
|
||||
dialog?.window?.attributes?.windowAnimations = 0
|
||||
dialog?.show()
|
||||
|
||||
// Check if the dialog has been dragged beyond a threshold and dismiss if necessary
|
||||
if (deltaY > 200) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
MotionEvent.ACTION_UP -> {
|
||||
if (dialog?.isShowing == true) {
|
||||
i?.let {
|
||||
MarkDetailsFragment(marks, i).show(
|
||||
requireFragmentManager(),
|
||||
"fragment_mark_details"
|
||||
)
|
||||
}
|
||||
}
|
||||
initialTouchY = 0f
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.odweta.solon
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
@@ -21,6 +22,7 @@ class MenuFragment : Fragment() {
|
||||
return view
|
||||
}
|
||||
|
||||
@SuppressLint("InflateParams")
|
||||
private fun addCallbacks(view: View) {
|
||||
val settings = view.findViewById<Button>(R.id.menu_button_settings)
|
||||
val signOut = view.findViewById<Button>(R.id.menu_button_sign_out)
|
||||
|
||||
@@ -67,7 +67,7 @@ class Network {
|
||||
}
|
||||
}
|
||||
|
||||
fun getSYID(): String {
|
||||
private fun getSYID(): String {
|
||||
val syidRoot = JSONObject(Util.fileToString(Vars.userDataFilePath)).getString("schoolYearId")
|
||||
val toAdd = JSONObject(Util.fileToString(Vars.userDataFilePath)).getString("studyYear")
|
||||
|
||||
|
||||
@@ -261,6 +261,9 @@ class Parsing {
|
||||
for (i in 0..<subjectsJSONArray.length()) {
|
||||
val subj = subjectsJSONArray.getJSONObject(i)
|
||||
subjectMap[subj.getString("id")] = subj.getString("abbrev")
|
||||
|
||||
// map names to abbrevs
|
||||
Vars.subjectNameMap[subj.getString("abbrev")] = subj.getString("name")
|
||||
}
|
||||
|
||||
for (i in 0..<marksJSONArray.length()) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.odweta.solon
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import android.view.GestureDetector
|
||||
@@ -12,6 +13,8 @@ import android.view.ViewGroup
|
||||
import android.view.Window
|
||||
import android.widget.Button
|
||||
import android.widget.ScrollView
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class SettingsFragment : DialogFragment() {
|
||||
private lateinit var scrollView: ScrollView
|
||||
@@ -53,6 +56,7 @@ class SettingsFragment : DialogFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
@@ -63,6 +67,7 @@ class SettingsFragment : DialogFragment() {
|
||||
scrollView.scrollY = 0
|
||||
|
||||
scrollView.setOnTouchListener { _, event ->
|
||||
scrollView.performClick()
|
||||
gestureDetector.onTouchEvent(event)
|
||||
// Return false to allow normal scrolling
|
||||
false
|
||||
|
||||
@@ -15,8 +15,8 @@ import kotlin.math.abs
|
||||
class SignInFragment : DialogFragment() {
|
||||
private lateinit var gestureDetector: GestureDetector
|
||||
private var initialTouchY: Float = 0f
|
||||
private val SWIPETHRESHOLD = 100
|
||||
private val SWIPEVELOCITYTHRESHOLD = 100
|
||||
private val swipeThreshold = 100
|
||||
private val swipeVelocityThreshold = 100
|
||||
private lateinit var dialog: Dialog
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@@ -34,6 +34,7 @@ class SignInFragment : DialogFragment() {
|
||||
MainActivity.setListener(requireContext())
|
||||
|
||||
view.setOnTouchListener { _, event ->
|
||||
view.performClick()
|
||||
handleTouchEvent(event)
|
||||
}
|
||||
|
||||
@@ -69,7 +70,7 @@ class SignInFragment : DialogFragment() {
|
||||
velocityY: Float
|
||||
): Boolean {
|
||||
val diffY = e1?.let { e2.y.minus(it.y) } ?: 0f
|
||||
if (diffY > SWIPETHRESHOLD && abs(velocityY) > SWIPEVELOCITYTHRESHOLD) {
|
||||
if (diffY > swipeThreshold && abs(velocityY) > swipeVelocityThreshold) {
|
||||
// Swiped down
|
||||
dismiss()
|
||||
return true
|
||||
@@ -78,6 +79,7 @@ class SignInFragment : DialogFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("SameReturnValue")
|
||||
private fun handleTouchEvent(event: MotionEvent): Boolean {
|
||||
when (event.action) {
|
||||
MotionEvent.ACTION_DOWN -> {
|
||||
@@ -85,9 +87,9 @@ class SignInFragment : DialogFragment() {
|
||||
}
|
||||
MotionEvent.ACTION_MOVE -> {
|
||||
val deltaY = event.rawY - initialTouchY
|
||||
dialog?.window?.attributes?.y = deltaY.toInt()
|
||||
dialog?.window?.attributes?.windowAnimations = 0
|
||||
dialog?.show()
|
||||
dialog.window?.attributes?.y = deltaY.toInt()
|
||||
dialog.window?.attributes?.windowAnimations = 0
|
||||
dialog.show()
|
||||
|
||||
// Check if the dialog has been dragged beyond a threshold and dismiss if necessary
|
||||
if (deltaY > 200) {
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
package com.odweta.solon
|
||||
|
||||
import android.animation.Animator
|
||||
import android.animation.AnimatorInflater
|
||||
import android.animation.AnimatorListenerAdapter
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.content.res.ColorStateList
|
||||
import android.content.res.Resources
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.NetworkCapabilities
|
||||
import android.os.Handler
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.Button
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.content.res.ResourcesCompat
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.nio.charset.Charset
|
||||
@@ -114,8 +127,81 @@ class Util {
|
||||
return (pixels * resources.displayMetrics.density).toInt()
|
||||
}
|
||||
|
||||
fun dpToPixels(dp: Int, resources: Resources): Int {
|
||||
/*fun dpToPixels(dp: Int, resources: Resources): Int {
|
||||
return (dp / resources.displayMetrics.density).toInt()
|
||||
}*/
|
||||
|
||||
fun avg(marks: MutableList<Mark>): String {
|
||||
var sum = 0f
|
||||
var len = 0
|
||||
|
||||
for (mark in marks) {
|
||||
len += 1
|
||||
sum += (mark.grade.toFloat() * mark.weight.toFloat())
|
||||
}
|
||||
|
||||
val weights = mutableListOf<Float>()
|
||||
|
||||
for (mark in marks) {
|
||||
weights.add(mark.weight.toFloat())
|
||||
}
|
||||
|
||||
return String.format("%.2f", (sum / sum(weights))).replace(',', '.')
|
||||
}
|
||||
|
||||
private fun sum(nums: List<Float>): Float {
|
||||
var sum = 0f
|
||||
for (num in nums) {
|
||||
sum += num
|
||||
}
|
||||
|
||||
return sum
|
||||
}
|
||||
|
||||
fun getAvgBgColor(ctx: Context, avg: String): Int {
|
||||
var color: Int = R.color.pastel_orange_transparent
|
||||
|
||||
if (avg.toFloat() in 1f..<2f) {
|
||||
color = R.color.pastel_green_transparent
|
||||
} else if (avg.toFloat() in 2f..<3f) {
|
||||
color = R.color.pastel_yellow_transparent
|
||||
} else if (avg.toFloat() in 3f..<4f) {
|
||||
color = R.color.pastel_orange_transparent
|
||||
} else if (avg.toFloat() in 4f..5f) {
|
||||
color = R.color.pastel_red_transparent
|
||||
}
|
||||
|
||||
return ContextCompat.getColor(
|
||||
ctx,
|
||||
color
|
||||
)
|
||||
}
|
||||
fun getAvgStrokeColor(ctx: Context, avg: String): Int {
|
||||
var color: Int = R.color.pastel_orange
|
||||
|
||||
if (avg.toFloat() in 1f..<2f) {
|
||||
color = R.color.pastel_green
|
||||
} else if (avg.toFloat() in 2f..<3f) {
|
||||
color = R.color.pastel_yellow
|
||||
} else if (avg.toFloat() in 3f..<4f) {
|
||||
color = R.color.pastel_orange
|
||||
} else if (avg.toFloat() in 4f..5f) {
|
||||
color = R.color.pastel_red
|
||||
}
|
||||
|
||||
return ContextCompat.getColor(
|
||||
ctx,
|
||||
color
|
||||
)
|
||||
}
|
||||
|
||||
fun getAvgDrawable(ctx: Context, avg: String): Drawable {
|
||||
val d = GradientDrawable()
|
||||
d.setColor(getAvgBgColor(ctx, avg))
|
||||
d.setStroke(10, getAvgStrokeColor(ctx, avg))
|
||||
d.cornerRadius = 8f
|
||||
|
||||
return d
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,8 @@ class Vars {
|
||||
var timeTableAvailOffline: Boolean = false
|
||||
var marksAvailOffline: Boolean = false
|
||||
|
||||
val subjectNameMap = mutableMapOf<String, String>()
|
||||
|
||||
val dayMap = mutableMapOf<Int, Day>()
|
||||
var days = listOf<Day>()
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- fade_in.xml -->
|
||||
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromAlpha="0.0"
|
||||
android:toAlpha="1.0"
|
||||
android:duration="200" />
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- fade_in.xml -->
|
||||
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:fromAlpha="1.0"
|
||||
android:toAlpha="0.0"
|
||||
android:duration="200" />
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:fromXDelta="100%p"
|
||||
android:toXDelta="0"
|
||||
android:duration="250" />
|
||||
</set>
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<translate
|
||||
android:fromXDelta="0"
|
||||
android:toXDelta="-100%p"
|
||||
android:duration="250" />
|
||||
</set>
|
||||
@@ -1,11 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#333333"
|
||||
android:alpha="0.6">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17.77,3.77l-1.77,-1.77l-10,10l10,10l1.77,-1.77l-8.23,-8.23z"/>
|
||||
</vector>
|
||||
@@ -1,11 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="#FFFFFF"
|
||||
android:alpha="0.8">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17.77,3.77l-1.77,-1.77l-10,10l10,10l1.77,-1.77l-8.23,-8.23z"/>
|
||||
</vector>
|
||||
|
Before Width: | Height: | Size: 322 B |
|
Before Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 240 B |
|
Before Width: | Height: | Size: 222 B |
|
Before Width: | Height: | Size: 348 B |
|
Before Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 447 B |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/button_clicked_background" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/button_background" />
|
||||
</selector>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="@dimen/corner_radius" />
|
||||
<solid android:color="#90FFCC33" />
|
||||
<stroke android:width="5dp" android:color="@color/pastel_yellow" />
|
||||
</shape>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<size android:width="2dp" /> <!-- Adjust width as needed -->
|
||||
<solid android:color="@color/white" /> <!-- Set desired color -->
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 125 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/pastel_yellow_transparent" />
|
||||
<corners android:radius="@dimen/corner_radius" />
|
||||
</shape>
|
||||
@@ -1,5 +0,0 @@
|
||||
<!-- res/drawable/rounded_corner_background.xml -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="20dp" /> <!-- Adjust the radius as needed -->
|
||||
<solid android:color="#696969" /> <!-- Set the background color -->
|
||||
</shape>
|
||||
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 292 B |
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -9,21 +9,25 @@
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/black">
|
||||
android:layout_marginTop="0dp"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toTopOf="@+id/imageView2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/about_app"
|
||||
android:background="@drawable/toolbar_background"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:text="@string/about_app"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="25dp" />
|
||||
android:textSize="25sp" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
@@ -31,6 +35,7 @@
|
||||
android:id="@+id/imageView2"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="300dp"
|
||||
android:contentDescription="@string/solon_logo"
|
||||
app:layout_constraintBottom_toTopOf="@+id/podstata"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
@@ -44,7 +49,7 @@
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:fontFamily="monospace"
|
||||
android:text="Přehlednost je podstata."
|
||||
android:text="@string/slogan"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp"
|
||||
@@ -60,7 +65,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginBottom="250dp"
|
||||
android:text="Vylepšená verze mobilní aplikace ŠkolaOnLine"
|
||||
android:text="@string/desc_about"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="24sp"
|
||||
@@ -69,7 +74,8 @@
|
||||
app:layout_constraintHorizontal_bias="0.416"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/imageView2"
|
||||
app:layout_constraintVertical_bias="1.0" />
|
||||
app:layout_constraintVertical_bias="1.0"
|
||||
tools:ignore="TextSizeCheck" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/link"
|
||||
@@ -78,7 +84,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginEnd="139dp"
|
||||
android:text=" Odweta"
|
||||
android:text="@string/odweta"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textFontWeight="400"
|
||||
android:textSize="20sp"
|
||||
@@ -95,7 +101,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="144dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
android:text="Vývoj:"
|
||||
android:text="@string/development_vyvoj"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -109,11 +115,11 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="61dp"
|
||||
android:contentDescription="@string/gitlab_logo"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.303"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintVertical_bias="0.54"
|
||||
app:srcCompat="@mipmap/gitlab_logo_foreground" />
|
||||
|
||||
<TextView
|
||||
@@ -123,7 +129,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="96dp"
|
||||
android:layout_marginBottom="100dp"
|
||||
android:text="Zdrojový kód"
|
||||
android:text="@string/source_code"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/cal_week_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity"
|
||||
|
||||
@@ -2,6 +2,4 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/app_root">
|
||||
|
||||
</FrameLayout>
|
||||
android:id="@+id/app_root" />
|
||||
@@ -2,29 +2,31 @@
|
||||
<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:id="@+id/main_roott"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/toolbarFrame"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/toolbarFrame"
|
||||
android:background="@color/black">
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toTopOf="@+id/fragmentContainer"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_margin="20dp"
|
||||
android:background="@drawable/toolbar_background"
|
||||
android:gravity="center"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:padding="10dp"
|
||||
android:gravity="center"
|
||||
android:padding="15dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="25dp" />
|
||||
android:textSize="25sp" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<FrameLayout
|
||||
@@ -44,10 +46,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/toolbar_background"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginVertical="20dp"
|
||||
android:layout_margin="20dp"
|
||||
android:fontFamily="@font/roboto"
|
||||
app:itemTextColor="@color/white"
|
||||
android:padding="5dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/fragmentContainer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/one_mark_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,13 +1,10 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scroll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -18,7 +15,7 @@
|
||||
<LinearLayout
|
||||
android:id="@+id/root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="1dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:layout_marginEnd="1dp"
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mark_details_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,11 +1,8 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/menu_layout_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/menu_button_settings"
|
||||
@@ -13,44 +10,46 @@
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="200dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/button_background_selector"
|
||||
android:text="@string/settings"
|
||||
android:textSize="20sp"
|
||||
android:textSize="22sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/menu_button_sign_out"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.497"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:background="@drawable/button_background"/>
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/menu_button_sign_out"
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/button_background_selector"
|
||||
android:text="@string/sign_out"
|
||||
android:textSize="20sp"
|
||||
android:textSize="22sp"
|
||||
app:cornerRadius="@dimen/corner_radius"
|
||||
app:layout_constraintBottom_toTopOf="@+id/menu_button_sign_in"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.498"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/menu_button_settings"
|
||||
android:background="@drawable/button_background" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/menu_button_settings" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/menu_button_sign_in"
|
||||
android:layout_width="190dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:background="@drawable/button_background_selector"
|
||||
android:ellipsize="none"
|
||||
android:scrollHorizontally="false"
|
||||
android:text="@string/sign_in"
|
||||
android:textSize="20sp"
|
||||
android:textSize="22sp"
|
||||
app:cornerRadius="@dimen/corner_radius"
|
||||
app:layout_constraintBottom_toTopOf="@+id/menu_button_about"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.497"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/menu_button_sign_out"
|
||||
android:background="@drawable/button_background" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/menu_button_sign_out" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/menu_button_about"
|
||||
@@ -59,13 +58,13 @@
|
||||
android:layout_marginStart="158dp"
|
||||
android:layout_marginEnd="159dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
android:background="@drawable/button_background_selector"
|
||||
android:text="@string/about_app"
|
||||
android:textSize="20sp"
|
||||
android:textSize="22sp"
|
||||
app:cornerRadius="@dimen/corner_radius"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/menu_button_sign_in"
|
||||
android:background="@drawable/button_background" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/menu_button_sign_in" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,17 +1,13 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:id="@+id/no_mark_root">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/no_mark_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:foregroundGravity="center"
|
||||
android:gravity="center"
|
||||
android:foregroundGravity="center" />
|
||||
android:orientation="vertical" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,30 +1,33 @@
|
||||
<?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"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/appBarLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/black">
|
||||
android:layout_marginTop="0dp"
|
||||
android:background="@color/black"
|
||||
app:layout_constraintBottom_toTopOf="@+id/scrollViewSettings"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/toolbar"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="@string/settings"
|
||||
android:background="@drawable/toolbar_background"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:text="@string/settings"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="25dp" />
|
||||
android:textSize="25sp" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
@@ -42,23 +45,21 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/appBarLayout">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/scrollViewLinear"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/setting_language"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="20dp"
|
||||
android:paddingBottom="10dp">
|
||||
android:paddingBottom="10dp"
|
||||
tools:ignore="UselessParent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/settings_language_text"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
@@ -74,7 +75,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/button_background"
|
||||
android:background="@drawable/button_background_selector"
|
||||
android:text="@string/lang_choose" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -1,78 +1,91 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<ScrollView 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"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="457dp"
|
||||
android:layout_height="307dp"
|
||||
android:layout_marginBottom="17dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/usernameField"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.528"
|
||||
app:srcCompat="@drawable/solon_500_yellow" />
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/usernameField"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="292dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="Uživatelské jméno"
|
||||
android:inputType="text"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHighlight="@color/white"
|
||||
android:textColorHint="#C8FFFFFF"
|
||||
android:textColorLink="@color/white"
|
||||
android:theme="@style/sign_in_field"
|
||||
app:circularflow_radiusInDP="20dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/passwordField"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.85" />
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
android:layout_width="286dp"
|
||||
android:layout_height="96dp"
|
||||
android:layout_marginTop="120dp"
|
||||
android:contentDescription="@string/solon_logo"
|
||||
app:layout_constraintBottom_toTopOf="@+id/usernameField"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.496"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
app:srcCompat="@drawable/solon_just_yellow" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/passwordField"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="224dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="Heslo"
|
||||
android:inputType="textPassword"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHighlight="@color/white"
|
||||
android:textColorHint="#C8FFFFFF"
|
||||
android:textColorLink="@color/white"
|
||||
android:theme="@style/sign_in_field"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
<LinearLayout
|
||||
android:id="@+id/frame"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="50dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/signInButton"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/logo">
|
||||
|
||||
<Button
|
||||
android:id="@+id/signInButton"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginStart="137dp"
|
||||
android:layout_marginTop="72dp"
|
||||
android:layout_marginEnd="137dp"
|
||||
android:layout_marginBottom="88dp"
|
||||
android:text="Přihlásit se"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:textSize="20sp"
|
||||
android:background="@drawable/button_background"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordField" />
|
||||
<EditText
|
||||
android:id="@+id/usernameField"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="@string/username"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="text"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHighlight="@color/white"
|
||||
android:textColorHint="#C8FFFFFF"
|
||||
android:textColorLink="@color/white"
|
||||
android:textCursorDrawable="@drawable/cursor"
|
||||
android:theme="@style/sign_in_field"
|
||||
app:circularflow_radiusInDP="20dp" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<EditText
|
||||
android:id="@+id/passwordField"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="50dp"
|
||||
android:background="@drawable/button_background"
|
||||
android:ems="10"
|
||||
android:hint="@string/password"
|
||||
android:importantForAutofill="no"
|
||||
android:inputType="textPassword"
|
||||
android:paddingHorizontal="20dp"
|
||||
android:textColor="@color/white"
|
||||
android:textColorHighlight="@color/white"
|
||||
android:textColorHint="#C8FFFFFF"
|
||||
android:textColorLink="@color/white"
|
||||
android:textCursorDrawable="@drawable/cursor"
|
||||
android:theme="@style/sign_in_field" />
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/signInButton"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="80dp"
|
||||
android:background="@drawable/button_background_selector"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:text="@string/sign_in_"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.497"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/frame"
|
||||
app:layout_constraintVertical_bias="0.056" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</ScrollView>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/splash_root">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
@@ -25,6 +23,7 @@
|
||||
android:id="@+id/loading_gif"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:contentDescription="@string/loading_gif"
|
||||
android:src="@drawable/loading3"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:gravity="center">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/heading"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
|
||||
@@ -11,5 +11,5 @@
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black"
|
||||
android:fontFamily="@font/roboto"
|
||||
android:orientation="vertical"></LinearLayout>
|
||||
android:orientation="vertical" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/settings_language_choice"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:padding="20dp">
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_button_language_cz"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/lang_cz"
|
||||
@@ -21,7 +18,6 @@
|
||||
android:theme="@style/Theme.Solen.RadioButton" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/radio_button_language_en"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/lang_en"
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:icon="@android:drawable/ic_dialog_dialer"
|
||||
android:title="Rozvrh" />
|
||||
android:title="@string/timetable" />
|
||||
<item
|
||||
android:id="@+id/nav_marks"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:icon="@mipmap/grade2_foreground"
|
||||
android:title="Známky" />
|
||||
android:title="@string/marks" />
|
||||
<item
|
||||
android:id="@+id/nav_menu"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:icon="@drawable/menu_240"
|
||||
android:title="Menu" />
|
||||
android:title="@string/menu" />
|
||||
</menu>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/gitlab_logo_background"/>
|
||||
<foreground android:drawable="@mipmap/gitlab_logo_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/gitlab_logo_background"/>
|
||||
<foreground android:drawable="@mipmap/gitlab_logo_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/grade_background"/>
|
||||
<foreground android:drawable="@mipmap/grade_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/grade2_background"/>
|
||||
<foreground android:drawable="@mipmap/grade2_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/grade2_background"/>
|
||||
<foreground android:drawable="@mipmap/grade2_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/grade_background"/>
|
||||
<foreground android:drawable="@mipmap/grade_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/left_arrow_background"/>
|
||||
<foreground android:drawable="@mipmap/left_arrow_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/left_arrow_background"/>
|
||||
<foreground android:drawable="@mipmap/left_arrow_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/menu_background"/>
|
||||
<foreground android:drawable="@mipmap/menu_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@mipmap/menu_background"/>
|
||||
<foreground android:drawable="@mipmap/menu_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<adaptive-icon xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
tools:ignore="MonochromeLauncherIcon">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<adaptive-icon xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
tools:ignore="MonochromeLauncherIcon">
|
||||
<background android:drawable="@color/ic_launcher_background"/>
|
||||
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||
</adaptive-icon>
|
||||
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 40 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 40 B |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 40 B |
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 40 B |
|
Before Width: | Height: | Size: 910 B |
|
Before Width: | Height: | Size: 40 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 470 B |
|
Before Width: | Height: | Size: 40 B |
|
Before Width: | Height: | Size: 210 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 40 B |