@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shortcut
|
||||
android:shortcutId="open_new_tab"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_static_shortcut_tab"
|
||||
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_tab"
|
||||
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_tab">
|
||||
<intent
|
||||
android:action="org.mozilla.fenix.OPEN_TAB"
|
||||
android:targetPackage="org.mozilla.fenix.debug"
|
||||
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
|
||||
</shortcut>
|
||||
<shortcut
|
||||
android:shortcutId="open_new_private_tab"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_static_shortcut_private_tab"
|
||||
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_private_tab"
|
||||
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_private_tab">
|
||||
<intent
|
||||
android:action="org.mozilla.fenix.OPEN_PRIVATE_TAB"
|
||||
android:targetPackage="org.mozilla.fenix.debug"
|
||||
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
|
||||
</shortcut>
|
||||
</shortcuts>
|
After Width: | Height: | Size: 20 KiB |
@ -0,0 +1,49 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.components
|
||||
|
||||
import android.app.PendingIntent
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import androidx.core.content.pm.ShortcutInfoCompat
|
||||
import androidx.core.content.pm.ShortcutManagerCompat
|
||||
import androidx.core.graphics.drawable.IconCompat
|
||||
import org.mozilla.fenix.HomeActivity
|
||||
import org.mozilla.fenix.R
|
||||
import org.mozilla.fenix.home.intent.StartSearchIntentProcessor
|
||||
import java.util.UUID
|
||||
|
||||
/**
|
||||
* Handles the creation of pinned shortcuts.
|
||||
*/
|
||||
object PrivateShortcutCreateManager {
|
||||
|
||||
fun createPrivateShortcut(context: Context) {
|
||||
if (!ShortcutManagerCompat.isRequestPinShortcutSupported(context)) return
|
||||
|
||||
val icon = IconCompat.createWithResource(context, R.mipmap.ic_launcher_private_round)
|
||||
val shortcut = ShortcutInfoCompat.Builder(context, UUID.randomUUID().toString())
|
||||
.setShortLabel(context.getString(R.string.app_name_private))
|
||||
.setLongLabel(context.getString(R.string.app_name_private))
|
||||
.setIcon(icon)
|
||||
.setIntent(Intent(context, HomeActivity::class.java).apply {
|
||||
action = Intent.ACTION_VIEW
|
||||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
|
||||
putExtra(HomeActivity.PRIVATE_BROWSING_MODE, true)
|
||||
putExtra(
|
||||
HomeActivity.OPEN_TO_SEARCH,
|
||||
StartSearchIntentProcessor.PRIVATE_BROWSING_PINNED_SHORTCUT
|
||||
)
|
||||
})
|
||||
.build()
|
||||
val homeScreenIntent = Intent(Intent.ACTION_MAIN)
|
||||
.addCategory(Intent.CATEGORY_HOME)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
val intentSender = PendingIntent
|
||||
.getActivity(context, 0, homeScreenIntent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
.intentSender
|
||||
ShortcutManagerCompat.requestPinShortcut(context, shortcut, intentSender)
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M 0 0 H 108 V 108 H 0 L 0 0">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:startY="48"
|
||||
android:startX="0.51729584"
|
||||
android:endY="-0.46862793"
|
||||
android:endX="48.54931"
|
||||
android:type="linear">
|
||||
<item android:offset="0" android:color="#7529A7"/>
|
||||
<item android:offset="0.5" android:color="#492E85"/>
|
||||
<item android:offset="1" android:color="#383372"/>
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
</vector>
|
||||
|
@ -0,0 +1,18 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="166.66667"
|
||||
android:viewportHeight="166.66667">
|
||||
<group android:translateX="53.333332"
|
||||
android:translateY="68.333336">
|
||||
<path
|
||||
android:pathData="M46.5301,30C40.2931,30 35.979,22.5 30.0001,22.5C24.0211,22.5 19.3351,30 13.4701,30C5.7751,30 0.0931,22.713 0.0001,10.227C-0.0569,2.472 2.2591,0 12.2461,0C22.2331,0 25.1611,4.089 30.0001,4.089C34.8391,4.089 37.7671,0 47.7541,0C57.7411,0 60.0541,2.472 60,10.227C59.9071,22.713 54.2251,30 46.5301,30ZM17.1301,9.543C11.0611,9.807 8.5591,13.425 8.5591,14.316C8.5591,15.207 12.6001,17.724 16.5301,17.724C20.4601,17.724 25.1011,16.281 25.1011,14.997C24.2648,11.3895 20.8082,9.0208 17.1421,9.543L17.1301,9.543ZM42.8461,9.543C39.1789,9.0211 35.722,11.3913 34.8871,15C34.8871,16.284 39.522,17.727 43.458,17.727C47.3941,17.727 51.417,15.207 51.417,14.316C51.417,13.425 48.9271,9.807 42.8581,9.543L42.8461,9.543Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
</vector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/static_shortcut_background"/>
|
||||
<foreground android:drawable="@drawable/ic_static_shortcut_private_tab_foreground"/>
|
||||
</adaptive-icon>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@color/static_shortcut_background"/>
|
||||
<foreground android:drawable="@drawable/ic_static_shortcut_tab_foreground"/>
|
||||
</adaptive-icon>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<rotate
|
||||
android:fromDegrees="45"
|
||||
android:pivotX="-40%"
|
||||
android:pivotY="87%"
|
||||
android:toDegrees="45">
|
||||
<shape android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="10dp"
|
||||
android:color="#7542E5" />
|
||||
<solid android:color="#7542E5" />
|
||||
</shape>
|
||||
</rotate>
|
||||
</item>
|
||||
</layer-list>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="@color/static_shortcut_background" />
|
||||
<size android:width="108dp" android:height="108dp" />
|
||||
</shape>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_static_shortcut_background" />
|
||||
<item android:drawable="@drawable/ic_static_shortcut_private_tab_foreground" />
|
||||
</layer-list>
|
@ -0,0 +1,18 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="196.36363"
|
||||
android:viewportHeight="196.36363">
|
||||
<group android:translateX="44.18182"
|
||||
android:translateY="44.18182">
|
||||
<path
|
||||
android:pathData="M70.53,69C64.293,69 59.979,61.5 54,61.5C48.021,61.5 43.335,69 37.47,69C29.775,69 24.093,61.713 24,49.227C23.943,41.472 26.259,39 36.246,39C46.233,39 49.161,43.089 54,43.089C58.839,43.089 61.767,39 71.754,39C81.741,39 84.054,41.472 84,49.227C83.907,61.713 78.225,69 70.53,69ZM41.13,48.543C35.061,48.807 32.559,52.425 32.559,53.316C32.559,54.207 36.6,56.724 40.53,56.724C44.46,56.724 49.101,55.281 49.101,53.997C48.265,50.389 44.808,48.021 41.142,48.543L41.13,48.543ZM66.846,48.543C63.179,48.021 59.722,50.391 58.887,54C58.887,55.284 63.522,56.727 67.458,56.727C71.394,56.727 75.417,54.207 75.417,53.316C75.417,52.425 72.927,48.807 66.858,48.543L66.846,48.543Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#312A65"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
</vector>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_static_shortcut_background" />
|
||||
<item android:drawable="@drawable/ic_static_shortcut_tab_foreground" />
|
||||
</layer-list>
|
@ -0,0 +1,18 @@
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="234.78261"
|
||||
android:viewportHeight="234.78261">
|
||||
<group android:translateX="63.391304"
|
||||
android:translateY="63.391304">
|
||||
<path
|
||||
android:pathData="M81,49.5L58.5,49.5L58.5,27C58.5,24.515 56.485,22.5 54,22.5C51.515,22.5 49.5,24.515 49.5,27L49.5,49.5L27,49.5C24.515,49.5 22.5,51.515 22.5,54C22.5,56.485 24.515,58.5 27,58.5L49.5,58.5L49.5,81C49.5,83.485 51.515,85.5 54,85.5C56.485,85.5 58.5,83.485 58.5,81L58.5,58.5L81,58.5C83.485,58.5 85.5,56.485 85.5,54C85.5,51.515 83.485,49.5 81,49.5Z"
|
||||
android:strokeWidth="1"
|
||||
android:fillColor="#312A65"
|
||||
android:fillType="evenOdd"
|
||||
android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
</vector>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="225"
|
||||
android:endColor="#B833E1"
|
||||
android:startColor="#7542E5"
|
||||
android:type="linear" />
|
||||
<size
|
||||
android:width="256dp"
|
||||
android:height="152dp" />
|
||||
<corners
|
||||
android:bottomLeftRadius="8dp"
|
||||
android:bottomRightRadius="8dp"
|
||||
android:topLeftRadius="8dp"
|
||||
android:topRightRadius="8dp" />
|
||||
</shape>
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/grey_button_color" />
|
||||
<corners android:radius="@dimen/tab_corner_radius"/>
|
||||
</shape>
|
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_gravity="end"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_pbm_triangle" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/pbm_shortcut_popup_background">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/cfr_message"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:text="@string/cfr_message"
|
||||
android:textColor="@color/primary_text_dark_theme"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/cfr_pos_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:background="@drawable/rounded_gray_corners"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="@string/cfr_pos_button_text"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/above_dark_theme"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cfr_message" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/cfr_neg_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:text="@string/cfr_neg_button_text"
|
||||
android:textAllCaps="false"
|
||||
android:textColor="@color/white_color"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cfr_pos_button" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</LinearLayout>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_private_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_private_foreground"/>
|
||||
</adaptive-icon>
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<background android:drawable="@drawable/ic_launcher_private_background"/>
|
||||
<foreground android:drawable="@drawable/ic_launcher_private_foreground"/>
|
||||
</adaptive-icon>
|
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 9.7 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 14 KiB |
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This Source Code Form is subject to the terms of the Mozilla Public
|
||||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
|
||||
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<shortcut
|
||||
android:shortcutId="open_new_tab"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_static_shortcut_tab"
|
||||
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_tab"
|
||||
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_tab">
|
||||
<intent
|
||||
android:action="org.mozilla.fenix.OPEN_TAB"
|
||||
android:targetPackage="org.mozilla"
|
||||
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
|
||||
</shortcut>
|
||||
<shortcut
|
||||
android:shortcutId="open_new_private_tab"
|
||||
android:enabled="true"
|
||||
android:icon="@drawable/ic_static_shortcut_private_tab"
|
||||
android:shortcutShortLabel="@string/home_screen_shortcut_open_new_private_tab"
|
||||
android:shortcutLongLabel="@string/home_screen_shortcut_open_new_private_tab">
|
||||
<intent
|
||||
android:action="org.mozilla.fenix.OPEN_PRIVATE_TAB"
|
||||
android:targetPackage="org.mozilla"
|
||||
android:targetClass="org.mozilla.fenix.IntentReceiverActivity" />
|
||||
</shortcut>
|
||||
</shortcuts>
|