diff --git a/app/src/main/java/io/timelimit/android/data/model/ConfigurationItem.kt b/app/src/main/java/io/timelimit/android/data/model/ConfigurationItem.kt index 5fb44e5..15d8336 100644 --- a/app/src/main/java/io/timelimit/android/data/model/ConfigurationItem.kt +++ b/app/src/main/java/io/timelimit/android/data/model/ConfigurationItem.kt @@ -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 { diff --git a/app/src/main/java/io/timelimit/android/ui/manage/category/blocked_times/BlockedTimeAreasFragment.kt b/app/src/main/java/io/timelimit/android/ui/manage/category/blocked_times/BlockedTimeAreasFragment.kt index 4230893..a31fad3 100644 --- a/app/src/main/java/io/timelimit/android/ui/manage/category/blocked_times/BlockedTimeAreasFragment.kt +++ b/app/src/main/java/io/timelimit/android/ui/manage/category/blocked_times/BlockedTimeAreasFragment.kt @@ -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? { diff --git a/app/src/main/res/values-de/strings-must-read.xml b/app/src/main/res/values-de/strings-must-read.xml index c2a7eca..5e472f6 100644 --- a/app/src/main/res/values-de/strings-must-read.xml +++ b/app/src/main/res/values-de/strings-must-read.xml @@ -32,4 +32,9 @@ 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 + + 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. + \ No newline at end of file diff --git a/app/src/main/res/values/strings-must-read.xml b/app/src/main/res/values/strings-must-read.xml index ba00ecf..cb44d13 100644 --- a/app/src/main/res/values/strings-must-read.xml +++ b/app/src/main/res/values/strings-must-read.xml @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . --> - + 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 + + 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. + \ No newline at end of file