2
0
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:
Jeff Boek 2019-05-24 14:27:26 -07:00
parent cce2ebb754
commit c412afec23
3 changed files with 22 additions and 0 deletions

View File

@ -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() {

View File

@ -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>

View File

@ -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>