Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
B
Browser White
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Browser White
Commits
2e4405e8
Commit
2e4405e8
authored
Aug 29, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
5db9c537
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
357 additions
and
4 deletions
+357
-4
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+15
-4
BrowserAppWidget.kt
.../java/com/base/browserwhite/ui/widget/BrowserAppWidget.kt
+39
-0
example_appwidget_preview.png
...src/main/res/drawable-nodpi/example_appwidget_preview.png
+0
-0
app_widget_background.xml
app/src/main/res/drawable-v21/app_widget_background.xml
+10
-0
app_widget_inner_view_background.xml
...ain/res/drawable-v21/app_widget_inner_view_background.xml
+10
-0
bg_df2c28_12.xml
app/src/main/res/drawable/bg_df2c28_12.xml
+6
-0
browser_app_widget.xml
app/src/main/res/layout/browser_app_widget.xml
+165
-0
x_logo_widget.png
app/src/main/res/mipmap-xxhdpi/x_logo_widget.png
+0
-0
yulantu.png
app/src/main/res/mipmap-xxhdpi/yulantu.png
+0
-0
themes.xml
app/src/main/res/values-night-v31/themes.xml
+10
-0
styles.xml
app/src/main/res/values-v21/styles.xml
+14
-0
styles.xml
app/src/main/res/values-v31/styles.xml
+16
-0
themes.xml
app/src/main/res/values-v31/themes.xml
+11
-0
attrs.xml
app/src/main/res/values/attrs.xml
+7
-0
colors.xml
app/src/main/res/values/colors.xml
+4
-0
dimens.xml
app/src/main/res/values/dimens.xml
+6
-0
strings.xml
app/src/main/res/values/strings.xml
+3
-0
styles.xml
app/src/main/res/values/styles.xml
+12
-0
themes.xml
app/src/main/res/values/themes.xml
+15
-0
browser_app_widget_info.xml
app/src/main/res/xml/browser_app_widget_info.xml
+14
-0
No files found.
app/src/main/AndroidManifest.xml
View file @
2e4405e8
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
xmlns:tools=
"http://schemas.android.com/tools"
>
<!-- required设置为true,无相机设备google play上不会分发 -->
<!-- required设置为true,无相机设备google play上不会分发 -->
<uses-feature
<uses-feature
android:name=
"android.hardware.camera"
android:name=
"android.hardware.camera"
...
@@ -15,6 +16,7 @@
...
@@ -15,6 +16,7 @@
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_DATA_SYNC"
/>
<uses-permission
android:name=
"android.permission.FOREGROUND_SERVICE_DATA_SYNC"
/>
<uses-permission
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
/>
<uses-permission
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
/>
<uses-permission
android:name=
"com.android.launcher.permission.INSTALL_SHORTCUT"
/>
<uses-permission
android:name=
"com.android.launcher.permission.INSTALL_SHORTCUT"
/>
<queries>
<queries>
<intent>
<intent>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
@@ -37,12 +39,23 @@
...
@@ -37,12 +39,23 @@
android:theme=
"@style/Theme.BrowserWhite"
android:theme=
"@style/Theme.BrowserWhite"
android:usesCleartextTraffic=
"true"
android:usesCleartextTraffic=
"true"
tools:targetApi=
"34"
>
tools:targetApi=
"34"
>
<receiver
android:name=
".ui.widget.BrowserAppWidget"
android:exported=
"false"
>
<intent-filter>
<action
android:name=
"android.appwidget.action.APPWIDGET_UPDATE"
/>
</intent-filter>
<meta-data
android:name=
"android.appwidget.provider"
android:resource=
"@xml/browser_app_widget_info"
/>
</receiver>
<activity
<activity
android:theme=
"@style/splash.theme"
android:name=
".ui.activity.splash.Splash2Activity"
android:name=
".ui.activity.splash.Splash2Activity"
android:exported=
"true"
android:exported=
"true"
android:launchMode=
"singleTask"
>
android:launchMode=
"singleTask"
android:theme=
"@style/splash.theme"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
@@ -90,7 +103,6 @@
...
@@ -90,7 +103,6 @@
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
<activity
android:name=
".ui.activity.download.WebDownloadManagerActivity"
android:name=
".ui.activity.download.WebDownloadManagerActivity"
android:exported=
"false"
android:exported=
"false"
...
@@ -163,7 +175,6 @@
...
@@ -163,7 +175,6 @@
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
tools:ignore=
"DiscouragedApi,LockedOrientationActivity"
/>
<activity
<activity
android:name=
".ui.activity.labelstack.LabelStackActivity"
android:name=
".ui.activity.labelstack.LabelStackActivity"
android:exported=
"false"
android:exported=
"false"
...
...
app/src/main/java/com/base/browserwhite/ui/widget/BrowserAppWidget.kt
0 → 100644
View file @
2e4405e8
package
com.base.browserwhite.ui.widget
import
android.appwidget.AppWidgetManager
import
android.appwidget.AppWidgetProvider
import
android.content.Context
import
android.widget.RemoteViews
import
com.base.browserwhite.R
/**
* Implementation of App Widget functionality.
*/
class
BrowserAppWidget
:
AppWidgetProvider
()
{
override
fun
onUpdate
(
context
:
Context
,
appWidgetManager
:
AppWidgetManager
,
appWidgetIds
:
IntArray
)
{
// There may be multiple widgets active, so update all of them
for
(
appWidgetId
in
appWidgetIds
)
{
updateAppWidget
(
context
,
appWidgetManager
,
appWidgetId
)
}
}
override
fun
onEnabled
(
context
:
Context
)
{
// Enter relevant functionality for when the first widget is created
}
override
fun
onDisabled
(
context
:
Context
)
{
// Enter relevant functionality for when the last widget is disabled
}
}
internal
fun
updateAppWidget
(
context
:
Context
,
appWidgetManager
:
AppWidgetManager
,
appWidgetId
:
Int
)
{
// Construct the RemoteViews object
val
views
=
RemoteViews
(
context
.
packageName
,
R
.
layout
.
browser_app_widget
)
views
.
setTextViewText
(
R
.
id
.
tv_app_name
,
context
.
resources
.
getString
(
R
.
string
.
app_name
))
views
.
setTextViewText
(
R
.
id
.
tv_percent
,
"80%"
)
// Instruct the widget manager to update the widget
appWidgetManager
.
updateAppWidget
(
appWidgetId
,
views
)
}
\ No newline at end of file
app/src/main/res/drawable-nodpi/example_appwidget_preview.png
0 → 100644
View file @
2e4405e8
3.44 KB
app/src/main/res/drawable-v21/app_widget_background.xml
0 → 100644
View file @
2e4405e8
<?xml version="1.0" encoding="utf-8"?>
<!--
Background for widgets to make the rounded corners based on the
appWidgetRadius attribute value
-->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"?attr/appWidgetRadius"
/>
<solid
android:color=
"?android:attr/colorBackground"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable-v21/app_widget_inner_view_background.xml
0 → 100644
View file @
2e4405e8
<?xml version="1.0" encoding="utf-8"?>
<!--
Background for views inside widgets to make the rounded corners based on the
appWidgetInnerRadius attribute value
-->
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<corners
android:radius=
"?attr/appWidgetInnerRadius"
/>
<solid
android:color=
"?android:attr/colorAccent"
/>
</shape>
\ No newline at end of file
app/src/main/res/drawable/bg_df2c28_12.xml
0 → 100644
View file @
2e4405e8
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#DF2C28"
/>
<corners
android:radius=
"12dp"
/>
</shape>
\ No newline at end of file
app/src/main/res/layout/browser_app_widget.xml
0 → 100644
View file @
2e4405e8
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
style=
"@style/Widget.BrowserWhite.AppWidget.Container"
android:layout_width=
"wrap_content"
android:layout_height=
"110dp"
android:background=
"@drawable/bg_ffffff_15"
android:theme=
"@style/Theme.BrowserWhite.AppWidgetContainer"
>
<RelativeLayout
android:layout_width=
"120dp"
android:layout_height=
"match_parent"
android:layout_gravity=
"center_vertical"
>
<ImageView
android:id=
"@+id/iv_icon"
android:layout_width=
"23dp"
android:layout_height=
"23dp"
android:layout_marginTop=
"10dp"
android:src=
"@mipmap/x_logo_widget"
tools:ignore=
"ContentDescription"
/>
<TextView
android:id=
"@+id/tv_app_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignTop=
"@id/iv_icon"
android:layout_alignBottom=
"@id/iv_icon"
android:layout_marginStart=
"3dp"
android:layout_toEndOf=
"@id/iv_icon"
android:ellipsize=
"end"
android:gravity=
"center_vertical"
android:includeFontPadding=
"false"
android:paddingBottom=
"2dp"
android:singleLine=
"true"
android:textColor=
"#666666"
android:textSize=
"12sp"
tools:text=
"Al Browser&Privacy"
/>
<TextView
android:id=
"@+id/tv_percent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/iv_icon"
android:layout_alignParentStart=
"true"
android:layout_marginTop=
"10dp"
android:layout_marginEnd=
"5dp"
android:layout_toStartOf=
"@id/tv_clean"
android:singleLine=
"true"
android:textColor=
"#DF2C28"
android:textSize=
"21sp"
tools:text=
"88%.."
/>
<TextView
android:id=
"@+id/tv_clean"
android:layout_width=
"54dp"
android:layout_height=
"25dp"
android:layout_alignTop=
"@id/tv_percent"
android:layout_alignBottom=
"@id/tv_percent"
android:layout_alignParentEnd=
"true"
android:background=
"@drawable/bg_df2c28_12"
android:gravity=
"center"
android:text=
"Clean"
android:textColor=
"@color/white"
android:textSize=
"11sp"
tools:ignore=
"HardcodedText"
/>
</RelativeLayout>
<ImageView
android:layout_width=
"1px"
android:layout_height=
"63dp"
android:layout_gravity=
"center_vertical"
android:layout_marginHorizontal=
"2dp"
android:background=
"#EFEFEF"
tools:ignore=
"ContentDescription"
/>
<LinearLayout
android:layout_width=
"180dp"
android:layout_height=
"match_parent"
android:orientation=
"horizontal"
>
<LinearLayout
android:id=
"@+id/ll_4"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
android:visibility=
"visible"
tools:ignore=
"UseCompoundDrawables"
>
<ImageView
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_marginBottom=
"6dp"
android:src=
"@mipmap/notifi_process"
tools:ignore=
"ContentDescription"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Process"
android:textColor=
"#666666"
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_2"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
tools:ignore=
"UseCompoundDrawables"
>
<ImageView
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_marginBottom=
"6dp"
android:src=
"@mipmap/notifi_news"
tools:ignore=
"ContentDescription"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"News"
android:textColor=
"#666666"
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/ll_3"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_vertical"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
tools:ignore=
"UseCompoundDrawables"
>
<ImageView
android:layout_width=
"36dp"
android:layout_height=
"36dp"
android:layout_marginBottom=
"6dp"
android:src=
"@mipmap/notifi_scancode"
tools:ignore=
"ContentDescription"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"ScanQR"
android:textColor=
"#666666"
android:textSize=
"12sp"
tools:ignore=
"HardcodedText"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/mipmap-xxhdpi/x_logo_widget.png
0 → 100644
View file @
2e4405e8
4.75 KB
app/src/main/res/mipmap-xxhdpi/yulantu.png
0 → 100644
View file @
2e4405e8
53.6 KB
app/src/main/res/values-night-v31/themes.xml
0 → 100644
View file @
2e4405e8
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Having themes.xml for night-v31 because of the priority order of the resource qualifiers.
-->
<style
name=
"Theme.BrowserWhite.AppWidgetContainerParent"
parent=
"@android:style/Theme.DeviceDefault.DayNight"
>
<item
name=
"appWidgetRadius"
>
@android:dimen/system_app_widget_background_radius
</item>
<item
name=
"appWidgetInnerRadius"
>
@android:dimen/system_app_widget_inner_radius
</item>
</style>
</resources>
\ No newline at end of file
app/src/main/res/values-v21/styles.xml
0 → 100644
View file @
2e4405e8
<resources>
<style
name=
"Widget.BrowserWhite.AppWidget.Container"
parent=
"android:Widget"
>
<item
name=
"android:id"
>
@android:id/background
</item>
<item
name=
"android:padding"
>
?attr/appWidgetPadding
</item>
<item
name=
"android:background"
>
@drawable/app_widget_background
</item>
</style>
<style
name=
"Widget.BrowserWhite.AppWidget.InnerView"
parent=
"android:Widget"
>
<item
name=
"android:padding"
>
?attr/appWidgetPadding
</item>
<item
name=
"android:background"
>
@drawable/app_widget_inner_view_background
</item>
<item
name=
"android:textColor"
>
?android:attr/textColorPrimary
</item>
</style>
</resources>
\ No newline at end of file
app/src/main/res/values-v31/styles.xml
0 → 100644
View file @
2e4405e8
<resources>
<style
name=
"Widget.BrowserWhite.AppWidget.Container"
parent=
"android:Widget"
>
<item
name=
"android:id"
>
@android:id/background
</item>
<item
name=
"android:padding"
>
?attr/appWidgetPadding
</item>
<item
name=
"android:background"
>
@drawable/app_widget_background
</item>
<item
name=
"android:clipToOutline"
>
true
</item>
</style>
<style
name=
"Widget.BrowserWhite.AppWidget.InnerView"
parent=
"android:Widget"
>
<item
name=
"android:padding"
>
?attr/appWidgetPadding
</item>
<item
name=
"android:background"
>
@drawable/app_widget_inner_view_background
</item>
<item
name=
"android:textColor"
>
?android:attr/textColorPrimary
</item>
<item
name=
"android:clipToOutline"
>
true
</item>
</style>
</resources>
\ No newline at end of file
app/src/main/res/values-v31/themes.xml
0 → 100644
View file @
2e4405e8
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Having themes.xml for v31 variant because @android:dimen/system_app_widget_background_radius
and @android:dimen/system_app_widget_internal_padding requires API level 31
-->
<style
name=
"Theme.BrowserWhite.AppWidgetContainerParent"
parent=
"@android:style/Theme.DeviceDefault.DayNight"
>
<item
name=
"appWidgetRadius"
>
@android:dimen/system_app_widget_background_radius
</item>
<item
name=
"appWidgetInnerRadius"
>
@android:dimen/system_app_widget_inner_radius
</item>
</style>
</resources>
\ No newline at end of file
app/src/main/res/values/attrs.xml
0 → 100644
View file @
2e4405e8
<resources>
<declare-styleable
name=
"AppWidgetAttrs"
>
<attr
name=
"appWidgetPadding"
format=
"dimension"
/>
<attr
name=
"appWidgetInnerRadius"
format=
"dimension"
/>
<attr
name=
"appWidgetRadius"
format=
"dimension"
/>
</declare-styleable>
</resources>
\ No newline at end of file
app/src/main/res/values/colors.xml
View file @
2e4405e8
...
@@ -4,4 +4,8 @@
...
@@ -4,4 +4,8 @@
<color
name=
"white"
>
#FFFFFFFF
</color>
<color
name=
"white"
>
#FFFFFFFF
</color>
<color
name=
"black_a_70"
>
#B3000000
</color>
<color
name=
"black_a_70"
>
#B3000000
</color>
<color
name=
"color_cbcdd7"
>
#cbcdd7
</color>
<color
name=
"color_cbcdd7"
>
#cbcdd7
</color>
<color
name=
"light_blue_50"
>
#FFE1F5FE
</color>
<color
name=
"light_blue_200"
>
#FF81D4FA
</color>
<color
name=
"light_blue_600"
>
#FF039BE5
</color>
<color
name=
"light_blue_900"
>
#FF01579B
</color>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/dimens.xml
View file @
2e4405e8
...
@@ -17,4 +17,10 @@
...
@@ -17,4 +17,10 @@
<dimen
name=
"dp_7"
>
7dp
</dimen>
<dimen
name=
"dp_7"
>
7dp
</dimen>
<dimen
name=
"dp_20"
>
20dp
</dimen>
<dimen
name=
"dp_20"
>
20dp
</dimen>
<dimen
name=
"dp_26"
>
26dp
</dimen>
<dimen
name=
"dp_26"
>
26dp
</dimen>
<!--
Refer to App Widget Documentation for margin information
http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
-->
<dimen
name=
"widget_margin"
>
0dp
</dimen>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
2e4405e8
...
@@ -3,4 +3,7 @@
...
@@ -3,4 +3,7 @@
<string
name=
"facebook_app_id"
>
421266364258459
</string>
<string
name=
"facebook_app_id"
>
421266364258459
</string>
<!-- TODO: Remove or change this placeholder text -->
<!-- TODO: Remove or change this placeholder text -->
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
<string
name=
"hello_blank_fragment"
>
Hello blank fragment
</string>
<string
name=
"appwidget_text"
>
EXAMPLE
</string>
<string
name=
"add_widget"
>
Add widget
</string>
<string
name=
"app_widget_description"
>
This is an app widget description
</string>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/styles.xml
0 → 100644
View file @
2e4405e8
<resources>
<style
name=
"Widget.BrowserWhite.AppWidget.Container"
parent=
"android:Widget"
>
<item
name=
"android:id"
>
@android:id/background
</item>
<item
name=
"android:background"
>
?android:attr/colorBackground
</item>
</style>
<style
name=
"Widget.BrowserWhite.AppWidget.InnerView"
parent=
"android:Widget"
>
<item
name=
"android:background"
>
?android:attr/colorBackground
</item>
<item
name=
"android:textColor"
>
?android:attr/textColorPrimary
</item>
</style>
</resources>
\ No newline at end of file
app/src/main/res/values/themes.xml
View file @
2e4405e8
...
@@ -12,4 +12,19 @@
...
@@ -12,4 +12,19 @@
<item
name=
"android:windowFullscreen"
>
false
</item>
<item
name=
"android:windowFullscreen"
>
false
</item>
</style>
</style>
<style
name=
"Theme.BrowserWhite.AppWidgetContainerParent"
parent=
"@android:style/Theme.DeviceDefault"
>
<!-- Radius of the outer bound of widgets to make the rounded corners -->
<item
name=
"appWidgetRadius"
>
16dp
</item>
<!--
Radius of the inner view's bound of widgets to make the rounded corners.
It needs to be 8dp or less than the value of appWidgetRadius
-->
<item
name=
"appWidgetInnerRadius"
>
8dp
</item>
</style>
<style
name=
"Theme.BrowserWhite.AppWidgetContainer"
parent=
"Theme.BrowserWhite.AppWidgetContainerParent"
>
<!-- Apply padding to avoid the content of the widget colliding with the rounded corners -->
<item
name=
"appWidgetPadding"
>
16dp
</item>
</style>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/xml/browser_app_widget_info.xml
0 → 100644
View file @
2e4405e8
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:description=
"@string/app_widget_description"
android:initialKeyguardLayout=
"@layout/browser_app_widget"
android:initialLayout=
"@layout/browser_app_widget"
android:minWidth=
"350dp"
android:minHeight=
"110dp"
android:previewImage=
"@mipmap/yulantu"
android:previewLayout=
"@layout/browser_app_widget"
android:resizeMode=
"none"
android:targetCellWidth=
"3"
android:targetCellHeight=
"1"
android:updatePeriodMillis=
"86400000"
android:widgetCategory=
"home_screen"
/>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment