mirror of
https://github.com/fork-maintainers/iceraven-browser
synced 2024-11-19 09:25:34 +00:00
[fenix] For https://github.com/mozilla-mobile/fenix/issues/225 - Adds button to delete browsing data
This commit is contained in:
parent
cce2ebb754
commit
c412afec23
@ -5,6 +5,7 @@
|
||||
package org.mozilla.fenix.settings
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@ -82,10 +83,16 @@ class DeleteBrowsingDataFragment : Fragment(), CoroutineScope {
|
||||
updateTabCount()
|
||||
updateHistoryCount()
|
||||
updateCollectionsCount()
|
||||
updateDeleteButton()
|
||||
}
|
||||
|
||||
private fun updateDeleteButton() {
|
||||
view?.delete_data?.isEnabled =
|
||||
view!!.open_tabs_item!!.isChecked
|
||||
|| view!!.browsing_data_item!!.isChecked
|
||||
|| view!!.collections_item!!.isChecked
|
||||
|
||||
Log.e("wat", view?.delete_data?.isEnabled.toString())
|
||||
}
|
||||
|
||||
private fun updateTabCount() {
|
||||
|
@ -45,5 +45,18 @@
|
||||
app:deleteBrowsingDataItemIcon="@drawable/ic_collections_circle_background"
|
||||
app:deleteBrowsingDataItemTitle="@string/preferences_delete_browsing_data_collections_title"
|
||||
app:deleteBrowsingDataItemSubtitle="@string/preferences_delete_browsing_data_collections_subtitle" />
|
||||
<Button android:id="@+id/delete_data"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_margin="12dp"
|
||||
android:backgroundTint="?attr/neutral"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:text="@string/preferences_delete_browsing_data_button"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="?attr/accentHighContrast"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
@ -579,4 +579,6 @@
|
||||
<!-- Subtitle for the collections item in Delete browsing data, parameter will be replaced with the
|
||||
number of collections that will be deleted -->
|
||||
<string name="preferences_delete_browsing_data_collections_subtitle">%d collections</string>
|
||||
<!-- Text for the button to delete browsing data -->
|
||||
<string name="preferences_delete_browsing_data_button">Delete browsing data</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user