Skip to content

Commit

Permalink
Move widgets to views
Browse files Browse the repository at this point in the history
  • Loading branch information
Slion committed Jan 29, 2024
1 parent bc354d6 commit e48df74
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 30 deletions.
20 changes: 11 additions & 9 deletions app/src/main/java/fulguris/activity/WebBrowserActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ import android.webkit.WebView.HitTestResult.SRC_ANCHOR_TYPE
import android.webkit.WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE
import android.widget.*
import android.widget.AdapterView.OnItemClickListener
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView.OnEditorActionListener
import androidx.annotation.ColorInt
import androidx.annotation.IdRes
Expand Down Expand Up @@ -206,7 +208,7 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),
@Inject lateinit var bookmarkPageInitializer: BookmarkPageInitializer
@Inject @field:MainHandler
lateinit var mainHandler: Handler
@Inject lateinit var proxyUtils: fulguris.utils.ProxyUtils
@Inject lateinit var proxyUtils: ProxyUtils
@Inject lateinit var bookmarksDialogBuilder: LightningDialogBuilder
@Inject lateinit var exitCleanup: ExitCleanup
@Inject lateinit var abpUserRules: AbpUserRules
Expand Down Expand Up @@ -2200,7 +2202,7 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),
&& currentView.url.isNotBlank()
&& !currentView.url.isSpecialUrl()) {
HistoryEntry(currentView.url, currentView.title).also {
fulguris.utils.Utils.createShortcut(this, it, currentView.favicon)
Utils.createShortcut(this, it, currentView.favicon)
Timber.d("Creating shortcut: ${it.title} ${it.url}")
}
}
Expand Down Expand Up @@ -2235,7 +2237,7 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),
return true
}
R.id.action_share -> {
fulguris.utils.IntentUtils(this).shareUrl(currentUrl, currentView?.title)
IntentUtils(this).shareUrl(currentUrl, currentView?.title)
return true
}
R.id.action_bookmarks -> {
Expand Down Expand Up @@ -3540,7 +3542,7 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),
currentToolBarTextColor = foregroundColorFromBackgroundColor(color)
// Change search view text color
searchView.setTextColor(currentToolBarTextColor)
searchView.setHintTextColor(fulguris.utils.DrawableUtils.mixColor(0.5f, currentToolBarTextColor, color))
searchView.setHintTextColor(DrawableUtils.mixColor(0.5f, currentToolBarTextColor, color))
// Change tab counter color
iBindingToolbarContent.tabsButton.apply {
textColor = currentToolBarTextColor
Expand Down Expand Up @@ -3609,7 +3611,7 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),
setSearchBarColors(color)

// Progress bar background color
fulguris.utils.DrawableUtils.mixColor(0.5f, color, Color.WHITE).let {
DrawableUtils.mixColor(0.5f, color, Color.WHITE).let {
// Set progress bar background color making sure it isn't too bright
// That's notably making it more visible on lequipe.fr and bbc.com/sport
// We hope this is going to work with most white themed website too
Expand Down Expand Up @@ -3778,8 +3780,8 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),

return when (aInfo) {
HeaderInfo.Url -> tab.url
HeaderInfo.ShortUrl -> fulguris.utils.Utils.trimmedProtocolFromURL(tab.url)
HeaderInfo.Domain -> fulguris.utils.Utils.getDisplayDomainName(tab.url)
HeaderInfo.ShortUrl -> Utils.trimmedProtocolFromURL(tab.url)
HeaderInfo.Domain -> Utils.getDisplayDomainName(tab.url)
HeaderInfo.Title -> tab.title.ifBlank { getString(R.string.untitled) }
HeaderInfo.Session -> tabsManager.iCurrentSessionName
HeaderInfo.AppName -> getString(R.string.app_name)
Expand Down Expand Up @@ -3879,7 +3881,7 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),
* Display downloads folder one way or another
*/
private fun openDownloads() {
startActivity(fulguris.utils.Utils.getIntentForDownloads(this, userPreferences.downloadDirectory))
startActivity(Utils.getIntentForDownloads(this, userPreferences.downloadDirectory))
// Our built-in downloads list did not display downloaded items properly
// Not sure why, consider fixing it or just removing it altogether at some point
//tabsManager.newTab(downloadPageInitializer,true)
Expand Down Expand Up @@ -4128,7 +4130,7 @@ abstract class WebBrowserActivity : ThemedBrowserActivity(),
putExtra("PhotoPath", cameraPhotoPath)
putExtra(
MediaStore.EXTRA_OUTPUT,
Uri.fromFile(fulguris.utils.Utils.createImageFile().also { file ->
Uri.fromFile(Utils.createImageFile().also { file ->
cameraPhotoPath = "file:${file.absolutePath}"
})
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* All Rights Reserved.
*/

package fulguris.widget
package fulguris.view

import android.content.Context
import android.graphics.Canvas
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fulguris.widget
package fulguris.view

import android.content.Context
import android.util.AttributeSet
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/bookmark_drawer_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
android:gravity="center_vertical"
android:orientation="horizontal">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/bookmark_back_button"
android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/bookmark_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:orientation="horizontal">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/faviconBookmark"
android:layout_width="@dimen/material_grid_small_icon"
android:layout_height="@dimen/material_grid_small_icon"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/dialog_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
android:gravity="center_vertical"
android:orientation="horizontal">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/icon"
android:layout_width="@dimen/material_grid_small_icon"
android:layout_height="@dimen/material_grid_small_icon"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
android:focusable="true"
>

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/search_ssl_status"
android:layout_width="@dimen/material_grid_touch_small"
android:layout_height="match_parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/tab_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android:focusableInTouchMode="true"
android:layout_marginHorizontal="@dimen/material_grid_margin"
android:weightSum="1">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/faviconTab"
android:layout_width="@dimen/material_grid_small_icon"
android:layout_height="@dimen/material_grid_small_icon"
Expand All @@ -56,7 +56,7 @@ android:focusableInTouchMode="true"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
tools:text="My web page title is too long to fit in here much too long"/>

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/deleteAction"
android:layout_width="@dimen/material_grid_touch_medium"
android:layout_height="match_parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/tab_list_item_horizontal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
android:paddingHorizontal="6dp"
android:weightSum="1">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/faviconTab"
android:layout_width="20dp"
android:layout_height="20dp"
Expand Down Expand Up @@ -54,7 +54,7 @@
android:background="?attr/actionBarItemBackground"
android:gravity="center">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/deleteButton"
android:layout_width="20dp"
android:layout_height="20dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />

<fulguris.widget.LinearLayout
<fulguris.view.LinearLayout
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/toolbar_button.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<fulguris.widget.ImageView
<fulguris.view.ImageView
android:clickable="true"
android:focusable="true"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/two_line_autocomplete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:paddingBottom="3dp"
android:weightSum="1">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/suggestionIcon"
android:layout_width="@dimen/material_grid_small_icon"
android:layout_height="@dimen/material_grid_small_icon"
Expand Down Expand Up @@ -46,7 +46,7 @@
android:textColor="?attr/autoCompleteUrlColor" />
</LinearLayout>

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/complete_search"
android:layout_width="@dimen/material_grid_touch_small"
android:layout_height="@dimen/material_grid_touch_small"
Expand Down
2 changes: 1 addition & 1 deletion app/src/styx/res/layout/bookmark_drawer_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
android:gravity="center_vertical"
android:orientation="horizontal">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/bookmark_back_button"
android:layout_width="?attr/actionBarSize"
android:layout_height="match_parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/styx/res/layout/bookmark_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
android:background="?attr/trackColor"
android:orientation="horizontal">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/faviconBookmark"
android:layout_width="24dp"
android:layout_height="24dp"
Expand Down
2 changes: 1 addition & 1 deletion app/src/styx/res/layout/search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:focusableInTouchMode="true"
android:focusable="true">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/search_ssl_status"
android:layout_width="36dp"
android:layout_height="match_parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/styx/res/layout/tab_list_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
android:orientation="horizontal"
android:weightSum="1">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/faviconTab"
android:layout_width="24dp"
android:layout_height="24dp"
Expand All @@ -45,7 +45,7 @@
android:singleLine="true"
android:textAppearance="?attr/textAppearanceListItemSmall" />

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/deleteAction"
android:layout_width="48dp"
android:layout_height="match_parent"
Expand Down
4 changes: 2 additions & 2 deletions app/src/styx/res/layout/tab_list_item_horizontal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
android:paddingHorizontal="6dp"
android:weightSum="1">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/faviconTab"
android:layout_width="20dp"
android:layout_height="20dp"
Expand Down Expand Up @@ -53,7 +53,7 @@
android:background="?attr/actionBarItemBackground"
android:gravity="center">

<fulguris.widget.ImageView
<fulguris.view.ImageView
android:id="@+id/deleteButton"
android:layout_width="20dp"
android:layout_height="20dp"
Expand Down

0 comments on commit e48df74

Please sign in to comment.