FCM(q0G5p>`v
z+qc4z8LMV>@--??V}1<1EWH@1KPt)8J=Gs0H3}r=Zh%Q~OW<_**3{DzCl#s3Uv1*X
zK^@ON@fTq$u&x<{>$%joz{aVKE4mSjAgE8S7h=QQnJhme2V`{4_pK23YK1%DrUC2L
z@>)H&jThvAMr75@|F~iPxo&gCz=XacphIrDhE!R@tQ?>9=svo4UXLfsDU~^wQV*^7
z0AfLB^84-yrxcuK7gZ_EUN(m6A3|IFc9OUq>)84KR@wFY!+-0xUJDr5pc>vSJh>*<+R
z@5{zRsN+_69o2I{EcpK^ncQ35`Z-`yf8sAZPmBlU;9I^Rg5htFr44p>_*pNItEDOM
z%H>NDSgv&kzT7n?ro3OI{ShEKd!Ei|D()!*o>xWguWBSs&I)lWY
zfR`A1z6auw;+0jsifK`-Fbm`?T{NPDPk1AbeH-Ul`N4y1Y&pf%PlWukZaQY+;fX&0
zTeZSU>}I32n~4ae)mr6qp`{uF%i=!_Zo)7dgI}U?LkA?sF{$NqOZ5TpV%T5yIm@r$
zBU5$7)4~fXjddcOz@T$Zs07t2b)GEO8{dI88-Wv~=sMi7ds6njyZR&TeGb)1@auW}
zym&vu@d{A0EXm){;ImKOvF-|qA_Lq3*0$AZH0XPOk}${Pfwq*w3|~!L_w`Te-k4{C
zCO!0%r(-)8?z8?J`5^w5S$JpOI{>8Nrvg~^@20TK86v@-0%5b%NWUwIN%h5tbwKbK
zxa*<0vblWHZ=vRcu}*`wN*}qM1>6WqU_V2i%ydvX3u0V)YGE{6`v`JQuJ@qF8PDd8
zVc7JGyL!)XMm7oQGL=Zv^S#?;dC$EN-RXm?t)Js~($xb@tG|uN=l$0Rwcw^U&T@}v
zU-(gnEz5qtqfl@wy<8-%*(-Ct-LFs{MtHyKaPiYJ@R2x1YKhv5twcp;PI~iHe^ORt
zjnW9;Kv@khC?E}JI#^iV)39;{-?By%xIWbwi!eFk2F|yfHFq6>r}L>CCGEv>m4?
zBLz^7dbbe?8!K1XCyLx!FmHcY>f8-{6bW<7F7d54vC;aIsWmo21PGHLVAv@qRA{A(
zy`BuVRk@RV&DXs?RUJT8KCEaJj2oNTQW|ZYiZOrv@@zpKe+8^lQZGB`RYw`CDr-^K
zVY+c<-vu~&wl9|cPVHc}^+hqnGodjHU&K6D+q8&|C^RWPtXo>&N~+jdgfK8ppJP9K<3C{T+9`x>#xrOcCI(r?P#<(LH=s@iN{%?8j4btM0
zi32C@2)!Lz>bh0m2ver&Q125A_i#$rB#JYah~(!<+z=lpF@mrioThT)E+$fydw3!G
z_4uk6e%Q#g);J|BLNBs*T;gNsHS;HirBx5aLnPke3fa#Pv$b%-7ZB11SJOkS8pY3S
zC(&sK*D&tFcEJXwq5VKPABvNh%(pt!o68kl3+ziYfvb7|rs-GsS(t@)NGmN!oH(;E
zWa<>JAVh=?p2s!%MZIjBN1;>HC6dfpU$=wBZVTCIsGF15$SrMMhkerGx
z2N+MEZE0e*LQuF1KSO?c$~cYgcF7l!1Wh|Pt3?0Er8WfCIShfD@a**`K^8iT07<|a
z2stQDml=Rm^hb!&Z+4*TtQb?y8sH`s5=p>>s7vXBv)njb?^GM12x?|(Hn0O$rw!%i
zpD34wxs#qcAq0L7p1&YWe#q?n{W`|Xx-R2HZ=fIh66eMr+X<9=0{t7~an~YvCf{7D
zQBKd8bJD4mdTF2-y)3h+b?7a$T>ACwyz#;P_zC~GVvWxszIvbJLTE^@;a;a*)Yd&W
z0lJI39A71>glq_P%`Mc%k#1SA)V7iZ|1+-Hnr
E2gy_9`~Uy|
literal 0
HcmV?d00001
diff --git a/app/src/main/assets/shared_images/ic_chrome_reader_mode_blue_dark.png b/app/src/main/assets/shared_images/chrome_reader_mode_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_chrome_reader_mode_blue_dark.png
rename to app/src/main/assets/shared_images/chrome_reader_mode_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_chrome_reader_mode_blue_light.png b/app/src/main/assets/shared_images/chrome_reader_mode_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_chrome_reader_mode_blue_light.png
rename to app/src/main/assets/shared_images/chrome_reader_mode_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_chrome_reader_mode_dark.png b/app/src/main/assets/shared_images/chrome_reader_mode_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_chrome_reader_mode_dark.png
rename to app/src/main/assets/shared_images/chrome_reader_mode_dark.png
diff --git a/app/src/main/assets/shared_images/ic_chrome_reader_mode_light.png b/app/src/main/assets/shared_images/chrome_reader_mode_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_chrome_reader_mode_light.png
rename to app/src/main/assets/shared_images/chrome_reader_mode_light.png
diff --git a/app/src/main/assets/shared_images/ic_close_dark.png b/app/src/main/assets/shared_images/close_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_close_dark.png
rename to app/src/main/assets/shared_images/close_dark.png
diff --git a/app/src/main/assets/shared_images/ic_close_light.png b/app/src/main/assets/shared_images/close_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_close_light.png
rename to app/src/main/assets/shared_images/close_light.png
diff --git a/app/src/main/assets/shared_images/ic_delete_dark.png b/app/src/main/assets/shared_images/delete_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_delete_dark.png
rename to app/src/main/assets/shared_images/delete_dark.png
diff --git a/app/src/main/assets/shared_images/ic_delete_forever_dark.png b/app/src/main/assets/shared_images/delete_forever_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_delete_forever_dark.png
rename to app/src/main/assets/shared_images/delete_forever_dark.png
diff --git a/app/src/main/assets/shared_images/ic_delete_forever_light.png b/app/src/main/assets/shared_images/delete_forever_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_delete_forever_light.png
rename to app/src/main/assets/shared_images/delete_forever_light.png
diff --git a/app/src/main/assets/shared_images/ic_delete_light.png b/app/src/main/assets/shared_images/delete_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_delete_light.png
rename to app/src/main/assets/shared_images/delete_light.png
diff --git a/app/src/main/assets/shared_images/ic_devices_other_blue_dark.png b/app/src/main/assets/shared_images/devices_other_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_devices_other_blue_dark.png
rename to app/src/main/assets/shared_images/devices_other_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_devices_other_blue_light.png b/app/src/main/assets/shared_images/devices_other_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_devices_other_blue_light.png
rename to app/src/main/assets/shared_images/devices_other_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_devices_other_dark.png b/app/src/main/assets/shared_images/devices_other_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_devices_other_dark.png
rename to app/src/main/assets/shared_images/devices_other_dark.png
diff --git a/app/src/main/assets/shared_images/ic_devices_other_light.png b/app/src/main/assets/shared_images/devices_other_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_devices_other_light.png
rename to app/src/main/assets/shared_images/devices_other_light.png
diff --git a/app/src/main/assets/shared_images/ic_dns_blue_dark.png b/app/src/main/assets/shared_images/dns_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_dns_blue_dark.png
rename to app/src/main/assets/shared_images/dns_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_dns_blue_light.png b/app/src/main/assets/shared_images/dns_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_dns_blue_light.png
rename to app/src/main/assets/shared_images/dns_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_dns_dark.png b/app/src/main/assets/shared_images/dns_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_dns_dark.png
rename to app/src/main/assets/shared_images/dns_dark.png
diff --git a/app/src/main/assets/shared_images/ic_dns_light.png b/app/src/main/assets/shared_images/dns_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_dns_light.png
rename to app/src/main/assets/shared_images/dns_light.png
diff --git a/app/src/main/assets/shared_images/ic_donut_small_dark.png b/app/src/main/assets/shared_images/donut_small_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_donut_small_dark.png
rename to app/src/main/assets/shared_images/donut_small_dark.png
diff --git a/app/src/main/assets/shared_images/ic_donut_small_light.png b/app/src/main/assets/shared_images/donut_small_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_donut_small_light.png
rename to app/src/main/assets/shared_images/donut_small_light.png
diff --git a/app/src/main/assets/shared_images/ic_edit_dark.png b/app/src/main/assets/shared_images/edit_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_edit_dark.png
rename to app/src/main/assets/shared_images/edit_dark.png
diff --git a/app/src/main/assets/shared_images/ic_edit_light.png b/app/src/main/assets/shared_images/edit_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_edit_light.png
rename to app/src/main/assets/shared_images/edit_light.png
diff --git a/app/src/main/assets/shared_images/ic_expand_less_dark.png b/app/src/main/assets/shared_images/expand_less_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_expand_less_dark.png
rename to app/src/main/assets/shared_images/expand_less_dark.png
diff --git a/app/src/main/assets/shared_images/ic_expand_less_light.png b/app/src/main/assets/shared_images/expand_less_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_expand_less_light.png
rename to app/src/main/assets/shared_images/expand_less_light.png
diff --git a/app/src/main/assets/shared_images/ic_expand_more_dark.png b/app/src/main/assets/shared_images/expand_more_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_expand_more_dark.png
rename to app/src/main/assets/shared_images/expand_more_dark.png
diff --git a/app/src/main/assets/shared_images/ic_expand_more_light.png b/app/src/main/assets/shared_images/expand_more_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_expand_more_light.png
rename to app/src/main/assets/shared_images/expand_more_light.png
diff --git a/app/src/main/assets/shared_images/ic_file_download_dark.png b/app/src/main/assets/shared_images/file_download_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_file_download_dark.png
rename to app/src/main/assets/shared_images/file_download_dark.png
diff --git a/app/src/main/assets/shared_images/ic_file_download_light.png b/app/src/main/assets/shared_images/file_download_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_file_download_light.png
rename to app/src/main/assets/shared_images/file_download_light.png
diff --git a/app/src/main/assets/shared_images/ic_find_in_page_dark.png b/app/src/main/assets/shared_images/find_in_page_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_find_in_page_dark.png
rename to app/src/main/assets/shared_images/find_in_page_dark.png
diff --git a/app/src/main/assets/shared_images/ic_find_in_page_light.png b/app/src/main/assets/shared_images/find_in_page_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_find_in_page_light.png
rename to app/src/main/assets/shared_images/find_in_page_light.png
diff --git a/app/src/main/assets/shared_images/ic_folder_dark.png b/app/src/main/assets/shared_images/folder_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_folder_dark.png
rename to app/src/main/assets/shared_images/folder_dark.png
diff --git a/app/src/main/assets/shared_images/ic_folder_light.png b/app/src/main/assets/shared_images/folder_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_folder_light.png
rename to app/src/main/assets/shared_images/folder_light.png
diff --git a/app/src/main/assets/shared_images/ic_fullscreen_dark.png b/app/src/main/assets/shared_images/fullscreen_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_fullscreen_dark.png
rename to app/src/main/assets/shared_images/fullscreen_dark.png
diff --git a/app/src/main/assets/shared_images/ic_fullscreen_light.png b/app/src/main/assets/shared_images/fullscreen_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_fullscreen_light.png
rename to app/src/main/assets/shared_images/fullscreen_light.png
diff --git a/app/src/main/assets/shared_images/ic_home_dark.png b/app/src/main/assets/shared_images/home_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_home_dark.png
rename to app/src/main/assets/shared_images/home_dark.png
diff --git a/app/src/main/assets/shared_images/ic_home_light.png b/app/src/main/assets/shared_images/home_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_home_light.png
rename to app/src/main/assets/shared_images/home_light.png
diff --git a/app/src/main/assets/shared_images/ic_image_dark.png b/app/src/main/assets/shared_images/image_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_image_dark.png
rename to app/src/main/assets/shared_images/image_dark.png
diff --git a/app/src/main/assets/shared_images/ic_image_light.png b/app/src/main/assets/shared_images/image_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_image_light.png
rename to app/src/main/assets/shared_images/image_light.png
diff --git a/app/src/main/assets/shared_images/ic_import_contacts_dark.png b/app/src/main/assets/shared_images/import_contacts_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_import_contacts_dark.png
rename to app/src/main/assets/shared_images/import_contacts_dark.png
diff --git a/app/src/main/assets/shared_images/ic_import_contacts_light.png b/app/src/main/assets/shared_images/import_contacts_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_import_contacts_light.png
rename to app/src/main/assets/shared_images/import_contacts_light.png
diff --git a/app/src/main/assets/shared_images/ic_important_devices_dark.png b/app/src/main/assets/shared_images/important_devices_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_important_devices_dark.png
rename to app/src/main/assets/shared_images/important_devices_dark.png
diff --git a/app/src/main/assets/shared_images/ic_important_devices_light.png b/app/src/main/assets/shared_images/important_devices_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_important_devices_light.png
rename to app/src/main/assets/shared_images/important_devices_light.png
diff --git a/app/src/main/assets/shared_images/ic_info_outline_dark.png b/app/src/main/assets/shared_images/info_outline_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_info_outline_dark.png
rename to app/src/main/assets/shared_images/info_outline_dark.png
diff --git a/app/src/main/assets/shared_images/ic_info_outline_light.png b/app/src/main/assets/shared_images/info_outline_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_info_outline_light.png
rename to app/src/main/assets/shared_images/info_outline_light.png
diff --git a/app/src/main/assets/shared_images/ic_language_dark.png b/app/src/main/assets/shared_images/language_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_language_dark.png
rename to app/src/main/assets/shared_images/language_dark.png
diff --git a/app/src/main/assets/shared_images/ic_language_light.png b/app/src/main/assets/shared_images/language_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_language_light.png
rename to app/src/main/assets/shared_images/language_light.png
diff --git a/app/src/main/assets/shared_images/ic_list_dark.png b/app/src/main/assets/shared_images/list_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_list_dark.png
rename to app/src/main/assets/shared_images/list_dark.png
diff --git a/app/src/main/assets/shared_images/ic_list_light.png b/app/src/main/assets/shared_images/list_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_list_light.png
rename to app/src/main/assets/shared_images/list_light.png
diff --git a/app/src/main/assets/shared_images/ic_local_activity_dark.png b/app/src/main/assets/shared_images/local_activity_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_local_activity_dark.png
rename to app/src/main/assets/shared_images/local_activity_dark.png
diff --git a/app/src/main/assets/shared_images/ic_local_activity_light.png b/app/src/main/assets/shared_images/local_activity_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_local_activity_light.png
rename to app/src/main/assets/shared_images/local_activity_light.png
diff --git a/app/src/main/assets/shared_images/ic_location_off_blue_dark.png b/app/src/main/assets/shared_images/location_off_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_location_off_blue_dark.png
rename to app/src/main/assets/shared_images/location_off_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_location_off_blue_light.png b/app/src/main/assets/shared_images/location_off_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_location_off_blue_light.png
rename to app/src/main/assets/shared_images/location_off_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_location_off_dark.png b/app/src/main/assets/shared_images/location_off_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_location_off_dark.png
rename to app/src/main/assets/shared_images/location_off_dark.png
diff --git a/app/src/main/assets/shared_images/ic_location_off_light.png b/app/src/main/assets/shared_images/location_off_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_location_off_light.png
rename to app/src/main/assets/shared_images/location_off_light.png
diff --git a/app/src/main/assets/shared_images/ic_lock_dark.png b/app/src/main/assets/shared_images/lock_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_lock_dark.png
rename to app/src/main/assets/shared_images/lock_dark.png
diff --git a/app/src/main/assets/shared_images/ic_lock_light.png b/app/src/main/assets/shared_images/lock_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_lock_light.png
rename to app/src/main/assets/shared_images/lock_light.png
diff --git a/app/src/main/assets/shared_images/ic_map_blue_dark.png b/app/src/main/assets/shared_images/map_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_map_blue_dark.png
rename to app/src/main/assets/shared_images/map_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_map_blue_light.png b/app/src/main/assets/shared_images/map_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_map_blue_light.png
rename to app/src/main/assets/shared_images/map_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_map_dark.png b/app/src/main/assets/shared_images/map_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_map_dark.png
rename to app/src/main/assets/shared_images/map_dark.png
diff --git a/app/src/main/assets/shared_images/ic_map_light.png b/app/src/main/assets/shared_images/map_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_map_light.png
rename to app/src/main/assets/shared_images/map_light.png
diff --git a/app/src/main/assets/shared_images/ic_more_blue_dark.png b/app/src/main/assets/shared_images/more_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_more_blue_dark.png
rename to app/src/main/assets/shared_images/more_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_more_blue_light.png b/app/src/main/assets/shared_images/more_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_more_blue_light.png
rename to app/src/main/assets/shared_images/more_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_more_dark.png b/app/src/main/assets/shared_images/more_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_more_dark.png
rename to app/src/main/assets/shared_images/more_dark.png
diff --git a/app/src/main/assets/shared_images/ic_more_light.png b/app/src/main/assets/shared_images/more_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_more_light.png
rename to app/src/main/assets/shared_images/more_light.png
diff --git a/app/src/main/assets/shared_images/ic_question_answer_blue_dark.png b/app/src/main/assets/shared_images/question_answer_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_question_answer_blue_dark.png
rename to app/src/main/assets/shared_images/question_answer_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_question_answer_blue_light.png b/app/src/main/assets/shared_images/question_answer_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_question_answer_blue_light.png
rename to app/src/main/assets/shared_images/question_answer_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_question_answer_dark.png b/app/src/main/assets/shared_images/question_answer_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_question_answer_dark.png
rename to app/src/main/assets/shared_images/question_answer_dark.png
diff --git a/app/src/main/assets/shared_images/ic_question_answer_light.png b/app/src/main/assets/shared_images/question_answer_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_question_answer_light.png
rename to app/src/main/assets/shared_images/question_answer_light.png
diff --git a/app/src/main/assets/shared_images/ic_refresh_dark.png b/app/src/main/assets/shared_images/refresh_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_refresh_dark.png
rename to app/src/main/assets/shared_images/refresh_dark.png
diff --git a/app/src/main/assets/shared_images/ic_refresh_light.png b/app/src/main/assets/shared_images/refresh_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_refresh_light.png
rename to app/src/main/assets/shared_images/refresh_light.png
diff --git a/app/src/main/assets/shared_images/ic_search_dark.png b/app/src/main/assets/shared_images/search_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_search_dark.png
rename to app/src/main/assets/shared_images/search_dark.png
diff --git a/app/src/main/assets/shared_images/ic_search_light.png b/app/src/main/assets/shared_images/search_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_search_light.png
rename to app/src/main/assets/shared_images/search_light.png
diff --git a/app/src/main/assets/shared_images/ic_select_all_dark.png b/app/src/main/assets/shared_images/select_all_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_select_all_dark.png
rename to app/src/main/assets/shared_images/select_all_dark.png
diff --git a/app/src/main/assets/shared_images/ic_select_all_light.png b/app/src/main/assets/shared_images/select_all_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_select_all_light.png
rename to app/src/main/assets/shared_images/select_all_light.png
diff --git a/app/src/main/assets/shared_images/ic_settings_dark.png b/app/src/main/assets/shared_images/settings_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_settings_dark.png
rename to app/src/main/assets/shared_images/settings_dark.png
diff --git a/app/src/main/assets/shared_images/ic_settings_light.png b/app/src/main/assets/shared_images/settings_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_settings_light.png
rename to app/src/main/assets/shared_images/settings_light.png
diff --git a/app/src/main/assets/shared_images/ic_smartphone_dark.png b/app/src/main/assets/shared_images/smartphone_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_smartphone_dark.png
rename to app/src/main/assets/shared_images/smartphone_dark.png
diff --git a/app/src/main/assets/shared_images/ic_smartphone_light.png b/app/src/main/assets/shared_images/smartphone_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_smartphone_light.png
rename to app/src/main/assets/shared_images/smartphone_light.png
diff --git a/app/src/main/assets/shared_images/ic_style_dark.png b/app/src/main/assets/shared_images/style_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_style_dark.png
rename to app/src/main/assets/shared_images/style_dark.png
diff --git a/app/src/main/assets/shared_images/ic_style_light.png b/app/src/main/assets/shared_images/style_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_style_light.png
rename to app/src/main/assets/shared_images/style_light.png
diff --git a/app/src/main/assets/shared_images/ic_subtitles_blue_dark.png b/app/src/main/assets/shared_images/subtitles_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_subtitles_blue_dark.png
rename to app/src/main/assets/shared_images/subtitles_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_subtitles_blue_light.png b/app/src/main/assets/shared_images/subtitles_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_subtitles_blue_light.png
rename to app/src/main/assets/shared_images/subtitles_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_subtitles_dark.png b/app/src/main/assets/shared_images/subtitles_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_subtitles_dark.png
rename to app/src/main/assets/shared_images/subtitles_dark.png
diff --git a/app/src/main/assets/shared_images/ic_subtitles_light.png b/app/src/main/assets/shared_images/subtitles_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_subtitles_light.png
rename to app/src/main/assets/shared_images/subtitles_light.png
diff --git a/app/src/main/assets/shared_images/ic_text_fields_dark.png b/app/src/main/assets/shared_images/text_fields_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_text_fields_dark.png
rename to app/src/main/assets/shared_images/text_fields_dark.png
diff --git a/app/src/main/assets/shared_images/ic_text_fields_light.png b/app/src/main/assets/shared_images/text_fields_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_text_fields_light.png
rename to app/src/main/assets/shared_images/text_fields_light.png
diff --git a/app/src/main/assets/shared_images/ic_thumbs_up_down_dark.png b/app/src/main/assets/shared_images/thumbs_up_down_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_thumbs_up_down_dark.png
rename to app/src/main/assets/shared_images/thumbs_up_down_dark.png
diff --git a/app/src/main/assets/shared_images/ic_thumbs_up_down_light.png b/app/src/main/assets/shared_images/thumbs_up_down_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_thumbs_up_down_light.png
rename to app/src/main/assets/shared_images/thumbs_up_down_light.png
diff --git a/app/src/main/assets/shared_images/ic_vertical_align_bottom_dark.png b/app/src/main/assets/shared_images/vertical_align_bottom_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vertical_align_bottom_dark.png
rename to app/src/main/assets/shared_images/vertical_align_bottom_dark.png
diff --git a/app/src/main/assets/shared_images/ic_vertical_align_bottom_light.png b/app/src/main/assets/shared_images/vertical_align_bottom_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vertical_align_bottom_light.png
rename to app/src/main/assets/shared_images/vertical_align_bottom_light.png
diff --git a/app/src/main/assets/shared_images/ic_vertical_align_top_dark.png b/app/src/main/assets/shared_images/vertical_align_top_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vertical_align_top_dark.png
rename to app/src/main/assets/shared_images/vertical_align_top_dark.png
diff --git a/app/src/main/assets/shared_images/ic_vertical_align_top_light.png b/app/src/main/assets/shared_images/vertical_align_top_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vertical_align_top_light.png
rename to app/src/main/assets/shared_images/vertical_align_top_light.png
diff --git a/app/src/main/assets/shared_images/ic_visibility_off_dark.png b/app/src/main/assets/shared_images/visibility_off_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_visibility_off_dark.png
rename to app/src/main/assets/shared_images/visibility_off_dark.png
diff --git a/app/src/main/assets/shared_images/ic_visibility_off_light.png b/app/src/main/assets/shared_images/visibility_off_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_visibility_off_light.png
rename to app/src/main/assets/shared_images/visibility_off_light.png
diff --git a/app/src/main/assets/shared_images/ic_vpn_lock_blue_dark.png b/app/src/main/assets/shared_images/vpn_lock_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vpn_lock_blue_dark.png
rename to app/src/main/assets/shared_images/vpn_lock_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_vpn_lock_blue_light.png b/app/src/main/assets/shared_images/vpn_lock_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vpn_lock_blue_light.png
rename to app/src/main/assets/shared_images/vpn_lock_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_vpn_lock_dark.png b/app/src/main/assets/shared_images/vpn_lock_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vpn_lock_dark.png
rename to app/src/main/assets/shared_images/vpn_lock_dark.png
diff --git a/app/src/main/assets/shared_images/ic_vpn_lock_light.png b/app/src/main/assets/shared_images/vpn_lock_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_vpn_lock_light.png
rename to app/src/main/assets/shared_images/vpn_lock_light.png
diff --git a/app/src/main/assets/shared_images/ic_web_blue_dark.png b/app/src/main/assets/shared_images/web_blue_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_web_blue_dark.png
rename to app/src/main/assets/shared_images/web_blue_dark.png
diff --git a/app/src/main/assets/shared_images/ic_web_blue_light.png b/app/src/main/assets/shared_images/web_blue_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_web_blue_light.png
rename to app/src/main/assets/shared_images/web_blue_light.png
diff --git a/app/src/main/assets/shared_images/ic_web_dark.png b/app/src/main/assets/shared_images/web_dark.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_web_dark.png
rename to app/src/main/assets/shared_images/web_dark.png
diff --git a/app/src/main/assets/shared_images/ic_web_light.png b/app/src/main/assets/shared_images/web_light.png
similarity index 100%
rename from app/src/main/assets/shared_images/ic_web_light.png
rename to app/src/main/assets/shared_images/web_light.png
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java
index 0f6df3df..ca71d59c 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/AboutActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -28,6 +28,7 @@ import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
+import android.view.WindowManager;
import com.stoutner.privacybrowser.fragments.AboutTabFragment;
import com.stoutner.privacybrowser.R;
@@ -35,6 +36,11 @@ import com.stoutner.privacybrowser.R;
public class AboutActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the theme.
if (MainWebViewActivity.darkTheme) {
setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
index 2f6738cd..35a1eff6 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -43,6 +43,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.widget.AbsListView;
import android.widget.CursorAdapter;
import android.widget.EditText;
@@ -103,6 +104,11 @@ public class BookmarksActivity extends AppCompatActivity implements CreateBookma
@Override
protected void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the activity theme.
if (MainWebViewActivity.darkTheme) {
setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java
index a61391db..d66ae03c 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/BookmarksDatabaseViewActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -39,6 +39,7 @@ import android.support.v7.app.AppCompatDialogFragment;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ImageView;
@@ -79,6 +80,11 @@ public class BookmarksDatabaseViewActivity extends AppCompatActivity implements
@Override
public void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the activity theme.
if (MainWebViewActivity.darkTheme) {
setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java
index 430bf90e..77cde1fa 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/DomainsActivity.java
@@ -39,6 +39,7 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.widget.CursorAdapter;
import android.widget.EditText;
import android.widget.ListView;
@@ -110,6 +111,11 @@ public class DomainsActivity extends AppCompatActivity implements AddDomainDialo
@Override
protected void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the activity theme.
if (MainWebViewActivity.darkTheme) {
setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/GuideActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/GuideActivity.java
index 3e45bedc..856aa5d5 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/GuideActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/GuideActivity.java
@@ -28,6 +28,7 @@ import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
+import android.view.WindowManager;
import com.stoutner.privacybrowser.fragments.GuideTabFragment;
import com.stoutner.privacybrowser.R;
@@ -35,6 +36,11 @@ import com.stoutner.privacybrowser.R;
public class GuideActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the theme.
if (MainWebViewActivity.darkTheme) {
setTheme(R.style.PrivacyBrowserDark_SecondaryActivity);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
index 02b70255..4905321b 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/MainWebViewActivity.java
@@ -149,7 +149,7 @@ import java.util.Set;
// AppCompatActivity from android.support.v7.app.AppCompatActivity must be used to have access to the SupportActionBar until the minimum API is >= 21.
public class MainWebViewActivity extends AppCompatActivity implements CreateBookmarkDialog.CreateBookmarkListener, CreateBookmarkFolderDialog.CreateBookmarkFolderListener,
- CreateHomeScreenShortcutDialog.CreateHomeScreenSchortcutListener, DownloadFileDialog.DownloadFileListener, DownloadImageDialog.DownloadImageListener,
+ CreateHomeScreenShortcutDialog.CreateHomeScreenShortcutListener, DownloadFileDialog.DownloadFileListener, DownloadImageDialog.DownloadImageListener,
DownloadLocationPermissionDialog.DownloadLocationPermissionDialogListener, EditBookmarkDialog.EditBookmarkListener, EditBookmarkFolderDialog.EditBookmarkFolderListener,
HttpAuthenticationDialog.HttpAuthenticationListener, NavigationView.OnNavigationItemSelectedListener, PinnedSslCertificateMismatchDialog.PinnedSslCertificateMismatchListener,
SslCertificateErrorDialog.SslCertificateErrorListener, UrlHistoryDialog.UrlHistoryListener {
@@ -160,6 +160,9 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
// and `OrbotProxyHelper`. It is also used in `onCreate()`, `applyAppSettings()`, `applyDomainSettings()`, and `updatePrivacyIcons()`.
public static boolean darkTheme;
+ // `allowScreenshots` is public static so it can be accessed from everywhere. It is also used in `onCreate()`.
+ public static boolean allowScreenshots;
+
// `favoriteIconBitmap` is public static so it can be accessed from `CreateHomeScreenShortcutDialog`, `BookmarksActivity`, `BookmarksDatabaseViewActivity`, `CreateBookmarkDialog`,
// `CreateBookmarkFolderDialog`, `EditBookmarkDialog`, `EditBookmarkFolderDialog`, `EditBookmarkDatabaseViewDialog`, and `ViewSslCertificateDialog`. It is also used in `onCreate()`,
// `onCreateBookmark()`, `onCreateBookmarkFolder()`, `onCreateHomeScreenShortcutCreate()`, `onSaveEditBookmark()`, `onSaveEditBookmarkFolder()`, and `applyDomainSettings()`.
@@ -429,11 +432,17 @@ public class MainWebViewActivity extends AppCompatActivity implements CreateBook
// Remove Android Studio's warning about deprecations. We have to use the deprecated `getColor()` until API >= 23.
@SuppressWarnings("deprecation")
protected void onCreate(Bundle savedInstanceState) {
- // Get a handle for `sharedPreferences`. `this` references the current context.
+ // Get a handle for the shared preferences.
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
- // Get the theme preference.
+ // Get the theme and screenshot preferences.
darkTheme = sharedPreferences.getBoolean("dark_theme", false);
+ allowScreenshots = sharedPreferences.getBoolean("allow_screenshots", false);
+
+ // Disable screenshots if not allowed.
+ if (!allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
// Set the activity theme.
if (darkTheme) {
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/SettingsActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/SettingsActivity.java
index e1592a63..2e87c400 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/SettingsActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/SettingsActivity.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -22,6 +22,7 @@ package com.stoutner.privacybrowser.activities;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.support.v7.app.AppCompatActivity;
+import android.view.WindowManager;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.fragments.SettingsFragment;
@@ -29,6 +30,11 @@ import com.stoutner.privacybrowser.fragments.SettingsFragment;
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the activity theme.
if (MainWebViewActivity.darkTheme) {
setTheme(R.style.PrivacyBrowserSettingsDark);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.java b/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.java
index 583e3c6a..9ed2642e 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/activities/ViewSourceActivity.java
@@ -42,6 +42,7 @@ import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
+import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.webkit.CookieManager;
import android.widget.EditText;
@@ -70,6 +71,11 @@ public class ViewSourceActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the theme.
if (MainWebViewActivity.darkTheme) {
setTheme(R.style.PrivacyBrowserDark);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.java
index 618406c2..7edc2db0 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AboutViewSourceDialog.java
@@ -23,6 +23,7 @@ import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
+import android.view.WindowManager;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.activities.MainWebViewActivity;
@@ -51,7 +52,19 @@ public class AboutViewSourceDialog extends DialogFragment {
// Set the text.
dialogBuilder.setMessage(R.string.about_view_source_message);
+ // Create an alert dialog from the alert dialog builder.
+ final AlertDialog alertDialog = dialogBuilder.create();
+
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// `onCreateDialog` requires the return of an `AlertDialog`.
- return dialogBuilder.create();
+ return alertDialog;
}
}
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.java
index 292ef453..c67c3aed 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.java
@@ -68,7 +68,7 @@ public class AddDomainDialog extends AppCompatDialogFragment {
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -101,9 +101,14 @@ public class AddDomainDialog extends AppCompatDialogFragment {
// Create an alert dialog from the builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might be null.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Show the keyboard when the alert dialog is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.java
index b2966c14..caadd02a 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -81,33 +81,34 @@ public class CreateBookmarkDialog extends AppCompatDialogFragment {
dialogBuilder.setTitle(R.string.create_bookmark);
dialogBuilder.setIcon(favoriteIconDrawable);
+ // Remove the warning below that `getLayoutInflater()` might be null.
+ assert getActivity() != null;
+
// Set the view. The parent view is `null` because it will be assigned by the `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.create_bookmark_dialog, null));
// Set an `onClick()` listener for the negative button.
- dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Do nothing. The `AlertDialog` will close automatically.
- }
+ dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
+ // Do nothing. The `AlertDialog` will close automatically.
});
// Set an `onClick()` listener for the positive button.
- dialogBuilder.setPositiveButton(R.string.create, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Return the `DialogFragment` to the parent activity.
- createBookmarkListener.onCreateBookmark(CreateBookmarkDialog.this);
- }
+ dialogBuilder.setPositiveButton(R.string.create, (DialogInterface dialog, int which) -> {
+ // Return the `DialogFragment` to the parent activity.
+ createBookmarkListener.onCreateBookmark(CreateBookmarkDialog.this);
});
-
// Create an `AlertDialog` from the `AlertDialog.Builder`.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Show the keyboard when the `AlertDialog` is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
@@ -115,50 +116,46 @@ public class CreateBookmarkDialog extends AppCompatDialogFragment {
alertDialog.show();
// Get a handle for `create_bookmark_name_edittext`.
- EditText createBookmarkNameEditText = (EditText) alertDialog.findViewById(R.id.create_bookmark_name_edittext);
+ EditText createBookmarkNameEditText = alertDialog.findViewById(R.id.create_bookmark_name_edittext);
// Set the current `WebView` title as the text for `create_bookmark_name_edittext`.
createBookmarkNameEditText.setText(MainWebViewActivity.webViewTitle);
// Allow the `enter` key on the keyboard to create the bookmark from `create_bookmark_name_edittext`.
- createBookmarkNameEditText.setOnKeyListener(new View.OnKeyListener() {
- public boolean onKey(View view, int keyCode, KeyEvent event) {
- // If the event is a key-down on the `enter` key, select the `PositiveButton` `Create`.
- if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
- // Trigger `createBookmarkListener` and return the `DialogFragment` to the parent activity.
- createBookmarkListener.onCreateBookmark(CreateBookmarkDialog.this);
-
- // Manually dismiss the `AlertDialog`.
- alertDialog.dismiss();
-
- // Consume the event.
- return true;
- } else { // If any other key was pressed, do not consume the event.
- return false;
- }
+ createBookmarkNameEditText.setOnKeyListener((View view, int keyCode, KeyEvent event) -> {
+ // If the event is a key-down on the `enter` key, select the `PositiveButton` `Create`.
+ if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
+ // Trigger `createBookmarkListener` and return the `DialogFragment` to the parent activity.
+ createBookmarkListener.onCreateBookmark(CreateBookmarkDialog.this);
+
+ // Manually dismiss the `AlertDialog`.
+ alertDialog.dismiss();
+
+ // Consume the event.
+ return true;
+ } else { // If any other key was pressed, do not consume the event.
+ return false;
}
});
// Set the formattedUrlString as the initial text of `create_bookmark_url_edittext`.
- EditText createBookmarkUrlEditText = (EditText) alertDialog.findViewById(R.id.create_bookmark_url_edittext);
+ EditText createBookmarkUrlEditText = alertDialog.findViewById(R.id.create_bookmark_url_edittext);
createBookmarkUrlEditText.setText(MainWebViewActivity.formattedUrlString);
// Allow the `enter` key on the keyboard to create the bookmark from `create_bookmark_url_edittext`.
- createBookmarkUrlEditText.setOnKeyListener(new View.OnKeyListener() {
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- // If the event is a key-down on the "enter" key, select the PositiveButton "Create".
- if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
- // Trigger `createBookmarkListener` and return the DialogFragment to the parent activity.
- createBookmarkListener.onCreateBookmark(CreateBookmarkDialog.this);
-
- // Manually dismiss the `AlertDialog`.
- alertDialog.dismiss();
-
- // Consume the event.
- return true;
- } else { // If any other key was pressed, do not consume the event.
- return false;
- }
+ createBookmarkUrlEditText.setOnKeyListener((View v, int keyCode, KeyEvent event) -> {
+ // If the event is a key-down on the "enter" key, select the PositiveButton "Create".
+ if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
+ // Trigger `createBookmarkListener` and return the DialogFragment to the parent activity.
+ createBookmarkListener.onCreateBookmark(CreateBookmarkDialog.this);
+
+ // Manually dismiss the `AlertDialog`.
+ alertDialog.dismiss();
+
+ // Consume the event.
+ return true;
+ } else { // If any other key was pressed, do not consume the event.
+ return false;
}
});
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.java
index 7954478e..98fb9dcb 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateBookmarkFolderDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -67,7 +67,7 @@ public class CreateBookmarkFolderDialog extends AppCompatDialogFragment {
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -80,33 +80,35 @@ public class CreateBookmarkFolderDialog extends AppCompatDialogFragment {
// Set the title.
dialogBuilder.setTitle(R.string.create_folder);
+ // Remove the warning below that `getLayoutInflater()` might be null.
+ assert getActivity() != null;
+
// Set the view. The parent view is `null` because it will be assigned by the `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.create_bookmark_folder_dialog, null));
// Set an `onClick()` listener for the negative button.
- dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Do nothing. The `AlertDialog` will close automatically.
- }
+ dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
+ // Do nothing. The `AlertDialog` will close automatically.
});
// Set an `onClick()` listener fo the positive button.
- dialogBuilder.setPositiveButton(R.string.create, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Return the `DialogFragment` to the parent activity on create.
- createBookmarkFolderListener.onCreateBookmarkFolder(CreateBookmarkFolderDialog.this);
- }
+ dialogBuilder.setPositiveButton(R.string.create, (DialogInterface dialog, int which) -> {
+ // Return the `DialogFragment` to the parent activity on create.
+ createBookmarkFolderListener.onCreateBookmarkFolder(CreateBookmarkFolderDialog.this);
});
// Create an `AlertDialog` from the `AlertDialog.Builder`.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Show the keyboard when the `Dialog` is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
@@ -115,13 +117,13 @@ public class CreateBookmarkFolderDialog extends AppCompatDialogFragment {
// Get handles for the views in the dialog.
final Button createButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
- EditText folderNameEditText = (EditText) alertDialog.findViewById(R.id.create_folder_name_edittext);
- ImageView webPageIconImageView = (ImageView) alertDialog.findViewById(R.id.create_folder_web_page_icon);
+ EditText folderNameEditText = alertDialog.findViewById(R.id.create_folder_name_edittext);
+ ImageView webPageIconImageView = alertDialog.findViewById(R.id.create_folder_web_page_icon);
// Initially disable the create button.
createButton.setEnabled(false);
- // Initialize the database helper. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
+ // Initialize the database helper. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
final BookmarksDatabaseHelper bookmarksDatabaseHelper = new BookmarksDatabaseHelper(getContext(), null, null, 0);
// Enable the create button if the new folder name is unique.
@@ -150,19 +152,17 @@ public class CreateBookmarkFolderDialog extends AppCompatDialogFragment {
});
// Allow the `enter` key on the keyboard to create the folder from `create_folder_name_edittext`.
- folderNameEditText.setOnKeyListener(new View.OnKeyListener() {
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- // If the event is a key-down on the `enter` key, select the `PositiveButton` `Create`.
- if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER) && createButton.isEnabled()) { // The enter key was pressed and the create button is enabled.
- // Trigger `createBookmarkFolderListener` and return the `DialogFragment` to the parent activity.
- createBookmarkFolderListener.onCreateBookmarkFolder(CreateBookmarkFolderDialog.this);
- // Manually dismiss the `AlertDialog`.
- alertDialog.dismiss();
- // Consume the event.
- return true;
- } else { // If any other key was pressed, or if the create button is currently disabled, do not consume the event.
- return false;
- }
+ folderNameEditText.setOnKeyListener((View v, int keyCode, KeyEvent event) -> {
+ // If the event is a key-down on the `enter` key, select the `PositiveButton` `Create`.
+ if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER) && createButton.isEnabled()) { // The enter key was pressed and the create button is enabled.
+ // Trigger `createBookmarkFolderListener` and return the `DialogFragment` to the parent activity.
+ createBookmarkFolderListener.onCreateBookmarkFolder(CreateBookmarkFolderDialog.this);
+ // Manually dismiss the `AlertDialog`.
+ alertDialog.dismiss();
+ // Consume the event.
+ return true;
+ } else { // If any other key was pressed, or if the create button is currently disabled, do not consume the event.
+ return false;
}
});
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.java
index 47418332..f3321280 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/CreateHomeScreenShortcutDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2015-2017 Soren Stoutner .
+ * Copyright © 2015-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -41,18 +41,18 @@ import com.stoutner.privacybrowser.R;
public class CreateHomeScreenShortcutDialog extends AppCompatDialogFragment {
// The public interface is used to send information back to the parent activity.
- public interface CreateHomeScreenSchortcutListener {
+ public interface CreateHomeScreenShortcutListener {
void onCreateHomeScreenShortcut(AppCompatDialogFragment dialogFragment);
}
//`createHomeScreenShortcutListener` is used in `onAttach()` and `onCreateDialog()`.
- private CreateHomeScreenSchortcutListener createHomeScreenShortcutListener;
+ private CreateHomeScreenShortcutListener createHomeScreenShortcutListener;
// Check to make sure that the parent activity implements the listener.
public void onAttach(Context context) {
super.onAttach(context);
try {
- createHomeScreenShortcutListener = (CreateHomeScreenSchortcutListener) context;
+ createHomeScreenShortcutListener = (CreateHomeScreenShortcutListener) context;
} catch(ClassCastException exception) {
throw new ClassCastException(context.toString() + " must implement CreateHomeScreenShortcutListener.");
}
@@ -63,6 +63,9 @@ public class CreateHomeScreenShortcutDialog extends AppCompatDialogFragment {
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning below that `getLayoutInflater()` might be null.
+ assert getActivity() != null;
+
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
@@ -83,55 +86,52 @@ public class CreateHomeScreenShortcutDialog extends AppCompatDialogFragment {
dialogBuilder.setTitle(R.string.create_shortcut);
dialogBuilder.setIcon(favoriteIconDrawable);
- // Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
+ // Set the view. The parent view is null because it will be assigned by the alert dialog.
dialogBuilder.setView(layoutInflater.inflate(R.layout.create_home_screen_shortcut_dialog, null));
- // Setup the negative button. Using `null` closes the dialog without doing anything else.
+ // Setup the negative button. Using null closes the dialog without doing anything else.
dialogBuilder.setNegativeButton(R.string.cancel, null);
// Set an `onClick` listener on the positive button.
- dialogBuilder.setPositiveButton(R.string.create, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- createHomeScreenShortcutListener.onCreateHomeScreenShortcut(CreateHomeScreenShortcutDialog.this);
- }
- });
-
+ dialogBuilder.setPositiveButton(R.string.create, (DialogInterface dialog, int which) -> createHomeScreenShortcutListener.onCreateHomeScreenShortcut(CreateHomeScreenShortcutDialog.this));
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Show the keyboard when the Dialog is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
- // We need to show `alertDialog` before we can call `setOnKeyListener()` below.
+ // We need to show the alert dialog before we can call `setOnKeyListener()` below.
alertDialog.show();
// Get a handle for `shortcut_name_edittext`.
- EditText shortcutNameEditText = (EditText) alertDialog.findViewById(R.id.shortcut_name_edittext);
+ EditText shortcutNameEditText = alertDialog.findViewById(R.id.shortcut_name_edittext);
// Set the current `WebView` title as the text for `shortcutNameEditText`.
shortcutNameEditText.setText(MainWebViewActivity.webViewTitle);
// Allow the "enter" key on the keyboard to create the shortcut.
- shortcutNameEditText.setOnKeyListener(new View.OnKeyListener() {
- public boolean onKey(View v, int keyCode, KeyEvent event) {
- // If the event is a key-down on the "enter" button, select the PositiveButton "Create".
- if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
- // Trigger the create listener.
- createHomeScreenShortcutListener.onCreateHomeScreenShortcut(CreateHomeScreenShortcutDialog.this);
-
- // Manually dismiss `alertDialog`.
- alertDialog.dismiss();
-
- // Consume the event.
- return true;
- } else { // If any other key was pressed, do not consume the event.
- return false;
- }
+ shortcutNameEditText.setOnKeyListener((View v, int keyCode, KeyEvent event) -> {
+ // If the event is a key-down on the "enter" button, select the PositiveButton "Create".
+ if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
+ // Trigger the create listener.
+ createHomeScreenShortcutListener.onCreateHomeScreenShortcut(CreateHomeScreenShortcutDialog.this);
+
+ // Manually dismiss `alertDialog`.
+ alertDialog.dismiss();
+
+ // Consume the event.
+ return true;
+ } else { // If any other key was pressed, do not consume the event.
+ return false;
}
});
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadFileDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadFileDialog.java
index cbf08390..5ff4a851 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadFileDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadFileDialog.java
@@ -130,7 +130,7 @@ public class DownloadFileDialog extends AppCompatDialogFragment {
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -146,24 +146,29 @@ public class DownloadFileDialog extends AppCompatDialogFragment {
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.download_file_dialog, null));
- // Set an `onClick()` listener on the negative button.
+ // Set an listener on the negative button.
dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
// Do nothing if `Cancel` is clicked. The `Dialog` will automatically close.
});
- // Set an `onClick()` listener on the positive button
+ // Set an listener on the positive button
dialogBuilder.setPositiveButton(R.string.download, (DialogInterface dialog, int which) -> {
// trigger `onDownloadFile()` and return the `DialogFragment` and the download URL to the parent activity.
downloadFileListener.onDownloadFile(DownloadFileDialog.this, downloadUrl);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder`.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
- // Show the keyboard when `alertDialog` is displayed on the screen.
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // Show the keyboard when alert dialog is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
// We need to show `alertDialog` before we can modify the contents.
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadImageDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadImageDialog.java
index 4568607d..2221bfe9 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadImageDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadImageDialog.java
@@ -108,7 +108,7 @@ public class DownloadImageDialog extends AppCompatDialogFragment {
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use and alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -124,28 +124,33 @@ public class DownloadImageDialog extends AppCompatDialogFragment {
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.download_image_dialog, null));
- // Set an `onClick()` listener on the negative button.
+ // Set an listener on the negative button.
dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
// Do nothing if `Cancel` is clicked.
});
- // Set an `onClick()` listener on the positive button
+ // Set an listener on the positive button
dialogBuilder.setPositiveButton(R.string.download, (DialogInterface dialog, int which) -> {
// trigger `onDownloadFile()` and return the `DialogFragment` and the download URL to the parent activity.
downloadImageListener.onDownloadImage(DownloadImageDialog.this, imageUrl);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Show the keyboard when `alertDialog` is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
- // We need to show `alertDialog` before we can modify the contents.
+ // The alert dialog must be shown before the contents can be modified.
alertDialog.show();
// Set the text for `downloadImageNameTextView`.
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadLocationPermissionDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadLocationPermissionDialog.java
index 0ad43d1c..57b3889d 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadLocationPermissionDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/DownloadLocationPermissionDialog.java
@@ -25,6 +25,7 @@ import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
+import android.view.WindowManager;
import com.stoutner.privacybrowser.R;
import com.stoutner.privacybrowser.activities.MainWebViewActivity;
@@ -102,7 +103,19 @@ public class DownloadLocationPermissionDialog extends DialogFragment {
// Set the text.
dialogBuilder.setMessage(R.string.download_location_message);
+ // Create an alert dialog from the alert dialog builder.
+ final AlertDialog alertDialog = dialogBuilder.create();
+
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// `onCreateDialog` requires the return of an `AlertDialog`.
- return dialogBuilder.create();
+ return alertDialog;
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.java
index 712e216f..028db1b7 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDatabaseViewDialog.java
@@ -124,11 +124,11 @@ public class EditBookmarkDatabaseViewDialog extends AppCompatDialogFragment {
// Initialize the database helper. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
BookmarksDatabaseHelper bookmarksDatabaseHelper = new BookmarksDatabaseHelper(getContext(), null, null, 0);
- // Get a `Cursor` with the selected bookmark and move it to the first position.
+ // Get a cursor with the selected bookmark and move it to the first position.
Cursor bookmarkCursor = bookmarksDatabaseHelper.getBookmarkCursor(bookmarkDatabaseId);
bookmarkCursor.moveToFirst();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -147,27 +147,32 @@ public class EditBookmarkDatabaseViewDialog extends AppCompatDialogFragment {
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_databaseview_dialog, null));
- // Set an `onClick()` listener for the negative button.
+ // Set the listener for the negative button.
dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
// Do nothing. The `AlertDialog` will close automatically.
});
- // Set the `onClick()` listener fo the positive button.
+ // Set the listener fo the positive button.
dialogBuilder.setPositiveButton(R.string.save, (DialogInterface dialog, int which) -> {
// Return the `DialogFragment` to the parent activity on save.
editBookmarkDatabaseViewListener.onSaveBookmark(EditBookmarkDatabaseViewDialog.this, bookmarkDatabaseId);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder`.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the keyboard to be hidden when the `AlertDialog` is first shown. If this is not set, the `AlertDialog` will not shrink when the keyboard is displayed.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
- // The `AlertDialog` must be shown before items in the layout can be modified.
+ // The alert dialog must be shown before items in the layout can be modified.
alertDialog.show();
// Get handles for the layout items.
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.java
index e37dacdf..492c113a 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -95,6 +95,9 @@ public class EditBookmarkDialog extends AppCompatDialogFragment {
// Run the default commands.
super.onCreate(savedInstanceState);
+ // Remove the incorrect lint warning that `getInt()` might be null.
+ assert getArguments() != null;
+
// Store the bookmark database ID in the class variable.
selectedBookmarkDatabaseId = getArguments().getInt("Database ID");
}
@@ -111,7 +114,7 @@ public class EditBookmarkDialog extends AppCompatDialogFragment {
Cursor bookmarkCursor = bookmarksDatabaseHelper.getBookmarkCursor(selectedBookmarkDatabaseId);
bookmarkCursor.moveToFirst();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -124,30 +127,38 @@ public class EditBookmarkDialog extends AppCompatDialogFragment {
// Set the title.
dialogBuilder.setTitle(R.string.edit_bookmark);
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_dialog, null));
- // Set an `onClick()` listener for the negative button.
+ // Set the listener for the negative button.
dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
// Do nothing. The `AlertDialog` will close automatically.
});
- // Set the `onClick()` listener fo the positive button.
+ // Set the listener fo the positive button.
dialogBuilder.setPositiveButton(R.string.save, (DialogInterface dialog, int which) -> {
// Return the `DialogFragment` to the parent activity on save.
editBookmarkListener.onSaveBookmark(EditBookmarkDialog.this, selectedBookmarkDatabaseId);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
- // Show the keyboard when `alertDialog` is displayed on the screen.
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // Show the keyboard when the alert dialog is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
- // The `AlertDialog` must be shown before items in the layout can be modified.
+ // The alert dialog must be shown before items in the layout can be modified.
alertDialog.show();
// Get handles for the layout items.
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.java
index 41bfbd05..af26e0b9 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDatabaseViewDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -109,6 +109,9 @@ public class EditBookmarkFolderDatabaseViewDialog extends AppCompatDialogFragmen
// Run the default commands.
super.onCreate(savedInstanceState);
+ // Remove the incorrect lint warning that `getInt()` might be null.
+ assert getArguments() != null;
+
// Store the bookmark database ID in the class variable.
folderDatabaseId = getArguments().getInt("Database ID");
}
@@ -125,7 +128,7 @@ public class EditBookmarkFolderDatabaseViewDialog extends AppCompatDialogFragmen
Cursor folderCursor = bookmarksDatabaseHelper.getBookmarkCursor(folderDatabaseId);
folderCursor.moveToFirst();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -138,30 +141,38 @@ public class EditBookmarkFolderDatabaseViewDialog extends AppCompatDialogFragmen
// Set the title.
dialogBuilder.setTitle(R.string.edit_folder);
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_folder_databaseview_dialog, null));
- // Set an `onClick()` listener for the negative button.
+ // Set the listener for the negative button.
dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
// Do nothing. The `AlertDialog` will close automatically.
});
- // Set the `onClick()` listener fo the positive button.
+ // Set the listener fo the positive button.
dialogBuilder.setPositiveButton(R.string.save, (DialogInterface dialog, int which) -> {
// Return the `DialogFragment` to the parent activity on save.
editBookmarkFolderDatabaseViewListener.onSaveBookmarkFolder(EditBookmarkFolderDatabaseViewDialog.this, folderDatabaseId);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Set the keyboard to be hidden when the `AlertDialog` is first shown. If this is not set, the `AlertDialog` will not shrink when the keyboard is displayed.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
- // The `AlertDialog` must be shown before items in the layout can be modified.
+ // The alert dialog must be shown before items in the layout can be modified.
alertDialog.show();
// Get handles for the layout items.
@@ -215,6 +226,9 @@ public class EditBookmarkFolderDatabaseViewDialog extends AppCompatDialogFragmen
// Combine `matrixCursor` and `foldersCursor`.
MergeCursor foldersMergeCursor = new MergeCursor(new Cursor[]{matrixCursor, foldersCursor});
+ // Remove the incorrect lint warning that `getContext()` might be null.
+ assert getContext() != null;
+
// Create a `ResourceCursorAdapter` for the `Spinner`. `0` specifies no flags.;
ResourceCursorAdapter foldersCursorAdapter = new ResourceCursorAdapter(getContext(), R.layout.edit_bookmark_databaseview_spinner_item, foldersMergeCursor, 0) {
@Override
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.java
index ab3e690d..8f41bfc7 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/EditBookmarkFolderDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -89,6 +89,9 @@ public class EditBookmarkFolderDialog extends AppCompatDialogFragment {
// Run the default commands.
super.onCreate(savedInstanceState);
+ // Remove the incorrect lint warning that `getInt()` might be null.
+ assert getArguments() != null;
+
// Store the folder database ID in the class variable.
selectedFolderDatabaseId = getArguments().getInt("Database ID");
}
@@ -105,7 +108,7 @@ public class EditBookmarkFolderDialog extends AppCompatDialogFragment {
Cursor folderCursor = bookmarksDatabaseHelper.getBookmarkCursor(selectedFolderDatabaseId);
folderCursor.moveToFirst();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -118,30 +121,38 @@ public class EditBookmarkFolderDialog extends AppCompatDialogFragment {
// Set the title.
dialogBuilder.setTitle(R.string.edit_folder);
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.edit_bookmark_folder_dialog, null));
- // Set an `onClick()` listener for the negative button.
+ // Set the listener for the negative button.
dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
// Do nothing. The `AlertDialog` will close automatically.
});
- // Set the `onClick()` listener fo the positive button.
+ // Set the listener fo the positive button.
dialogBuilder.setPositiveButton(R.string.save, (DialogInterface dialog, int which) -> {
// Return the `DialogFragment` to the parent activity on save.
editBookmarkFolderListener.onSaveBookmarkFolder(EditBookmarkFolderDialog.this, selectedFolderDatabaseId);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
- // Show the keyboard when the `Dialog` is displayed on the screen.
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // Show the keyboard when the dialog is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
- // The `AlertDialog` must be shown before items in the layout can be modified.
+ // The alert dialog must be shown before items in the layout can be modified.
alertDialog.show();
// Get handles for layout items in the `AlertDialog`.
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.java
index 993c8c3d..6110ed54 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/HttpAuthenticationDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2017 Soren Stoutner .
+ * Copyright © 2017-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -63,6 +63,9 @@ public class HttpAuthenticationDialog extends AppCompatDialogFragment{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ // Remove the incorrect lint warnings that `getString()` might be null.
+ assert getArguments() != null;
+
// Save the host and realm in class variables.
httpAuthHost = getArguments().getString("Host");
httpAuthRealm = getArguments().getString("Realm");
@@ -94,10 +97,13 @@ public class HttpAuthenticationDialog extends AppCompatDialogFragment{
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -122,40 +128,39 @@ public class HttpAuthenticationDialog extends AppCompatDialogFragment{
dialogBuilder.setView(layoutInflater.inflate(R.layout.http_authentication_dialog, null));
// Setup the negative button.
- dialogBuilder.setNegativeButton(R.string.close, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Call `onHttpAuthenticationCancel()` and return the `DialogFragment` to the parent activity.
- httpAuthenticationListener.onHttpAuthenticationCancel();
- }
+ dialogBuilder.setNegativeButton(R.string.close, (DialogInterface dialog, int which) -> {
+ // Call `onHttpAuthenticationCancel()` and return the `DialogFragment` to the parent activity.
+ httpAuthenticationListener.onHttpAuthenticationCancel();
});
// Setup the positive button.
- dialogBuilder.setPositiveButton(R.string.proceed, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Call `onHttpAuthenticationProceed()` and return the `DialogFragment` to the parent activity.
- httpAuthenticationListener.onHttpAuthenticationProceed(HttpAuthenticationDialog.this);
- }
+ dialogBuilder.setPositiveButton(R.string.proceed, (DialogInterface dialog, int which) -> {
+ // Call `onHttpAuthenticationProceed()` and return the `DialogFragment` to the parent activity.
+ httpAuthenticationListener.onHttpAuthenticationProceed(HttpAuthenticationDialog.this);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Remove the warning below that `setSoftInputMode` might produce `java.lang.NullPointerException`.
+ // Remove the warning below that `getWindow()` might be null.
assert alertDialog.getWindow() != null;
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// Show the keyboard when the `AlertDialog` is displayed on the screen.
alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
- // The `AlertDialog` needs to be shown before `setOnKeyListener()` can be called.
+ // The alert dialog needs to be shown before the contents can be modified.
alertDialog.show();
// Get handles for the views in `alertDialog`.
- TextView realmTextView = (TextView) alertDialog.findViewById(R.id.http_authentication_realm);
- TextView hostTextView = (TextView) alertDialog.findViewById(R.id.http_authentication_host);
- EditText usernameEditText = (EditText) alertDialog.findViewById(R.id.http_authentication_username);
- EditText passwordEditText = (EditText) alertDialog.findViewById(R.id.http_authentication_password);
+ TextView realmTextView = alertDialog.findViewById(R.id.http_authentication_realm);
+ TextView hostTextView = alertDialog.findViewById(R.id.http_authentication_host);
+ EditText usernameEditText = alertDialog.findViewById(R.id.http_authentication_username);
+ EditText passwordEditText = alertDialog.findViewById(R.id.http_authentication_password);
// Set the realm text.
realmTextView.setText(httpAuthRealm);
@@ -192,40 +197,36 @@ public class HttpAuthenticationDialog extends AppCompatDialogFragment{
hostTextView.setText(hostStringBuilder);
// Allow the `enter` key on the keyboard to trigger `onHttpAuthenticationProceed` from `usernameEditText`.
- usernameEditText.setOnKeyListener(new View.OnKeyListener() {
- public boolean onKey(View view, int keyCode, KeyEvent event) {
- // If the event is a key-down on the `enter` key, call `onHttpAuthenticationProceed()`.
- if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
- // Trigger `onHttpAuthenticationProceed` and return the `DialogFragment` to the parent activity.
- httpAuthenticationListener.onHttpAuthenticationProceed(HttpAuthenticationDialog.this);
-
- // Manually dismiss the `AlertDialog`.
- alertDialog.dismiss();
-
- // Consume the event.
- return true;
- } else { // If any other key was pressed, do not consume the event.
- return false;
- }
+ usernameEditText.setOnKeyListener((View view, int keyCode, KeyEvent event) -> {
+ // If the event is a key-down on the `enter` key, call `onHttpAuthenticationProceed()`.
+ if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
+ // Trigger `onHttpAuthenticationProceed` and return the `DialogFragment` to the parent activity.
+ httpAuthenticationListener.onHttpAuthenticationProceed(HttpAuthenticationDialog.this);
+
+ // Manually dismiss the `AlertDialog`.
+ alertDialog.dismiss();
+
+ // Consume the event.
+ return true;
+ } else { // If any other key was pressed, do not consume the event.
+ return false;
}
});
// Allow the `enter` key on the keyboard to trigger `onHttpAuthenticationProceed()` from `passwordEditText`.
- passwordEditText.setOnKeyListener(new View.OnKeyListener() {
- public boolean onKey(View view, int keyCode, KeyEvent event) {
- // If the event is a key-down on the `enter` key, call `onHttpAuthenticationProceed()`.
- if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
- // Trigger `onHttpAuthenticationProceed` and return the `DialogFragment` to the parent activity.
- httpAuthenticationListener.onHttpAuthenticationProceed(HttpAuthenticationDialog.this);
-
- // Manually dismiss the `AlertDialog`.
- alertDialog.dismiss();
-
- // Consume the event.
- return true;
- } else { // If any other key was pressed, do not consume the event.
- return false;
- }
+ passwordEditText.setOnKeyListener((View view, int keyCode, KeyEvent event) -> {
+ // If the event is a key-down on the `enter` key, call `onHttpAuthenticationProceed()`.
+ if ((keyCode == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) {
+ // Trigger `onHttpAuthenticationProceed` and return the `DialogFragment` to the parent activity.
+ httpAuthenticationListener.onHttpAuthenticationProceed(HttpAuthenticationDialog.this);
+
+ // Manually dismiss the `AlertDialog`.
+ alertDialog.dismiss();
+
+ // Consume the event.
+ return true;
+ } else { // If any other key was pressed, do not consume the event.
+ return false;
}
});
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java
index c08939a4..2dfda361 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/MoveToFolderDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -39,6 +39,7 @@ import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatDialogFragment;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.CursorAdapter;
@@ -85,7 +86,7 @@ public class MoveToFolderDialog extends AppCompatDialogFragment {
// Initialize the database helper. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies a database version, but that is ignored and set instead using a constant in `BookmarksDatabaseHelper`.
bookmarksDatabaseHelper = new BookmarksDatabaseHelper(getContext(), null, null, 0);
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -98,24 +99,36 @@ public class MoveToFolderDialog extends AppCompatDialogFragment {
// Set the title.
dialogBuilder.setTitle(R.string.move_to_folder);
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(getActivity().getLayoutInflater().inflate(R.layout.move_to_folder_dialog, null));
- // Set an `onClick()` listener for the negative button.
+ // Set the listener for the negative button.
dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> {
// Do nothing. The `AlertDialog` will close automatically.
});
- // Set the `onClick()` listener fo the positive button.
+ // Set the listener fo the positive button.
dialogBuilder.setPositiveButton(R.string.move, (DialogInterface dialog, int which) -> {
// Return the `DialogFragment` to the parent activity on save.
moveToFolderListener.onMoveToFolder(MoveToFolderDialog.this);
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Show the `AlertDialog` so the items in the layout can be modified.
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // Show the alert dialog so the items in the layout can be modified.
alertDialog.show();
// Get a handle for the positive button.
@@ -185,10 +198,12 @@ public class MoveToFolderDialog extends AppCompatDialogFragment {
}
};
} else { // Display `Home Folder` at the top of the `ListView`.
- // Get the home folder icon drawable and convert it to a `Bitmap`. `this` specifies the current context.
+ // Get the home folder icon drawable and convert it to a `Bitmap`.
Drawable homeFolderIconDrawable = ContextCompat.getDrawable(getActivity().getApplicationContext(), R.drawable.folder_gray_bitmap);
BitmapDrawable homeFolderIconBitmapDrawable = (BitmapDrawable) homeFolderIconDrawable;
+ assert homeFolderIconDrawable != null;
Bitmap homeFolderIconBitmap = homeFolderIconBitmapDrawable.getBitmap();
+
// Convert the folder `Bitmap` to a byte array. `0` is for lossless compression (the only option for a PNG).
ByteArrayOutputStream homeFolderIconByteArrayOutputStream = new ByteArrayOutputStream();
homeFolderIconBitmap.compress(Bitmap.CompressFormat.PNG, 0, homeFolderIconByteArrayOutputStream);
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedSslCertificateMismatchDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedSslCertificateMismatchDialog.java
index d3315ad1..6796b50e 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedSslCertificateMismatchDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/PinnedSslCertificateMismatchDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2017 Soren Stoutner .
+ * Copyright © 2017-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -37,6 +37,7 @@ import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.view.WindowManager;
import android.widget.TextView;
import com.stoutner.privacybrowser.R;
@@ -87,10 +88,13 @@ public class PinnedSslCertificateMismatchDialog extends AppCompatDialogFragment
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Get the activity's layout inflater.
layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -109,57 +113,48 @@ public class PinnedSslCertificateMismatchDialog extends AppCompatDialogFragment
}
// Setup the neutral button.
- dialogBuilder.setNeutralButton(R.string.update_ssl, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Initialize the `long` date variables. If the date is `null`, a long value of `0` will be stored in the Domains database entry.
- long currentSslStartDateLong = 0;
- long currentSslEndDateLong = 0;
-
- // Convert the `Dates` into `longs`.
- if (currentSslStartDate != null) {
- currentSslStartDateLong = currentSslStartDate.getTime();
- }
-
- if (currentSslEndDate != null) {
- currentSslEndDateLong = currentSslEndDate.getTime();
- }
+ dialogBuilder.setNeutralButton(R.string.update_ssl, (DialogInterface dialog, int which) -> {
+ // Initialize the `long` date variables. If the date is `null`, a long value of `0` will be stored in the Domains database entry.
+ long currentSslStartDateLong = 0;
+ long currentSslEndDateLong = 0;
+
+ // Convert the `Dates` into `longs`.
+ if (currentSslStartDate != null) {
+ currentSslStartDateLong = currentSslStartDate.getTime();
+ }
- // Initialize the database handler. The two `nulls` do not specify the database name or a `CursorFactory`. The `0` specifies the database version, but that is ignored and set instead using a constant in `DomainsDatabaseHelper`.
- DomainsDatabaseHelper domainsDatabaseHelper = new DomainsDatabaseHelper(getContext(), null, null, 0);
-
- // Update the pinned SSL certificate for this domain.
- domainsDatabaseHelper.updateCertificate(MainWebViewActivity.domainSettingsDatabaseId, currentSslIssuedToCNameString, currentSslIssuedToONameString, currentSslIssuedToUNameString, currentSslIssuedByCNameString, currentSslIssuedByONameString,
- currentSslIssuedByUNameString, currentSslStartDateLong, currentSslEndDateLong);
-
- // Update the pinned SSL certificate global variables to match the information that is now in the database.
- MainWebViewActivity.pinnedDomainSslIssuedToCNameString = currentSslIssuedToCNameString;
- MainWebViewActivity.pinnedDomainSslIssuedToONameString = currentSslIssuedToONameString;
- MainWebViewActivity.pinnedDomainSslIssuedToUNameString = currentSslIssuedToUNameString;
- MainWebViewActivity.pinnedDomainSslIssuedByCNameString = currentSslIssuedByCNameString;
- MainWebViewActivity.pinnedDomainSslIssuedByONameString = currentSslIssuedByONameString;
- MainWebViewActivity.pinnedDomainSslIssuedByUNameString = currentSslIssuedByUNameString;
- MainWebViewActivity.pinnedDomainSslStartDate = currentSslStartDate;
- MainWebViewActivity.pinnedDomainSslEndDate = currentSslEndDate;
+ if (currentSslEndDate != null) {
+ currentSslEndDateLong = currentSslEndDate.getTime();
}
+
+ // Initialize the database handler. The `0` specifies the database version, but that is ignored and set instead using a constant in `DomainsDatabaseHelper`.
+ DomainsDatabaseHelper domainsDatabaseHelper = new DomainsDatabaseHelper(getContext(), null, null, 0);
+
+ // Update the pinned SSL certificate for this domain.
+ domainsDatabaseHelper.updateCertificate(MainWebViewActivity.domainSettingsDatabaseId, currentSslIssuedToCNameString, currentSslIssuedToONameString, currentSslIssuedToUNameString,
+ currentSslIssuedByCNameString, currentSslIssuedByONameString, currentSslIssuedByUNameString, currentSslStartDateLong, currentSslEndDateLong);
+
+ // Update the pinned SSL certificate global variables to match the information that is now in the database.
+ MainWebViewActivity.pinnedDomainSslIssuedToCNameString = currentSslIssuedToCNameString;
+ MainWebViewActivity.pinnedDomainSslIssuedToONameString = currentSslIssuedToONameString;
+ MainWebViewActivity.pinnedDomainSslIssuedToUNameString = currentSslIssuedToUNameString;
+ MainWebViewActivity.pinnedDomainSslIssuedByCNameString = currentSslIssuedByCNameString;
+ MainWebViewActivity.pinnedDomainSslIssuedByONameString = currentSslIssuedByONameString;
+ MainWebViewActivity.pinnedDomainSslIssuedByUNameString = currentSslIssuedByUNameString;
+ MainWebViewActivity.pinnedDomainSslStartDate = currentSslStartDate;
+ MainWebViewActivity.pinnedDomainSslEndDate = currentSslEndDate;
});
// Setup the negative button.
- dialogBuilder.setNegativeButton(R.string.back, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Call the `onSslMismatchBack` public interface to send the `WebView` back one page.
- pinnedSslCertificateMismatchListener.onSslMismatchBack();
- }
+ dialogBuilder.setNegativeButton(R.string.back, (DialogInterface dialog, int which) -> {
+ // Call the `onSslMismatchBack` public interface to send the `WebView` back one page.
+ pinnedSslCertificateMismatchListener.onSslMismatchBack();
});
// Setup the positive button.
- dialogBuilder.setPositiveButton(R.string.proceed, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Call the `onSslMismatchProceed` public interface.
- pinnedSslCertificateMismatchListener.onSslMismatchProceed();
- }
+ dialogBuilder.setPositiveButton(R.string.proceed, (DialogInterface dialog, int which) -> {
+ // Call the `onSslMismatchProceed` public interface.
+ pinnedSslCertificateMismatchListener.onSslMismatchProceed();
});
// Set the title.
@@ -168,27 +163,36 @@ public class PinnedSslCertificateMismatchDialog extends AppCompatDialogFragment
// Set the layout. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.pinned_ssl_certificate_mismatch_linearlayout, null));
- // Create an `AlertDialog` from the `AlertDialog.Builder`
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // Show the `AlertDialog` so the items in the layout can be modified.
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // Show the alert dialog so the items in the layout can be modified.
alertDialog.show();
- // Setup `wrapVerticalContentViewPager`.
- WrapVerticalContentViewPager wrapVerticalContentViewPager = (WrapVerticalContentViewPager) alertDialog.findViewById(R.id.pinned_ssl_certificate_mismatch_viewpager);
+ // Setup the view pager.
+ WrapVerticalContentViewPager wrapVerticalContentViewPager = alertDialog.findViewById(R.id.pinned_ssl_certificate_mismatch_viewpager);
wrapVerticalContentViewPager.setAdapter(new pagerAdapter());
- // Setup the `TabLayout` and connect it to the `WrapVerticalContentViewPager`.
- TabLayout tabLayout = (TabLayout) alertDialog.findViewById(R.id.pinned_ssl_certificate_mismatch_tablayout);
+ // Setup the tab layout and connect it to the view pager.
+ TabLayout tabLayout = alertDialog.findViewById(R.id.pinned_ssl_certificate_mismatch_tablayout);
tabLayout.setupWithViewPager(wrapVerticalContentViewPager);
- // `onCreateDialog` requires the return of an `AlertDialog`.
+ // `onCreateDialog()` requires the return of an `AlertDialog`.
return alertDialog;
}
private class pagerAdapter extends PagerAdapter {
@Override
- public boolean isViewFromObject(View view, Object object) {
+ public boolean isViewFromObject(@NonNull View view, @NonNull Object object) {
// Check to see if the `View` and the `Object` are the same.
return (view == object);
}
@@ -210,19 +214,20 @@ public class PinnedSslCertificateMismatchDialog extends AppCompatDialogFragment
}
@Override
- public Object instantiateItem(ViewGroup container, int position) {
+ @NonNull
+ public Object instantiateItem(@NonNull ViewGroup container, int position) {
// Inflate the `ScrollView` for this tab.
ViewGroup tabViewGroup = (ViewGroup) layoutInflater.inflate(R.layout.pinned_ssl_certificate_mismatch_scrollview, container, false);
// Get handles for the `TextViews`.
- TextView issuedToCNameTextView = (TextView) tabViewGroup.findViewById(R.id.issued_to_cname);
- TextView issuedToONameTextView = (TextView) tabViewGroup.findViewById(R.id.issued_to_oname);
- TextView issuedToUNameTextView = (TextView) tabViewGroup.findViewById(R.id.issued_to_uname);
- TextView issuedByCNameTextView = (TextView) tabViewGroup.findViewById(R.id.issued_by_cname);
- TextView issuedByONameTextView = (TextView) tabViewGroup.findViewById(R.id.issued_by_oname);
- TextView issuedByUNameTextView = (TextView) tabViewGroup.findViewById(R.id.issued_by_uname);
- TextView startDateTextView = (TextView) tabViewGroup.findViewById(R.id.start_date);
- TextView endDateTextView = (TextView) tabViewGroup.findViewById(R.id.end_date);
+ TextView issuedToCNameTextView = tabViewGroup.findViewById(R.id.issued_to_cname);
+ TextView issuedToONameTextView = tabViewGroup.findViewById(R.id.issued_to_oname);
+ TextView issuedToUNameTextView = tabViewGroup.findViewById(R.id.issued_to_uname);
+ TextView issuedByCNameTextView = tabViewGroup.findViewById(R.id.issued_by_cname);
+ TextView issuedByONameTextView = tabViewGroup.findViewById(R.id.issued_by_oname);
+ TextView issuedByUNameTextView = tabViewGroup.findViewById(R.id.issued_by_uname);
+ TextView startDateTextView = tabViewGroup.findViewById(R.id.start_date);
+ TextView endDateTextView = tabViewGroup.findViewById(R.id.end_date);
// Setup the labels.
String cNameLabel = getString(R.string.common_name) + " ";
@@ -297,7 +302,8 @@ public class PinnedSslCertificateMismatchDialog extends AppCompatDialogFragment
if (MainWebViewActivity.pinnedDomainSslStartDate == null) {
startDateStringBuilder = new SpannableStringBuilder(startDateLabel);
} else {
- startDateStringBuilder = new SpannableStringBuilder(startDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG).format(MainWebViewActivity.pinnedDomainSslStartDate));
+ startDateStringBuilder = new SpannableStringBuilder(startDateLabel + DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.LONG)
+ .format(MainWebViewActivity.pinnedDomainSslStartDate));
}
if (MainWebViewActivity.pinnedDomainSslEndDate == null) {
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java
index 00a3b1f9..8bde8de0 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/SslCertificateErrorDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -34,6 +34,7 @@ import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
+import android.view.WindowManager;
import android.widget.TextView;
import com.stoutner.privacybrowser.R;
@@ -93,6 +94,9 @@ public class SslCertificateErrorDialog extends AppCompatDialogFragment {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ // Remove the incorrect lint warning that `getArguments()` might be null.
+ assert getArguments() != null;
+
// Save the components of the SSL error message in class variables.
primaryErrorInt = getArguments().getInt("PrimaryErrorInt");
urlWithError = getArguments().getString("UrlWithError");
@@ -133,10 +137,13 @@ public class SslCertificateErrorDialog extends AppCompatDialogFragment {
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style and icon according to the theme.
@@ -160,42 +167,41 @@ public class SslCertificateErrorDialog extends AppCompatDialogFragment {
// Set the view. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.ssl_certificate_error, null));
- // Set an `onClick` listener on the negative button. `null` doesn't do anything extra when the button is pressed. The `Dialog` will automatically close.
- dialogBuilder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- sslCertificateErrorListener.onSslErrorCancel();
- }
- });
+ // Set a listener on the negative button.
+ dialogBuilder.setNegativeButton(R.string.cancel, (DialogInterface dialog, int which) -> sslCertificateErrorListener.onSslErrorCancel());
- // Set an `onClick` listener on the positive button.
- dialogBuilder.setPositiveButton(R.string.proceed, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- sslCertificateErrorListener.onSslErrorProceed();
- }
- });
+ // Set a listener on the positive button.
+ dialogBuilder.setPositiveButton(R.string.proceed, (DialogInterface dialog, int which) -> sslCertificateErrorListener.onSslErrorProceed());
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
AlertDialog alertDialog = dialogBuilder.create();
- // We have to show the `AlertDialog` before we can modify the content.
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ // We have to show the alert dialog before we can modify the content.
alertDialog.show();
// Get handles for the `TextViews`
- TextView primaryErrorTextView = (TextView) alertDialog.findViewById(R.id.primary_error);
- TextView urlTextView = (TextView) alertDialog.findViewById(R.id.url_error_dialog);
- TextView issuedToCNameTextView = (TextView) alertDialog.findViewById(R.id.issued_to_cname_error_dialog);
- TextView issuedToONameTextView = (TextView) alertDialog.findViewById(R.id.issued_to_oname_error_dialog);
- TextView issuedToUNameTextView = (TextView) alertDialog.findViewById(R.id.issued_to_uname_error_dialog);
- TextView issuedByTextView = (TextView) alertDialog.findViewById(R.id.issued_by_textview);
- TextView issuedByCNameTextView = (TextView) alertDialog.findViewById(R.id.issued_by_cname_error_dialog);
- TextView issuedByONameTextView = (TextView) alertDialog.findViewById(R.id.issued_by_oname_error_dialog);
- TextView issuedByUNameTextView = (TextView) alertDialog.findViewById(R.id.issued_by_uname_error_dialog);
- TextView validDatesTextView = (TextView) alertDialog.findViewById(R.id.valid_dates_textview);
- TextView startDateTextView = (TextView) alertDialog.findViewById(R.id.start_date_error_dialog);
- TextView endDateTextView = (TextView) alertDialog.findViewById(R.id.end_date_error_dialog);
+ TextView primaryErrorTextView = alertDialog.findViewById(R.id.primary_error);
+ TextView urlTextView = alertDialog.findViewById(R.id.url_error_dialog);
+ TextView issuedToCNameTextView = alertDialog.findViewById(R.id.issued_to_cname_error_dialog);
+ TextView issuedToONameTextView = alertDialog.findViewById(R.id.issued_to_oname_error_dialog);
+ TextView issuedToUNameTextView = alertDialog.findViewById(R.id.issued_to_uname_error_dialog);
+ TextView issuedByTextView = alertDialog.findViewById(R.id.issued_by_textview);
+ TextView issuedByCNameTextView = alertDialog.findViewById(R.id.issued_by_cname_error_dialog);
+ TextView issuedByONameTextView = alertDialog.findViewById(R.id.issued_by_oname_error_dialog);
+ TextView issuedByUNameTextView = alertDialog.findViewById(R.id.issued_by_uname_error_dialog);
+ TextView validDatesTextView = alertDialog.findViewById(R.id.valid_dates_textview);
+ TextView startDateTextView = alertDialog.findViewById(R.id.start_date_error_dialog);
+ TextView endDateTextView = alertDialog.findViewById(R.id.end_date_error_dialog);
// Setup the common strings.
String urlLabel = getString(R.string.url_label) + " ";
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.java
index 8a703929..00938102 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/UrlHistoryDialog.java
@@ -1,5 +1,5 @@
/*
- * Copyright © 2016-2017 Soren Stoutner .
+ * Copyright © 2016-2018 Soren Stoutner .
*
* This file is part of Privacy Browser .
*
@@ -36,6 +36,7 @@ import android.support.v7.app.AppCompatDialogFragment;
import android.util.Base64;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.WindowManager;
import android.webkit.WebBackForwardList;
import android.widget.AdapterView;
import android.widget.ListView;
@@ -71,6 +72,9 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
// Convert `defaultFavoriteIconDrawable` to a `BitmapDrawable`.
BitmapDrawable defaultFavoriteIconBitmapDrawable = (BitmapDrawable) defaultFavoriteIconDrawable;
+ // Remove the incorrect lint error that `getBitmap()` might be null.
+ assert defaultFavoriteIconBitmapDrawable != null;
+
// Extract a `Bitmap` from `defaultFavoriteIconBitmapDrawable`.
Bitmap defaultFavoriteIcon = defaultFavoriteIconBitmapDrawable.getBitmap();
@@ -93,6 +97,9 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
// Create a `ByteArrayOutputStream`.
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ // Remove the incorrect lint error that `compress()` might be null;
+ assert iconBitmap != null;
+
// Convert the favorite icon `Bitmap` to a `ByteArrayOutputStream`. `100` is the compression quality, which is ignored by `PNG`.
iconBitmap.compress(Bitmap.CompressFormat.PNG, 100, byteArrayOutputStream);
@@ -121,6 +128,9 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ // Remove the incorrect lint error that `getArguments()` might be null.
+ assert getArguments() != null;
+
// Get the `ArrayLists` from the `Arguments`.
ArrayList urlStringArrayList = getArguments().getStringArrayList("URL_History");
ArrayList favoriteIconBase64StringArrayList = getArguments().getStringArrayList("Favorite_Icons");
@@ -180,10 +190,13 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
// `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.
@SuppressLint("InflateParams")
public Dialog onCreateDialog(Bundle savedInstanceState) {
+ // Remove the incorrect lint warning that `getActivity()` might be null.
+ assert getActivity() != null;
+
// Get the activity's layout inflater.
LayoutInflater layoutInflater = getActivity().getLayoutInflater();
- // Use `AlertDialog.Builder` to create the `AlertDialog`.
+ // Use an alert dialog builder to create the alert dialog.
AlertDialog.Builder dialogBuilder;
// Set the style according to the theme.
@@ -200,52 +213,52 @@ public class UrlHistoryDialog extends AppCompatDialogFragment{
dialogBuilder.setView(layoutInflater.inflate(R.layout.url_history_dialog, null));
// Set an `onClick()` listener on the negative button.
- dialogBuilder.setNegativeButton(R.string.clear_history, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Clear the history.
- urlHistoryListener.onClearHistory();
- }
+ dialogBuilder.setNegativeButton(R.string.clear_history, (DialogInterface dialog, int which) -> {
+ // Clear the history.
+ urlHistoryListener.onClearHistory();
});
// Set an `onClick()` listener on the positive button.
- dialogBuilder.setPositiveButton(R.string.close, new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- // Do nothing if `Close` is clicked. The `Dialog` will automatically close.
- }
+ dialogBuilder.setPositiveButton(R.string.close, (DialogInterface dialog, int which) -> {
+ // Do nothing if `Close` is clicked. The `Dialog` will automatically close.
});
- // Create an `AlertDialog` from the `AlertDialog.Builder`.
+ // Create an alert dialog from the alert dialog builder.
final AlertDialog alertDialog = dialogBuilder.create();
- // We need to show `alertDialog` before we can modify the contents.
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
+ //The alert dialog must be shown before the contents can be modified.
alertDialog.show();
// Instantiate a `HistoryArrayAdapter`.
final HistoryArrayAdapter historyArrayAdapter = new HistoryArrayAdapter(getContext(), historyArrayList, currentPageId);
- // Get a handle for `listView`.
- ListView listView = (ListView) alertDialog.findViewById(R.id.history_listview);
+ // Get a handle for the list view.
+ ListView listView = alertDialog.findViewById(R.id.history_listview);
- // Set the adapter on `listView`.
+ // Set the list view adapter.
listView.setAdapter(historyArrayAdapter);
- // Listen for clicks on entries in `listView`.
- listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView> parent, View view, int position, long id) {
- // Convert the `long` `id` to an `int`.
- int itemId = (int) id;
-
- // Only consume the click if it is not on the `currentPageId`.
- if (itemId != currentPageId) {
- // Go forward or back to `itemId`.
- urlHistoryListener.onUrlHistoryEntrySelected(currentPageId - itemId);
-
- // Dismiss the `Dialog`.
- alertDialog.dismiss();
- }
+ // Listen for clicks on entries in the list view.
+ listView.setOnItemClickListener((AdapterView> parent, View view, int position, long id) -> {
+ // Convert the `long` `id` to an `int`.
+ int itemId = (int) id;
+
+ // Only consume the click if it is not on the `currentPageId`.
+ if (itemId != currentPageId) {
+ // Go forward or back to `itemId`.
+ urlHistoryListener.onUrlHistoryEntrySelected(currentPageId - itemId);
+
+ // Dismiss the `Dialog`.
+ alertDialog.dismiss();
}
});
diff --git a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.java b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.java
index 6f9fa4d4..90a13271 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/dialogs/ViewSslCertificateDialog.java
@@ -32,6 +32,7 @@ import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
+import android.view.WindowManager;
import android.widget.TextView;
import com.stoutner.privacybrowser.activities.MainWebViewActivity;
@@ -64,7 +65,7 @@ public class ViewSslCertificateDialog extends DialogFragment {
// Set the icon.
dialogBuilder.setIcon(favoriteIconDrawable);
- // Set an `onClick` listener on the negative button. Using `null` as the listener closes the dialog without doing anything else.
+ // Set a listener on the negative button. Using `null` as the listener closes the dialog without doing anything else.
dialogBuilder.setNegativeButton(R.string.close, null);
// Check to see if the website is encrypted.
@@ -75,8 +76,20 @@ public class ViewSslCertificateDialog extends DialogFragment {
// Set the Layout. The parent view is `null` because it will be assigned by `AlertDialog`.
dialogBuilder.setView(layoutInflater.inflate(R.layout.unencrypted_website, null));
+ // Create an alert dialog from the alert dialog builder.
+ final AlertDialog alertDialog = dialogBuilder.create();
+
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// `onCreateDialog` requires the return of an `AlertDialog`.
- return dialogBuilder.create();
+ return alertDialog;
} else { // Display the SSL certificate information
// Set the title.
@@ -88,6 +101,15 @@ public class ViewSslCertificateDialog extends DialogFragment {
// Create an alert dialog from the builder.
final AlertDialog alertDialog = dialogBuilder.create();
+ // Disable screenshots if not allowed.
+ if (!MainWebViewActivity.allowScreenshots) {
+ // Remove the warning below that `getWindow()` might be null.
+ assert alertDialog.getWindow() != null;
+
+ // Disable screenshots.
+ alertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
+ }
+
// The alert dialog must be shown before items in the layout can be modified.
alertDialog.show();
diff --git a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java
index 88d57994..cb0ca13e 100644
--- a/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java
+++ b/app/src/main/java/com/stoutner/privacybrowser/fragments/SettingsFragment.java
@@ -60,6 +60,7 @@ public class SettingsFragment extends PreferenceFragment {
final Preference customUserAgentPreference = findPreference("custom_user_agent");
final Preference incognitoModePreference = findPreference("incognito_mode");
final Preference doNotTrackPreference = findPreference("do_not_track");
+ final Preference allowScreenshotsPreference = findPreference("allow_screenshots");
final Preference easyListPreference = findPreference("easylist");
final Preference easyPrivacyPreference = findPreference("easyprivacy");
final Preference fanboyAnnoyanceListPreference = findPreference("fanboy_annoyance_list");
@@ -209,17 +210,17 @@ public class SettingsFragment extends PreferenceFragment {
// Set the default font size as the summary text for the preference.
defaultFontSizePreference.setSummary(savedPreferences.getString("default_font_size", "100") + "%%");
- // Disable `javaScriptPreference` if `nightModeBoolean` is true. JavaScript will be enabled for all web pages.
+ // Disable the JavaScript preference if Night Mode is enabled. JavaScript will be enabled for all web pages.
javaScriptPreference.setEnabled(!nightMode);
- // Set the `javaScriptPreference` icon.
+ // Set the JavaScript icon.
if (javaScriptEnabled || nightMode) {
javaScriptPreference.setIcon(R.drawable.javascript_enabled);
} else {
javaScriptPreference.setIcon(R.drawable.privacy_mode);
}
- // Set the `firstPartyCookiesPreference` icon.
+ // Set the first-party cookies icon.
if (firstPartyCookiesEnabled) {
firstPartyCookiesPreference.setIcon(R.drawable.cookies_enabled);
} else {
@@ -230,7 +231,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the `thirdPartyCookiesPreference` icon.
+ // Set the third party cookies icon.
if (firstPartyCookiesEnabled && Build.VERSION.SDK_INT >= 21) {
if (thirdPartyCookiesEnabled) {
thirdPartyCookiesPreference.setIcon(R.drawable.cookies_warning);
@@ -249,7 +250,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the `domStoragePreference` icon.
+ // Set the DOM storage icon.
if (javaScriptEnabled || nightMode) { // The preference is enabled.
if (savedPreferences.getBoolean("dom_storage_enabled", false)) { // DOM storage is enabled.
domStoragePreference.setIcon(R.drawable.dom_storage_enabled);
@@ -268,7 +269,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the `saveFormDataPreference` icon.
+ // Set the save form data icon.
if (savedPreferences.getBoolean("save_form_data_enabled", false)) {
saveFormDataPreference.setIcon(R.drawable.form_data_enabled);
} else {
@@ -279,7 +280,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the `customUserAgentPreference` icon.
+ // Set the custom user agent icon.
if (customUserAgentPreference.isEnabled()) {
if (MainWebViewActivity.darkTheme) {
customUserAgentPreference.setIcon(R.drawable.custom_user_agent_enabled_dark);
@@ -294,7 +295,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the `incognitoModePreference` icon.
+ // Set the incognito mode icon.
if (savedPreferences.getBoolean("incognito_mode", false)) {
if (MainWebViewActivity.darkTheme) {
incognitoModePreference.setIcon(R.drawable.incognito_mode_enabled_dark);
@@ -309,7 +310,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the `doNotTrackPreference` icon.
+ // Set the Do Not Track icon.
if (savedPreferences.getBoolean("do_not_track", false)) {
if (MainWebViewActivity.darkTheme) {
doNotTrackPreference.setIcon(R.drawable.block_tracking_enabled_dark);
@@ -324,6 +325,21 @@ public class SettingsFragment extends PreferenceFragment {
}
}
+ // Set the allow screenshots icon.
+ if (savedPreferences.getBoolean("allow_screenshots", false)) {
+ if (MainWebViewActivity.darkTheme) {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_enabled_dark);
+ } else {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_enabled_light);
+ }
+ } else {
+ if (MainWebViewActivity.darkTheme) {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_disabled_dark);
+ } else {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_disabled_light);
+ }
+ }
+
// Set the EasyList icon.
if (savedPreferences.getBoolean("easylist", true)) {
if (MainWebViewActivity.darkTheme) {
@@ -354,7 +370,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the Fanboy list icons.
+ // Set the Fanboy lists icons.
if (fanboyAnnoyanceListEnabled) {
if (MainWebViewActivity.darkTheme) {
// Set the Fanboy annoyance list icon.
@@ -432,7 +448,7 @@ public class SettingsFragment extends PreferenceFragment {
}
}
- // Set the `searchCustomURLPreference` icon.
+ // Set the search custom URL icon.
if (searchCustomURLPreference.isEnabled()) {
if (MainWebViewActivity.darkTheme) {
searchCustomURLPreference.setIcon(R.drawable.search_custom_url_enabled_dark);
@@ -843,6 +859,35 @@ public class SettingsFragment extends PreferenceFragment {
break;
+ case "allow_screenshots":
+ // Update the icon.
+ if (sharedPreferences.getBoolean("allow_screenshots", false)) {
+ if (MainWebViewActivity.darkTheme) {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_enabled_dark);
+ } else {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_enabled_light);
+ }
+ } else {
+ if (MainWebViewActivity.darkTheme) {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_disabled_dark);
+ } else {
+ allowScreenshotsPreference.setIcon(R.drawable.allow_screenshots_disabled_light);
+ }
+ }
+
+ // Create an intent to restart Privacy Browser.
+ Intent allowScreenshotsRestartIntent = getActivity().getParentActivityIntent();
+
+ // Assert that the intent is not null to remove the lint error below.
+ assert allowScreenshotsRestartIntent != null;
+
+ // `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack. It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.
+ allowScreenshotsRestartIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+
+ // Make it so.
+ startActivity(allowScreenshotsRestartIntent);
+ break;
+
case "easylist":
// Update the icon.
if (sharedPreferences.getBoolean("easylist", true)) {
@@ -1367,17 +1412,17 @@ public class SettingsFragment extends PreferenceFragment {
darkThemePreference.setIcon(R.drawable.theme_light);
}
- // Create an `Intent` to restart Privacy Browser.
- Intent intent = getActivity().getParentActivityIntent();
+ // Create an intent to restart Privacy Browser.
+ Intent changeThemeRestartIntent = getActivity().getParentActivityIntent();
- // Assert that `intent` is not `null` to remove the lint error below.
- assert intent != null;
+ // Assert that the intent is not null to remove the lint error below.
+ assert changeThemeRestartIntent != null;
// `Intent.FLAG_ACTIVITY_CLEAR_TASK` removes all activities from the stack. It requires `Intent.FLAG_ACTIVITY_NEW_TASK`.
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
+ changeThemeRestartIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
// Make it so.
- startActivity(intent);
+ startActivity(changeThemeRestartIntent);
break;
case "night_mode":
diff --git a/app/src/main/res/drawable/about_dark.xml b/app/src/main/res/drawable/about_dark.xml
index a1927d79..4813364f 100644
--- a/app/src/main/res/drawable/about_dark.xml
+++ b/app/src/main/res/drawable/about_dark.xml
@@ -1,4 +1,4 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/allow_screenshots_disabled_light.xml b/app/src/main/res/drawable/allow_screenshots_disabled_light.xml
new file mode 100644
index 00000000..93763084
--- /dev/null
+++ b/app/src/main/res/drawable/allow_screenshots_disabled_light.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/allow_screenshots_enabled_dark.xml b/app/src/main/res/drawable/allow_screenshots_enabled_dark.xml
new file mode 100644
index 00000000..61556c09
--- /dev/null
+++ b/app/src/main/res/drawable/allow_screenshots_enabled_dark.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/allow_screenshots_enabled_light.xml b/app/src/main/res/drawable/allow_screenshots_enabled_light.xml
new file mode 100644
index 00000000..ee605af5
--- /dev/null
+++ b/app/src/main/res/drawable/allow_screenshots_enabled_light.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/app/src/main/res/drawable/back.xml b/app/src/main/res/drawable/back.xml
index 51dc3f07..85c235aa 100644
--- a/app/src/main/res/drawable/back.xml
+++ b/app/src/main/res/drawable/back.xml
@@ -1,4 +1,4 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
. The resulting image is released under the GPLv3+ license. -->
diff --git a/app/src/main/res/drawable/clear_everything_disabled.xml b/app/src/main/res/drawable/clear_everything_disabled.xml
index 77233c50..5ed15038 100644
--- a/app/src/main/res/drawable/clear_everything_disabled.xml
+++ b/app/src/main/res/drawable/clear_everything_disabled.xml
@@ -1,4 +1,4 @@
-
+
+
+
+
. The resulting image is released under the GPLv3+ license. -->
. The resulting image is released under the GPLv3+ license. -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
. The resulting image is released under the GPLv3+ license. -->
-
+
+
+
+
+
+
+
+
+
. The resulting image is released under the GPLv3+ license. -->
diff --git a/app/src/main/res/drawable/move_to_folder_light.xml b/app/src/main/res/drawable/move_to_folder_light.xml
index ee2fd4b6..fdbc6dbf 100644
--- a/app/src/main/res/drawable/move_to_folder_light.xml
+++ b/app/src/main/res/drawable/move_to_folder_light.xml
@@ -1,4 +1,4 @@
-
diff --git a/app/src/main/res/drawable/move_up_disabled.xml b/app/src/main/res/drawable/move_up_disabled.xml
index 6c935705..7d7dc93a 100644
--- a/app/src/main/res/drawable/move_up_disabled.xml
+++ b/app/src/main/res/drawable/move_up_disabled.xml
@@ -1,4 +1,4 @@
-
+
+
+
+
. The resulting image is released under the GPLv3+ license. -->
diff --git a/app/src/main/res/drawable/night_mode_disabled_light.xml b/app/src/main/res/drawable/night_mode_disabled_light.xml
index 81af0370..f7da08e9 100644
--- a/app/src/main/res/drawable/night_mode_disabled_light.xml
+++ b/app/src/main/res/drawable/night_mode_disabled_light.xml
@@ -1,4 +1,4 @@
-
diff --git a/app/src/main/res/drawable/night_mode_enabled_dark.xml b/app/src/main/res/drawable/night_mode_enabled_dark.xml
index b71a9838..38bf501e 100644
--- a/app/src/main/res/drawable/night_mode_enabled_dark.xml
+++ b/app/src/main/res/drawable/night_mode_enabled_dark.xml
@@ -1,4 +1,4 @@
-
diff --git a/app/src/main/res/drawable/night_mode_enabled_light.xml b/app/src/main/res/drawable/night_mode_enabled_light.xml
index 2d13d31b..464946ce 100644
--- a/app/src/main/res/drawable/night_mode_enabled_light.xml
+++ b/app/src/main/res/drawable/night_mode_enabled_light.xml
@@ -1,4 +1,4 @@
-
diff --git a/app/src/main/res/drawable/orbot_disabled_dark.xml b/app/src/main/res/drawable/orbot_disabled_dark.xml
index 39f6821b..8569ed1b 100644
--- a/app/src/main/res/drawable/orbot_disabled_dark.xml
+++ b/app/src/main/res/drawable/orbot_disabled_dark.xml
@@ -1,5 +1,5 @@
-
+
, which is released under the 3-clause BSD license.
- Modifications copyright Soren Stoutner 2017. The resulting image is released under the GPLv3+ license. -->
+
, which is released under the 3-clause BSD license.
- Modifications copyright Soren Stoutner 2017. The resulting image is released under the GPLv3+ license. -->
+
, which is released under the 3-clause BSD license.
- Modifications copyright Soren Stoutner 2017. The resulting image is released under the GPLv3+ license. -->
+
+
. The resulting image is released under the GPLv3+ license. -->
-
. The resulting image is released under the GPLv3+ license. -->
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/app/src/main/res/drawable/theme_light.xml b/app/src/main/res/drawable/theme_light.xml
index df0b9bce..a9b10798 100644
--- a/app/src/main/res/drawable/theme_light.xml
+++ b/app/src/main/res/drawable/theme_light.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/translucent_bar_disabled_dark.xml b/app/src/main/res/drawable/translucent_bar_disabled_dark.xml
index 73dba40a..ad6341a8 100644
--- a/app/src/main/res/drawable/translucent_bar_disabled_dark.xml
+++ b/app/src/main/res/drawable/translucent_bar_disabled_dark.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/translucent_bar_disabled_light.xml b/app/src/main/res/drawable/translucent_bar_disabled_light.xml
index 3c0187d9..6d97bd73 100644
--- a/app/src/main/res/drawable/translucent_bar_disabled_light.xml
+++ b/app/src/main/res/drawable/translucent_bar_disabled_light.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/translucent_bar_enabled_dark.xml b/app/src/main/res/drawable/translucent_bar_enabled_dark.xml
index fd2c1627..b44db6d2 100644
--- a/app/src/main/res/drawable/translucent_bar_enabled_dark.xml
+++ b/app/src/main/res/drawable/translucent_bar_enabled_dark.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/translucent_bar_enabled_light.xml b/app/src/main/res/drawable/translucent_bar_enabled_light.xml
index 66f62723..0b48dfbc 100644
--- a/app/src/main/res/drawable/translucent_bar_enabled_light.xml
+++ b/app/src/main/res/drawable/translucent_bar_enabled_light.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/translucent_bar_ghosted_dark.xml b/app/src/main/res/drawable/translucent_bar_ghosted_dark.xml
index 5f5ac4cc..153d2804 100644
--- a/app/src/main/res/drawable/translucent_bar_ghosted_dark.xml
+++ b/app/src/main/res/drawable/translucent_bar_ghosted_dark.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/translucent_bar_ghosted_light.xml b/app/src/main/res/drawable/translucent_bar_ghosted_light.xml
index a1697000..d81dda65 100644
--- a/app/src/main/res/drawable/translucent_bar_ghosted_light.xml
+++ b/app/src/main/res/drawable/translucent_bar_ghosted_light.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/user_agent_dark.xml b/app/src/main/res/drawable/user_agent_dark.xml
index 83c8d02b..7419f4d9 100644
--- a/app/src/main/res/drawable/user_agent_dark.xml
+++ b/app/src/main/res/drawable/user_agent_dark.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/user_agent_light.xml b/app/src/main/res/drawable/user_agent_light.xml
index bf8899c0..05e5555b 100644
--- a/app/src/main/res/drawable/user_agent_light.xml
+++ b/app/src/main/res/drawable/user_agent_light.xml
@@ -1,4 +1,4 @@
-
+
-
+
diff --git a/app/src/main/res/drawable/warning.xml b/app/src/main/res/drawable/warning.xml
index c123ebb4..c4e2c125 100644
--- a/app/src/main/res/drawable/warning.xml
+++ b/app/src/main/res/drawable/warning.xml
@@ -1,6 +1,5 @@
-
-
-
+ android:layout_width="wrap_content"
+ android:padding="10dp"
+ android:orientation="vertical" >
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+ android:text="@string/issued_to"
+ android:textAllCaps="true"
+ android:textStyle="bold"
+ android:textColor="?attr/sslTitle" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 59abd866..292c2dca 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -153,6 +153,7 @@
URL laden
URL kopieren
+ Download URL
E-Mail-Adresse
E-Mail-Adresse kopieren
E-Mail senden
@@ -386,4 +387,7 @@
Lizenzen
Mitwirkende
Links
+
+
+ Zustimmung zur Werbung
\ No newline at end of file
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index b997e808..74d33b53 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -130,6 +130,7 @@
Borrar cookies
Borrar almacenamiento DOM
Borrar datos de formulario
+ Diseño
Tamaño de fuente
25%
50%
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 4748157d..2bb74f0e 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -130,6 +130,7 @@
Elimina cookies
Elimina DOM storage
Elimina dati dei moduli
+ Layout
Dimensione font
25%
50%
@@ -230,8 +231,8 @@
è possibile anteporre *. a un dominio per includere tutti i sottodomini (es. *.stoutner.com)
- Impostazioni di default
- - Swipe per aggiornare abilitata
- - Swipe per aggiornare disabilitata
+ - Swipe per aggiornare abilitato
+ - Swipe per aggiornare disabilitato
- Impostazioni di default
@@ -240,8 +241,8 @@
- Impostazioni di default
- - Abilita Immagini
- - Disabilita Immagini
+ - Immagini abilitate
+ - Immagini disabilitate
Certificato SSL appuntato
Certificato SSL salvato
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index 5f0c473f..2dbc44a4 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -131,6 +131,7 @@
ÐÑиÑÑиÑÑ cookie
ÐÑиÑÑиÑÑ Ñ
ÑанилиÑе DOM
ÐÑиÑÑиÑÑ Ð´Ð°Ð½Ð½Ñе ÑоÑмÑ
+ ÐнеÑний вид
Ð Ð°Ð·Ð¼ÐµÑ ÑÑиÑÑа
25%
50%
@@ -231,8 +232,8 @@
добавÑÑе *. Ð´Ð»Ñ Ð²ÐºÐ»ÑÑÐµÐ½Ð¸Ñ Ð²ÑеÑ
поддоменов (напÑ. * .yandex.ru)
- ÐаÑÑÑойки по ÑмолÑаниÑ
- - ÐоÑÑнÑÑÑ Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ enabled
- - ÐоÑÑнÑÑÑ Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ disabled
+ - ÐоÑÑнÑÑÑ Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ - вклÑÑено
+ - ÐоÑÑнÑÑÑ Ð´Ð»Ñ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ - вÑклÑÑено
- ÐаÑÑÑойки по ÑмолÑаниÑ
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index f77ab2d7..f52a84dd 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -338,6 +338,8 @@
Clear the history and cache after each webpage finishes loading. Forward and back do not work in Incognito Mode.
Do Not Track
Send the Do Not Track header, which politely suggests that web servers not track this browser.
+ Allow screenshots
+ Allow screenshots, video recording, and viewing on non-secure displays. Changing this setting will restart Privacy Browser.
Block Lists
EasyList
Main ad blocking list.
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 0348df7f..ace949a9 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -79,6 +79,12 @@
android:title="@string/do_not_track"
android:summary="@string/do_not_track_summary"
android:defaultValue="false" />
+
+