1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-09-19 15:11:42 +02:00

Add base application and activity

This commit is contained in:
Allan Wang 2023-06-17 21:43:39 -07:00
parent e6d3f279ea
commit 48339b8a15
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
25 changed files with 318 additions and 8 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11">
<bytecodeTargetLevel target="17">
<module name="Frost-for-Facebook.buildSrc" target="11" />
<module name="Frost-for-Facebook.buildSrc.main" target="11" />
<module name="Frost-for-Facebook.buildSrc.test" target="11" />

View File

@ -1,6 +0,0 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="/*&#10; * Copyright &amp;#36;year Allan Wang&#10; *&#10; * This program is free software: you can redistribute it and/or modify&#10; * it under the terms of the GNU General Public License as published by&#10; * the Free Software Foundation, either version 3 of the License, or&#10; * (at your option) any later version.&#10; *&#10; * This program is distributed in the hope that it will be useful,&#10; * but WITHOUT ANY WARRANTY; without even the implied warranty of&#10; * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#10; * GNU General Public License for more details.&#10; *&#10; * You should have received a copy of the GNU General Public License&#10; * along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.&#10; */" />
<option name="myName" value="GPLv3" />
</copyright>
</component>

View File

@ -52,7 +52,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -31,6 +31,7 @@ android {
buildFeatures {
compose = true
buildConfig = true
}
composeOptions {

View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.pitchedapps.frost">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<application
android:name=".FrostApp"
android:allowBackup="true"
android:extractNativeLibs="false"
android:fullBackupContent="@xml/frost_backup_rules"
android:icon="@mipmap/ic_launcher_round"
android:label="@string/frost_name"
android:requestLegacyExternalStorage="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/FrostTheme"
android:usesCleartextTraffic="true"
tools:ignore="UnusedAttribute">
<activity
android:name=".StartActivity"
android:exported="true"
android:noHistory="true"
android:theme="@style/FrostTheme.Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!--
Config changes taken from Fenix with:
locale
addition
https://github.com/mozilla-mobile/fenix/blob/main/app/src/main/AndroidManifest.xml
-->
<!-- <activity-->
<!-- android:name=".activities.MainActivity"-->
<!-- android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|layoutDirection|smallestScreenSize|screenLayout|locale"-->
<!-- android:hardwareAccelerated="true"-->
<!-- android:label="@string/frost_name" />-->
<!-- -->
<!-- <activity-->
<!-- android:name=".activities.FrostWebActivity"-->
<!-- android:autoRemoveFromRecents="true"-->
<!-- android:configChanges="keyboard|keyboardHidden|mcc|mnc|orientation|screenSize|layoutDirection|smallestScreenSize|screenLayout|locale"-->
<!-- android:exported="true"-->
<!-- android:hardwareAccelerated="true"-->
<!-- android:label="@string/frost_web"-->
<!-- android:launchMode="singleInstance"-->
<!-- android:taskAffinity="com.pitchedapps.frost.single.web"-->
<!-- android:theme="@style/FrostTheme.Overlay.Slide">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.SEND" />-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- <data android:mimeType="text/plain" />-->
<!-- </intent-filter>-->
<!-- <intent-filter-->
<!-- android:autoVerify="true"-->
<!-- tools:ignore="UnusedAttribute">-->
<!-- <action android:name="android.intent.action.VIEW" />-->
<!-- <category android:name="android.intent.category.DEFAULT" />-->
<!-- <category android:name="android.intent.category.BROWSABLE" />-->
<!-- <data-->
<!-- android:host="m.facebook.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="m.facebook.com"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="mobile.facebook.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="mobile.facebook.com"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="touch.facebook.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="touch.facebook.com"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="fb.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="fb.com"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="fb.me"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="fb.me"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="facebook.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="facebook.com"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="www.facebook.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="www.facebook.com"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="messenger.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="messenger.com"-->
<!-- android:scheme="https" />-->
<!-- <data-->
<!-- android:host="www.messenger.com"-->
<!-- android:scheme="http" />-->
<!-- <data-->
<!-- android:host="www.messenger.com"-->
<!-- android:scheme="https" />-->
<!-- </intent-filter>-->
<!-- </activity>-->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>

View File

@ -0,0 +1,60 @@
/*
* Copyright 2018 Allan Wang
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.pitchedapps.frost
import android.app.Activity
import android.app.Application
import android.os.Bundle
import android.util.Log
import com.google.common.flogger.FluentLogger
import dagger.hilt.android.HiltAndroidApp
import java.util.Random
import javax.inject.Inject
@HiltAndroidApp
class FrostApp : Application() {
override fun onCreate() {
super.onCreate()
if (BuildConfig.DEBUG) {
registerActivityLifecycleCallbacks(
object : ActivityLifecycleCallbacks {
override fun onActivityPaused(activity: Activity) {}
override fun onActivityResumed(activity: Activity) {}
override fun onActivityStarted(activity: Activity) {}
override fun onActivityDestroyed(activity: Activity) {
logger.atFine().log("Activity %s destroyed", activity.localClassName)
}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityStopped(activity: Activity) {}
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {
logger.atFine().log("Activity %s created", activity.localClassName)
}
}
)
}
}
companion object {
private val logger = FluentLogger.forEnclosingClass()
}
}

View File

@ -0,0 +1,8 @@
package com.pitchedapps.frost
import androidx.appcompat.app.AppCompatActivity
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
class StartActivity : AppCompatActivity() {
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="10dp" />
<solid android:color="@color/facebook_blue" />
</shape>
</item>
</layer-list>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="200dp"
android:height="200dp"
android:viewportHeight="177.16534"
android:viewportWidth="177.16534">
<path
android:pathData="M88.9405 31.61857l41.06143 23.88663M88.3467 31.59584l-31.358 18.2953M56.87005
51.09542v94.26222M57.20726 87.2077l40.97656 23.86424"
android:strokeColor="#fff"
android:strokeLineCap="round"
android:strokeWidth="10" />
</vector>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="177.16534"
android:viewportWidth="177.16534">
<path
android:pathData="M88.9405 31.61857l41.06143 23.88663M88.3467 31.59584l-31.358 18.2953M56.87005
51.09542v94.26222M57.20726 87.2077l40.97656 23.86424"
android:strokeColor="#fff"
android:strokeLineCap="round"
android:strokeWidth="10" />
</vector>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/frost_splash_background" />
<item android:bottom="@dimen/splash_logo">
<bitmap
android:gravity="center"
android:src="@drawable/splash_logo" />
</item>
</layer-list>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="frost_splash_background">@color/facebook_blue</color>
<color name="facebook_blue">#3b5998</color>
<color name="facebook_blue_light">#6183C8</color>
<color name="facebook_blue_dark">#2e4b86</color>
<color name="frost_notification_accent">@color/facebook_blue</color>
</resources>

View File

@ -0,0 +1,3 @@
<resources>
<dimen name="splash_logo">16dp</dimen>
</resources>

View File

@ -0,0 +1,24 @@
<resources>
<style name="FrostTheme" parent="Theme.Material3.DayNight.NoActionBar" />
<style name="FrostTheme.Transparent">
<item name="android:windowShowWallpaper">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
</style>
<style name="FrostTheme.Overlay">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
</style>
<style name="FrostTheme.Splash" parent="Theme.Material3.Dark.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:navigationBarColor">@color/frost_splash_background</item>
<item name="colorPrimaryDark">@color/frost_splash_background</item>
<item name="colorAccent">@color/frost_splash_background</item>
</style>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path
name="external"
path="/" />
<cache-path
name="cache"
path="/" />
<files-path
name="files"
path="/" />
</paths>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<exclude
domain="database"
path="Cookies.db" />
<exclude
domain="database"
path="Cookies.db-journal" />
</full-backup-content>