Archived
Project cleanup; removed unused resources and test classes. Fixed memory leak bug in DataFetcher.kt
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
package com.denizd.substitutionplan;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.test.InstrumentationRegistry;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.denizd.substitutionplan", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
@@ -13,14 +13,14 @@ import com.google.android.material.card.MaterialCardView
|
||||
|
||||
internal class ColourAdapter(private var mColours: List<Colour>, onClickListener: OnClickListener) : RecyclerView.Adapter<ColourAdapter.ColourViewHolder>() {
|
||||
|
||||
val mOnClickListener = onClickListener
|
||||
private val mOnClickListener = onClickListener
|
||||
|
||||
class ColourViewHolder(view: View, clickListener: OnClickListener) : RecyclerView.ViewHolder(view), View.OnClickListener {
|
||||
val title: TextView = view.findViewById(R.id.item_text)
|
||||
var image: ImageView = view.findViewById(R.id.item_image)
|
||||
val titleNoLang: TextView = view.findViewById(R.id.item_text_no_lang)
|
||||
val cardView: MaterialCardView = view.findViewById(R.id.cardView)
|
||||
val mClickListener = clickListener
|
||||
private val mClickListener = clickListener
|
||||
init { view.setOnClickListener(this) }
|
||||
|
||||
override fun onClick(v: View?) { mClickListener.onClick(adapterPosition, title.text.toString(), titleNoLang.text.toString()) }
|
||||
@@ -59,12 +59,7 @@ internal class ColourAdapter(private var mColours: List<Colour>, onClickListener
|
||||
|
||||
override fun getItemCount(): Int = mColours.size
|
||||
|
||||
fun setColours(colours: List<Colour>) {
|
||||
mColours = colours
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
public interface OnClickListener {
|
||||
internal interface OnClickListener {
|
||||
fun onClick(position: Int, title: String, titleNoLang: String)
|
||||
}
|
||||
}
|
||||
@@ -26,10 +26,6 @@ internal class FoodAdapter(food: ArrayList<Food>) : RecyclerView.Adapter<FoodAda
|
||||
return CardViewHolder(v)
|
||||
}
|
||||
|
||||
fun getFoodAt(i: Int): Food {
|
||||
return mFood!![i]
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: CardViewHolder, position: Int) {
|
||||
val currentItem = mFood!![position]
|
||||
|
||||
|
||||
@@ -45,12 +45,7 @@ internal class RingtoneAdapter(private var _ringtones: List<Ringtone>, onClickLi
|
||||
|
||||
override fun getItemCount(): Int = _ringtones.size
|
||||
|
||||
fun setRingtones(ringtones: List<Ringtone>) {
|
||||
_ringtones = ringtones
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
public interface OnClickListener {
|
||||
internal interface OnClickListener {
|
||||
fun onRingtoneClick(position: Int, name: String, uri: String)
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import com.denizd.substitutionplan.models.Food
|
||||
import com.denizd.substitutionplan.models.Subst
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import org.jsoup.Jsoup
|
||||
import java.lang.ref.WeakReference
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
/**
|
||||
@@ -40,13 +41,13 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
||||
private var menu = isMenu
|
||||
private var forceRefresh = forced
|
||||
|
||||
private var mContext = context
|
||||
private var mContext = WeakReference(context)
|
||||
private var mApplication = application
|
||||
private var mView = parentView
|
||||
private var mView = WeakReference(parentView)
|
||||
private var priority = 200
|
||||
private var notifText = ""
|
||||
private var notificationText = ""
|
||||
private var informational = ""
|
||||
private val prefs = PreferenceManager.getDefaultSharedPreferences(mContext)
|
||||
private val prefs = PreferenceManager.getDefaultSharedPreferences(mContext.get())
|
||||
private val edit = prefs.edit()
|
||||
private var currentTime = ""
|
||||
private var currentFoodTime = ""
|
||||
@@ -72,21 +73,21 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
||||
}
|
||||
|
||||
if (plan || menu) {
|
||||
mView?.let { v: View ->
|
||||
var snackText = "${mContext.getText(R.string.lastUpdated)} ${when {
|
||||
mView.get()?.let { v: View ->
|
||||
var snackText = "${mContext.get()?.getText(R.string.lastUpdated)} ${when {
|
||||
plan -> currentTime
|
||||
menu -> currentFoodTime
|
||||
else -> "---"
|
||||
}}"
|
||||
snackText = if (forceRefresh) mContext.getString(R.string.forcedRefresh) else snackText
|
||||
snackText = if (forceRefresh) mContext.get()?.getString(R.string.forcedRefresh) ?: "" else snackText
|
||||
val snackBarView = v.findViewById<View>(R.id.coordination)
|
||||
Snackbar.make(snackBarView, snackText, Snackbar.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
mView?.let { v: View ->
|
||||
mView.get()?.let { v: View ->
|
||||
val snackBarView = v.findViewById<View>(R.id.coordination)
|
||||
Snackbar.make(snackBarView, mContext.getString(R.string.noInternet), Snackbar.LENGTH_LONG).setBackgroundTint(ContextCompat.getColor(mContext,
|
||||
Snackbar.make(snackBarView, mContext.get()?.getString(R.string.noInternet) ?: "", Snackbar.LENGTH_LONG).setBackgroundTint(ContextCompat.getColor(mContext.get()!!,
|
||||
R.color.colorError
|
||||
)).show()
|
||||
}
|
||||
@@ -95,11 +96,13 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
||||
}
|
||||
|
||||
override fun onPostExecute(result: Void?) {
|
||||
mView?.let {
|
||||
mView.get()?.let {
|
||||
try {
|
||||
it.findViewById<SwipeRefreshLayout>(R.id.pullToRefresh).isRefreshing = false
|
||||
} catch (ignored: Exception) {}
|
||||
}
|
||||
mView.clear()
|
||||
mContext.clear()
|
||||
}
|
||||
|
||||
private fun requestFoodMenuData() {
|
||||
@@ -184,11 +187,11 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
||||
false
|
||||
)
|
||||
}.forEach { substItem ->
|
||||
notifText += "${if (notifText.isNotEmpty()) ",\n" else ""}${substItem.course}: ${if (substItem.additional.isNotEmpty()) substItem.additional else "---"}"
|
||||
notificationText += "${if (notificationText.isNotEmpty()) ",\n" else ""}${substItem.course}: ${if (substItem.additional.isNotEmpty()) substItem.additional else "---"}"
|
||||
}
|
||||
}
|
||||
|
||||
if (notifText.isNotEmpty()) {
|
||||
if (notificationText.isNotEmpty()) {
|
||||
sendNotification()
|
||||
}
|
||||
|
||||
@@ -197,30 +200,31 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
||||
}
|
||||
|
||||
private fun sendNotification() {
|
||||
val openApp = Intent(mContext, Main::class.java)
|
||||
mContext.get()?.let { c ->
|
||||
val openApp = Intent(c, Main::class.java)
|
||||
openApp.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
openApp.flags += Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
val openAppPending = PendingIntent.getActivity(mContext, 0, openApp, 0)
|
||||
val openAppPending = PendingIntent.getActivity(c, 0, openApp, 0)
|
||||
|
||||
val notificationLayout = RemoteViews(mContext.packageName, R.layout.notification)
|
||||
notificationLayout.setTextViewText(R.id.notification_title, mContext.getString(
|
||||
val notificationLayout = RemoteViews(c.packageName, R.layout.notification)
|
||||
notificationLayout.setTextViewText(R.id.notification_title, c.getString(
|
||||
R.string.substitutionPlan
|
||||
))
|
||||
notificationLayout.setTextViewText(R.id.notification_textview, notifText)
|
||||
notificationLayout.setTextViewText(R.id.notification_textview, notificationText)
|
||||
|
||||
val manager = mContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
val manager = c.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
HelperFunctions.getNotificationChannel(mContext, prefs)
|
||||
HelperFunctions.getNotificationChannel(c, prefs)
|
||||
}
|
||||
|
||||
val notification = NotificationCompat.Builder(mContext, HelperFunctions.notificationChannelId)
|
||||
val notification = NotificationCompat.Builder(c, HelperFunctions.notificationChannelId)
|
||||
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
|
||||
.setCustomContentView(notificationLayout)
|
||||
.setSmallIcon(R.drawable.ic_avh)
|
||||
.setContentIntent(openAppPending)
|
||||
.setAutoCancel(true)
|
||||
.setColor(ContextCompat.getColor(mContext, R.color.colorAccent))
|
||||
.setColor(ContextCompat.getColor(c, R.color.colorAccent))
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
val sound = if ((prefs.getString("ringtoneUri", "") ?: "").isNotEmpty()) {
|
||||
@@ -233,4 +237,5 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
|
||||
|
||||
manager.notify(1, notification.build())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,12 +14,4 @@ internal class FoodViewModel(application: Application) : AndroidViewModel(applic
|
||||
init {
|
||||
allFoods = repository.allFoods
|
||||
}
|
||||
|
||||
fun insert(food: Food) {
|
||||
repository.insert(food)
|
||||
}
|
||||
|
||||
fun deleteAll() {
|
||||
repository.deleteAll()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,14 +22,6 @@ internal class SubstRepository(application: Application) {
|
||||
InsertSubstAsync(substDao).execute(subst)
|
||||
}
|
||||
|
||||
fun update(subst: Subst) {
|
||||
UpdateSubstAsync(substDao).execute(subst)
|
||||
}
|
||||
|
||||
fun delete(subst: Subst) {
|
||||
DeleteSubstAsync(substDao).execute(subst)
|
||||
}
|
||||
|
||||
fun deleteAllSubst() {
|
||||
DeleteAllSubstAsync(substDao).execute()
|
||||
}
|
||||
@@ -42,22 +34,6 @@ internal class SubstRepository(application: Application) {
|
||||
}
|
||||
}
|
||||
|
||||
class UpdateSubstAsync(substDao: SubstDao?) : AsyncTask<Subst, Void, Void>() {
|
||||
private val mSubstDao = substDao
|
||||
override fun doInBackground(vararg substs: Subst): Void? {
|
||||
mSubstDao?.updateSubst(substs[0])
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
class DeleteSubstAsync(substDao: SubstDao?) : AsyncTask<Subst, Void, Void>() {
|
||||
private val mSubstDao = substDao
|
||||
override fun doInBackground(vararg substs: Subst): Void? {
|
||||
mSubstDao?.deleteSubst(substs[0])
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
class DeleteAllSubstAsync(substDao: SubstDao?) : AsyncTask<Void, Void, Void>() {
|
||||
private val mSubstDao = substDao
|
||||
override fun doInBackground(vararg voids: Void): Void? {
|
||||
|
||||
@@ -14,20 +14,4 @@ internal class SubstViewModel(application: Application) : AndroidViewModel(appli
|
||||
init {
|
||||
allSubst = repository.allSubst
|
||||
}
|
||||
|
||||
fun insertSubst(subst: Subst) {
|
||||
repository.insert(subst)
|
||||
}
|
||||
|
||||
fun updateSubst(subst: Subst) {
|
||||
repository.update(subst)
|
||||
}
|
||||
|
||||
fun deleteSubst(subst: Subst) {
|
||||
repository.delete(subst)
|
||||
}
|
||||
|
||||
fun deleteAllSubst() {
|
||||
repository.deleteAllSubst()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:interpolator="@android:anim/accelerate_interpolator"
|
||||
android:ordering="sequentially"
|
||||
android:shareInterpolator="false">
|
||||
<!-- Step 1 -->
|
||||
<objectAnimator
|
||||
android:duration="@android:integer/config_shortAnimTime"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M6.5,12 l0,0 l0,0"
|
||||
android:valueTo="M6.5,12 l3.5,4 l0,0"
|
||||
android:valueType="pathType" />
|
||||
<!-- Step 2 -->
|
||||
<objectAnimator
|
||||
android:duration="@android:integer/config_shortAnimTime"
|
||||
android:propertyName="pathData"
|
||||
android:valueFrom="M6.5,12 l3.5,4 l0,0"
|
||||
android:valueTo="M6.5,12 l3.5,4 l8,-7"
|
||||
android:valueType="pathType" />
|
||||
</set>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_longAnimTime"
|
||||
android:interpolator="@android:anim/overshoot_interpolator">
|
||||
|
||||
<translate
|
||||
android:fromXDelta="-150%"
|
||||
android:toXDelta="0"/>
|
||||
</set>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_longAnimTime"
|
||||
android:interpolator="@android:anim/anticipate_interpolator">
|
||||
|
||||
<translate
|
||||
android:fromXDelta="0%"
|
||||
android:toXDelta="-150%"/>
|
||||
</set>
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<set xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:duration="@android:integer/config_mediumAnimTime"
|
||||
android:interpolator="@android:anim/linear_interpolator">
|
||||
<alpha
|
||||
android:fromAlpha="1.0"
|
||||
android:toAlpha="0.0">
|
||||
</alpha>
|
||||
</set>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.7 KiB |
@@ -1,5 +0,0 @@
|
||||
<vector android:height="120dp" android:viewportHeight="26.073"
|
||||
android:viewportWidth="54.31" android:width="250dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@color/colorSplashLogo"
|
||||
android:pathData="m0.642,26.05c-0.1793,-0.0546 -0.3227,-0.1912 -0.423,-0.4034 -0.0868,-0.1835 -0.1299,-0.3499 -0.18,-0.6953 -0.0644,-0.4438 -0.0501,-2.2083 0.0447,-5.5298 0.0442,-1.5476 0.0862,-2.9233 0.0933,-3.0572l0.013,-0.2434 0.1555,-0.0798c0.0855,-0.0439 0.351,-0.1848 0.59,-0.313 0.6131,-0.329 1.3794,-0.7385 1.597,-0.8535 0.1016,-0.0537 0.2971,-0.1587 0.4346,-0.2334 0.1374,-0.0747 0.3525,-0.1897 0.478,-0.2556 0.5334,-0.2802 1.5092,-0.8133 1.8615,-1.017 0.1116,-0.0645 0.2961,-0.1712 0.4099,-0.237 0.2127,-0.123 0.2696,-0.157 0.4011,-0.2397 0.0418,-0.0263 0.1543,-0.0937 0.2499,-0.1497 0.5553,-0.3255 1.6814,-1.0279 2.6508,-1.6533 0.0597,-0.0386 0.1966,-0.1268 0.3042,-0.1961 1.5001,-0.9666 3.6523,-2.4484 4.954,-3.4109 0.3582,-0.2649 1.7314,-1.2221 2.6279,-1.8318 0.7716,-0.5248 2.8139,-1.8787 3.0062,-1.9929 0.0394,-0.0234 0.2252,-0.1412 0.4128,-0.2616s0.4487,-0.2859 0.5801,-0.3677c0.1315,-0.0817 0.3026,-0.1893 0.3802,-0.239 0.2592,-0.1659 1.2231,-0.7326 1.7869,-1.0506 0.5592,-0.3154 1.4818,-0.7903 1.8091,-0.9313 0.6104,-0.2629 1.1407,-0.4489 1.5055,-0.5279 0.1138,-0.0247 0.214,-0.0492 0.2227,-0.0546 0.0322,-0.0199 0.8012,-0.1391 1.0422,-0.1616 0.979,-0.0913 3.2692,-0.0911 4.313,0.0003 1.4035,0.123 2.2951,0.4492 2.6451,0.9679 0.165,0.2444 0.2002,0.3755 0.2007,0.7474 0.0006,0.411 -0.0696,0.716 -0.284,1.2338 -0.3755,0.907 -1.5233,2.5827 -2.7325,3.9889 -0.9585,1.1147 -1.8375,2.4001 -2.4388,3.5662 -0.2381,0.4618 -0.346,0.7207 -0.5387,1.2928 -0.4305,1.2778 -0.4186,1.6374 0.0757,2.2952 0.4236,0.5637 0.9046,0.8012 1.9082,0.9422 0.0887,0.0125 0.3794,0.0227 0.646,0.0227 1.0896,0 2.4249,-0.253 3.886,-0.7363 0.3467,-0.1147 1.0184,-0.3616 1.2494,-0.4593 0.0538,-0.0227 0.1955,-0.0816 0.3151,-0.1309 0.3765,-0.1551 0.5845,-0.2417 0.6518,-0.2713 0.0358,-0.0158 0.163,-0.0696 0.2825,-0.1195 0.1195,-0.05 0.3102,-0.1304 0.4237,-0.1786 0.1135,-0.0483 0.2895,-0.1216 0.3911,-0.1629 0.1016,-0.0413 0.2433,-0.0998 0.3151,-0.1299 0.0717,-0.0301 0.1988,-0.0819 0.2825,-0.115 0.0837,-0.0331 0.2743,-0.1087 0.4237,-0.168 0.6645,-0.2636 0.8709,-0.3322 1.1652,-0.3875 0.4255,-0.0799 0.6165,0.0135 0.6831,0.3339 0.016,0.0772 0.028,0.4053 0.0319,0.8732 0.0065,0.7894 0.0264,1.0214 0.1199,1.401 0.1968,0.799 0.5825,1.2477 1.3058,1.5194 0.3784,0.1421 1.0799,0.2763 1.6675,0.3188 0.3938,0.0285 1.8687,0.0141 2.2077,-0.0216 1.7553,-0.1848 3.1116,-0.488 4.4108,-0.9862 0.2568,-0.0985 0.7865,-0.3131 0.8691,-0.3522 0.0901,-0.0426 0.2578,-0.1131 0.4128,-0.1737 0.0717,-0.028 0.2135,-0.0867 0.3151,-0.1303 0.1016,-0.0437 0.2433,-0.1025 0.3151,-0.1308 0.0717,-0.0282 0.2135,-0.0867 0.3151,-0.13 0.1016,-0.0433 0.2433,-0.1017 0.3151,-0.13 0.0717,-0.0282 0.2128,-0.0862 0.3135,-0.1288 0.1007,-0.0426 0.1877,-0.0729 0.1932,-0.0674 0.0104,0.0104 0.0053,0.0676 -0.1055,1.1898 -0.071,0.7187 -0.1146,0.9429 -0.2464,1.2663 -0.2098,0.5145 -0.7032,1.0472 -1.5039,1.6232 -0.1778,0.1279 -0.9153,0.6186 -1.0884,0.7241 -1.8174,1.1078 -2.509,1.4324 -3.5921,1.6858 -0.8303,0.1943 -2.059,0.2746 -3.8024,0.2487 -0.9463,-0.0141 -1.1963,-0.026 -1.8252,-0.0868 -0.591,-0.0572 -0.9542,-0.126 -1.3471,-0.2555 -0.4719,-0.1555 -0.6843,-0.2909 -1.1215,-0.7153 -0.1842,-0.1788 -0.387,-0.3584 -0.4505,-0.3991 -0.3994,-0.2555 -0.8111,-0.2864 -1.6111,-0.1208 -0.2518,0.0521 -0.825,0.1934 -1.1081,0.2733 -0.1076,0.0303 -0.3178,0.0881 -0.4672,0.1285 -0.1494,0.0404 -0.4036,0.109 -0.5649,0.1527 -1.0207,0.2759 -2.3356,0.5132 -3.3678,0.6077 -0.9254,0.0847 -2.1742,0.0853 -3.0001,0.001 -0.3103,-0.0315 -1.0002,-0.1322 -1.063,-0.1551 -0.0179,-0.007 -0.1499,-0.0358 -0.2933,-0.0649 -0.1434,-0.0292 -0.3487,-0.0781 -0.4563,-0.1087 -0.2615,-0.0744 -0.886,-0.2842 -0.9973,-0.335 -0.049,-0.0224 -0.1498,-0.0657 -0.224,-0.0963 -0.598,-0.2465 -1.384,-0.7544 -1.8513,-1.1964 -0.9436,-0.8924 -1.3564,-2.0681 -1.2817,-3.6505 0.0193,-0.4081 0.0205,-0.4203 0.0997,-0.9778 0.1124,-0.7911 0.0607,-1.4115 -0.1259,-1.5114 -0.0853,-0.0457 -0.3493,0.0288 -0.7149,0.2015 -0.3416,0.1614 -1.1258,0.5975 -1.4555,0.8094 -0.0418,0.0269 -0.2374,0.1503 -0.4346,0.2742 -0.4157,0.2612 -1.416,0.9297 -1.8686,1.2487 -0.0418,0.0295 -0.1215,0.0853 -0.177,0.1239 -0.0555,0.0387 -0.2154,0.1535 -0.3552,0.255 -0.1399,0.1016 -0.2949,0.2135 -0.3445,0.2487 -0.4102,0.291 -1.4365,1.0783 -2.1109,1.6191 -1.4979,1.2014 -2.884,2.2429 -4.237,3.184 -0.1817,0.1264 -1.0192,0.686 -1.2494,0.8348 -0.4025,0.2603 -0.5367,0.3456 -0.5975,0.3799 -0.0358,0.0202 -0.1727,0.1041 -0.3042,0.1866 -0.1314,0.0824 -0.3172,0.1957 -0.4128,0.2518 -0.0956,0.0561 -0.208,0.1241 -0.2499,0.1512 -0.1088,0.0703 -0.5731,0.339 -0.8909,0.5155 -0.1494,0.083 -0.2814,0.1585 -0.2933,0.1677 -0.0307,0.0238 -0.8824,0.4882 -1.195,0.6517 -0.1434,0.075 -0.3292,0.1731 -0.4128,0.2181 -0.4406,0.2368 -2.7812,1.4179 -3.0311,1.5296 -0.0777,0.0347 -0.1999,0.0901 -0.2716,0.1232 -0.3531,0.1628 -0.8439,0.337 -1.072,0.3807 -0.1687,0.0323 -0.4989,0.038 -0.5903,0.0102z" android:strokeWidth=".021728"/>
|
||||
</vector>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:opacity="opaque">
|
||||
|
||||
<item android:drawable="@color/colorAccent"/>
|
||||
|
||||
<item>
|
||||
<bitmap
|
||||
android:src="@drawable/avhbmp"
|
||||
android:gravity="center"
|
||||
android:scaleType="centerInside"/>
|
||||
</item>
|
||||
|
||||
</layer-list>
|
||||
@@ -3,5 +3,5 @@
|
||||
android:drawable="@drawable/check_mark">
|
||||
<target
|
||||
android:name="tick"
|
||||
android:animation="@anim/check_animation" />
|
||||
android:animation="@animator/check_animation" />
|
||||
</animated-vector>
|
||||
@@ -14,7 +14,6 @@
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/constraintFirst"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layoutAnimation="@anim/layout_animation_fall_down">
|
||||
@@ -215,7 +214,7 @@
|
||||
app:layout_constraintStart_toStartOf="@+id/txtLayoutClasses"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txtLayoutCourses" />
|
||||
|
||||
<LinearLayout android:id="@+id/checkBoxLinearLayout"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
android:elevation="0dp">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:titleTextColor="@color/colorAccent"
|
||||
@@ -67,7 +66,6 @@
|
||||
<include layout="@layout/content_main" />
|
||||
|
||||
<View
|
||||
android:id="@+id/bottom_nav_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="8dp"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
tools:context=".activities.Main"
|
||||
tools:showIn="@layout/app_bar_main"
|
||||
android:id="@+id/content"
|
||||
android:background="@color/colorBackground"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior">
|
||||
|
||||
<androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="@color/colorBackground"
|
||||
tools:context=".fragments.SettingsFragment">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
@@ -115,7 +114,6 @@
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/appTheme"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
@@ -128,6 +126,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:editable="false"
|
||||
android:hint="@string/appTheme"
|
||||
android:textColor="@color/colorText"
|
||||
android:textSize="14sp"/>
|
||||
|
||||
@@ -642,8 +641,7 @@
|
||||
app:layout_constraintBottom_toTopOf="@+id/txtPrivacyP"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txtWhatittook"
|
||||
android:onClick="onClick"/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/txtWhatittook"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtPrivacyP"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
<com.google.android.material.card.MaterialCardView xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/planCard"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
@@ -63,7 +63,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:textColor="@color/colorText"/>
|
||||
android:textColor="@color/colorText"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/teacher"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout 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:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
@@ -48,7 +49,8 @@
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:text="Reset launch counter"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnResetNotif"
|
||||
@@ -61,7 +63,8 @@
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Reset ping counter"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"/>
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@color/colorBackground">
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/linear_food"
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/pullToRefresh"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:background="@color/colorBackground"
|
||||
android:animateLayoutChanges="true">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -28,7 +26,8 @@
|
||||
android:textSize="60dp"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/colorHint"
|
||||
android:visibility="gone"/>
|
||||
android:visibility="gone"
|
||||
tools:ignore="HardcodedText,SpUsage" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/smileydowntext"
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textviewtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:fontFamily="@font/manrope_semibold"
|
||||
android:textSize="22sp"
|
||||
android:layout_gravity="start"
|
||||
android:textColor="@color/colorText"
|
||||
android:textAlignment="viewStart"/>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dialogtext"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:textColor="@color/colorText"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:paddingTop="8dp"
|
||||
android:layout_marginBottom="24dp"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -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/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
@@ -22,7 +20,6 @@
|
||||
app:srcCompat="@drawable/animated_check" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txtHaveFun"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
|
||||
@@ -9,10 +9,8 @@
|
||||
<string name="substitutionPlan">Vertretungsplan</string>
|
||||
<string name="personal">Persönlich</string>
|
||||
<string name="settings">Einstellungen</string>
|
||||
<string name="darkBackground">Dunkler Hintergrund</string>
|
||||
<string name="enableNotifications">Aktiviere Kursbenachrichtigungen</string>
|
||||
<string name="enablesBackgroundSync">Hat keinen Einfluss auf Mitteilungen</string>
|
||||
<string name="personalPlan">Persönlicher Plan</string>
|
||||
<string name="personalise">Personalisieren</string>
|
||||
<string name="misc">Diverses</string>
|
||||
<string name="defaultsToPlan">Standardmäßig ansonsten allgemeiner Plan</string>
|
||||
@@ -35,8 +33,6 @@
|
||||
<string name="haveFun">Viel Spaß!</string>
|
||||
<string name="enableGreeting">Aktiviere Begrüßungen</string>
|
||||
<string name="justBeingNice">Falls du möchtest, dass ich nett bin :)</string>
|
||||
<string name="splan">s Plan</string>
|
||||
<string name="nosplan">\' Plan</string>
|
||||
<string name="licences">Lizenzen</string>
|
||||
<string name="whatItTook">Was die App ausmacht (Englisch)</string>
|
||||
<string name="version">Versionsnummer</string>
|
||||
@@ -44,11 +40,8 @@
|
||||
<string name="tac">AGB</string>
|
||||
<string name="reviewTac">Überprüfe die AGB der App (Englisch)</string>
|
||||
<string name="reviewPrivacy">Überprüfe die Datenschutzerklärung der App (Englisch)</string>
|
||||
<string name="noInfoAvailable">Keine Informationen verfügbar</string>
|
||||
<string name="information">Informationen</string>
|
||||
<string name="madeBy">Entwickelt von Deniz :)</string>
|
||||
<string name="openInfo">Öffne Info bei App-Start</string>
|
||||
<string name="openInfoNoUserInput">Öffnet automatisch ohne Nutzereingabe</string>
|
||||
<string name="autoRefresh">Aktualisiere Plan bei App-Start</string>
|
||||
<string name="ifSyncNotWorking">Falls Hintergrund-Sync nicht funktioniert</string>
|
||||
<string name="enterCoursesHelpTitle">Wie du deine Kurse eintragen kannst</string>
|
||||
@@ -93,7 +86,6 @@
|
||||
<string name="chromeCompatibleNotFound">Kein Chrome-kompatibler Browser gefunden</string>
|
||||
<string name="youtubeNotFound">YouTube-App nicht gefunden</string>
|
||||
<string name="lastUpdated">Zuletzt aktualisiert:</string>
|
||||
<string name="nightMode">Aktiviert den Nachtmodus</string>
|
||||
<string name="yourPlan">Dein Plan</string>
|
||||
<string-array name="greetingsMorning">
|
||||
<item>Hallo, %s!</item>
|
||||
@@ -129,13 +121,10 @@
|
||||
<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>
|
||||
<string name="permissionDenied">Bitte erlaube Speicherzugriff</string>
|
||||
<string name="success">Erfolg</string>
|
||||
<string name="restoreFromFile">von Datei wiederherstellen</string>
|
||||
<string name="or">du kannst auch…</string>
|
||||
<string name="notReceivingNotifications1">Benachrichtigungen kommen nicht an?</string>
|
||||
<string name="notReceivingNotifications2">Klick hier um zu sehen, warum</string>
|
||||
<string name="notReceivingNotificationsHelp">Bemerke, dass diese Tipps insbesondere auf Huawei/Honor-Geräten nicht funktionieren könnten. Du kannst sie trotzdem ausprobieren.\n\nAkkusparfunktionen können dazu führen, dass Benachrichtigungen nicht ankommen. Versuche, Akkusparmodi auf deren Standardeinstellung zu setzen.\n\nEinige Geräte beschränken Apps im Hintergrund. Suche in deinen Geräteeinstellungen unter Apps die Vertretungsplan-App und schaue dann nach einer Einstellung namens \"Hintergrund-Services beschränken\" (oder ähnlich) und stelle sicher, dass diese ausgestellt ist.\n\nBei Schwierigkeiten kann ich auch gerne helfen.</string>
|
||||
|
||||
@@ -11,11 +11,9 @@
|
||||
<string name="settings">Settings</string>
|
||||
|
||||
<!-- for Settings fragment -->
|
||||
<string name="darkBackground">Dark background</string>
|
||||
<string name="enableNotifications">Enable course notifications</string>
|
||||
<string name="enablesBackgroundSync">This does not affect broadcasts</string>
|
||||
|
||||
<string name="personalPlan">Personal Plan</string>
|
||||
<string name="personalise">Personalise</string>
|
||||
<string name="misc">Miscellaneous</string>
|
||||
<string name="personalised">Set personalised plan as default</string>
|
||||
@@ -40,8 +38,6 @@
|
||||
|
||||
<string name="enableGreeting">Enable greeting</string>
|
||||
<string name="justBeingNice">If you want me to be nice :)</string>
|
||||
<string name="splan">\'s Plan</string>
|
||||
<string name="nosplan">\' Plan</string>
|
||||
|
||||
<string name="licences">Licences</string>
|
||||
<string name="whatItTook">What it took to create this app</string>
|
||||
@@ -51,13 +47,10 @@
|
||||
<string name="reviewTac">Review this app\'s Terms & Conditions</string>
|
||||
<string name="privacy">Privacy Policy</string>
|
||||
<string name="reviewPrivacy">Review this app\'s Privacy Policy</string>
|
||||
<string name="noInfoAvailable">No information available</string>
|
||||
<string name="information">Information</string>
|
||||
|
||||
<string name="madeBy">Made by Deniz :)</string>
|
||||
|
||||
<string name="openInfo">Open info panel on startup</string>
|
||||
<string name="openInfoNoUserInput">Opens automatically without user input</string>
|
||||
<string name="autoRefresh">Refresh on startup</string>
|
||||
<string name="ifSyncNotWorking">In case the background sync doesn\'t work</string>
|
||||
|
||||
@@ -105,7 +98,6 @@
|
||||
<string name="chromeCompatibleNotFound">No Chrome-compatible browser found</string>
|
||||
<string name="youtubeNotFound">YouTube app not found</string>
|
||||
<string name="lastUpdated">Last updated:</string>
|
||||
<string name="nightMode">Enables night mode</string>
|
||||
<string name="yourPlan">Your Plan</string>
|
||||
|
||||
<string-array name="greetingsMorning">
|
||||
@@ -142,13 +134,10 @@
|
||||
<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>
|
||||
<string name="permissionDenied">Please enable storage permissions</string>
|
||||
<string name="success">Success</string>
|
||||
<string name="restoreFromFile">Restore from file</string>
|
||||
<string name="or">you may also…</string>
|
||||
<string name="notReceivingNotifications1">Not receiving notifications?</string>
|
||||
<string name="notReceivingNotifications2">Click to see why</string>
|
||||
<string name="notReceivingNotificationsHelp">Note: on Huawei/Honor devices, there may not be a solution to this problem. You\'re welcome to try the tips provided.\n\nBattery saver functions often cause notifications to be delayed or not be received at all. Try setting any battery saving options to their default setting.\n\nSome devices restrict background usage of apps. Please go to your device app settings, select the app and check for a toggle named \"Restrict background usage\" (or similar) and verify that the setting is turned off.\n\nYou\'re also welcome to ask me for help.</string>
|
||||
|
||||
@@ -26,20 +26,6 @@
|
||||
<item name="android:textColorPrimary">@color/colorText</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeLight.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
<item name="colorControlNormal">#000000</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeLight.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
|
||||
<item name="colorControlNormal">#000000</item>
|
||||
</style>
|
||||
|
||||
<style name="EditTextTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
|
||||
<item name="colorControlNormal">@color/colorHint</item>
|
||||
<item name="colorControlActivated">@color/colorAccent</item>
|
||||
<item name="colorControlHighlight">@color/colorAccent</item>
|
||||
</style>
|
||||
|
||||
<!-- Launch / splash screen -->
|
||||
<style name="AppTheme0.Launcher">
|
||||
<item name="android:windowBackground">@drawable/launch_screen</item>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.denizd.substitutionplan;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Example local unit test, which will execute on the development machine (host).
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
public class ExampleUnitTest {
|
||||
@Test
|
||||
public void addition_isCorrect() {
|
||||
assertEquals(4, 2 + 2);
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.3.31'
|
||||
ext.kotlin_version = '1.3.50'
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
@@ -12,7 +12,7 @@ buildscript {
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.gms:google-services:4.3.0'
|
||||
classpath 'com.google.gms:google-services:4.3.2'
|
||||
classpath 'io.fabric.tools:gradle:1.31.0'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user