Add blocked time area deprecation info

This commit is contained in:
Jonas Lochmann 2020-10-26 01:00:00 +01:00
parent 386d695638
commit aa3198c040
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36
4 changed files with 33 additions and 1 deletions

View file

@ -212,6 +212,7 @@ object HintsToShow {
const val TIME_LIMIT_RULE_INTRODUCTION = 8L
const val CONTACTS_INTRO = 16L
const val TIMELIMIT_RULE_MUSTREAD = 32L
const val BLOCKED_TIME_AREAS_OBSOLETE = 64L
}
object ExperimentalFlags {

View file

@ -24,15 +24,20 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.google.android.material.snackbar.Snackbar
import io.timelimit.android.R
import io.timelimit.android.async.Threads
import io.timelimit.android.coroutines.runAsync
import io.timelimit.android.data.Database
import io.timelimit.android.data.customtypes.ImmutableBitmask
import io.timelimit.android.data.model.Category
import io.timelimit.android.data.model.HintsToShow
import io.timelimit.android.data.model.withConfigCopiedToOtherDates
import io.timelimit.android.livedata.map
import io.timelimit.android.livedata.waitForNonNullValue
import io.timelimit.android.logic.DefaultAppLogic
import io.timelimit.android.sync.actions.UpdateCategoryBlockedTimesAction
import io.timelimit.android.ui.main.ActivityViewModel
import io.timelimit.android.ui.main.getActivityViewModel
import io.timelimit.android.ui.mustread.MustReadFragment
import kotlinx.android.synthetic.main.fragment_blocked_time_areas.*
class BlockedTimeAreasFragment : Fragment(), CopyBlockedTimeAreasDialogFragmentListener {
@ -59,6 +64,22 @@ class BlockedTimeAreasFragment : Fragment(), CopyBlockedTimeAreasDialogFragmentL
super.onCreate(savedInstanceState)
items.value = MinuteOfWeekItems
if (savedInstanceState == null) {
database.let { database ->
runAsync {
val wasShown = database.config().wereHintsShown(HintsToShow.BLOCKED_TIME_AREAS_OBSOLETE).waitForNonNullValue()
if (!wasShown) {
MustReadFragment.newInstance(R.string.must_read_blocked_time_areas_obsolete).show(parentFragmentManager)
Threads.database.execute {
database.config().setHintsShownSync(HintsToShow.BLOCKED_TIME_AREAS_OBSOLETE)
}
}
}
}
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {

View file

@ -32,4 +32,9 @@
<string name="must_read_add_already_assigned_apps">
Apps mit Kategorie werden beim Hinzufügen aus der vorherigen Kategorie entfernt - für mehrere Kategorien gleichzeitig können Sie Ober- und Unter-Kategorien verwenden
</string>
<string name="must_read_blocked_time_areas_obsolete">
Die Sperzeiten sind veraltet. Sie können stattdessen Zeitbegrenzungsregeln für
Teile eines Tages mit 0 Minuten Dauer verwenden. Die Sperrzeiten werden in der Zukunft
entfernt werden.
</string>
</resources>

View file

@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="must_read_child_manipulation">
Because some users do not realize it:
\n1st: In the default settings, TimeLimit can be removed easily, even by children.
@ -32,4 +32,9 @@
Apps with category are removed from the previous category when they are added to a new category -
use parent and child categories to \"add\" an App to multiple categories
</string>
<string name="must_read_blocked_time_areas_obsolete" tools:ignore="MissingTranslation">
The blocked time areas are deprecated. You can use time limit rules for parts
of a day with zero minutes usage duration instead. The blocked time areas will be
removed in the future.
</string>
</resources>