Skip to content

Commit

Permalink
Merge tag '1.0.0-alpha04'
Browse files Browse the repository at this point in the history
Release 1.0.0-alpha04
  • Loading branch information
05nelsonm committed Jun 25, 2021
2 parents 5d3ddd7 + 2ea51f4 commit 50bd3ca
Show file tree
Hide file tree
Showing 198 changed files with 4,412 additions and 530 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ jobs:
java-version: 1.8

- name: Run Android Linter
run: ./gradlew lintDebug
run: ./gradlew :sphinx:application:sphinx:lintDebug

- name: Run Unit Tests
run: ./gradlew testDebugUnitTest
run: ./gradlew :sphinx:application:sphinx:testDebugUnitTest

- name: Assemble Debug APK
run: ./gradlew assembleDebug
run: ./gradlew :sphinx:application:sphinx:assembleDebug

- name: Assemble Debug Test APK
run: ./gradlew assembleDebugAndroidTest
run: ./gradlew :sphinx:application:sphinx:assembleDebugAndroidTest
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Change Log

## Version 1.0.0-alpha04 (2021-06-25)
- Adds ability to receive images
- Adds ability to send direct payments
- Fixes crash related to Message Selection Menu blurred background

## Version 1.0.0-alpha03 (2021-06-16)
- Adds Message Selection Menu functionality with limited functionality
- Boosting message only
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ kapt.include.compile.classpath=false
# Enable In Logcat to determine Kapt
#kapt.verbose=true

VERSION_NAME=1.0.0-alpha03
VERSION_NAME=1.0.0-alpha04

# The trailing 2 digits are for `alpha##` releases. For example:
# 4.4.1-alpha02 = 441102 where `102` stands for alpha02
# 4.4.1-beta01 = 441201 where `201` stands for beta01
# 4.4.1-rc01 = 441301 where `301` stands for rc01
VERSION_CODE=100103
VERSION_CODE=100104


# Kotlin-Android submodule
KA_VERSION_NAME=1.0.0-alpha03
KA_VERSION_NAME=1.0.0-alpha04

# The trailing 2 digits are for `alpha##` releases. For example:
# 4.4.1-alpha02 = 441102 where `102` stands for alpha02
# 4.4.1-beta01 = 441201 where `201` stands for beta01
# 4.4.1-rc01 = 441301 where `301` stands for rc01
KA_VERSION_CODE=100103
KA_VERSION_CODE=100104
8 changes: 4 additions & 4 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ ext.deps = [
viewBinding: "androidx.databinding:viewbinding:${versions.androidGradle}",
],
// bouncyCastle: "org.bouncycastle:bcprov-jdk15on:1.65",
chrisbanes: [
insetter: "dev.chrisbanes.insetter:insetter:${versions.insetter}",
insetterWidgets: "dev.chrisbanes.insetter:insetter-widgets:${versions.insetter}"
],
google: [
hilt: "com.google.dagger:hilt-android:${versions.hilt}",
material: "com.google.android.material:material:1.4.0-beta01",
Expand All @@ -73,10 +77,6 @@ ext.deps = [
guardianProject: [
jtorctl: "info.guardianproject:jtorctl:0.4",
],
chrisbanes: [
insetter: "dev.chrisbanes.insetter:insetter:${versions.insetter}",
insetterWidgets: "dev.chrisbanes.insetter:insetter-widgets:${versions.insetter}"
],
instacart: [
coil: "io.coil-kt:coil:${versions.coil}",
coilBase: "io.coil-kt:coil-base:${versions.coil}",
Expand Down
14 changes: 12 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ include ':sphinx:application:common:resources'
include ':sphinx:application:common:kotlin-response'
include ':sphinx:application:common:logger'

include ':sphinx:application:common:wrappers:wrapper-attachment'
include ':sphinx:application:common:wrappers:wrapper-chat'
include ':sphinx:application:common:wrappers:wrapper-common'
include ':sphinx:application:common:wrappers:wrapper-contact'
include ':sphinx:application:common:wrappers:wrapper-invite'
include ':sphinx:application:common:wrappers:wrapper-lightning'
include ':sphinx:application:common:wrappers:wrapper-message'
include ':sphinx:application:common:wrappers:wrapper-message-media'
include ':sphinx:application:common:wrappers:wrapper-relay'
include ':sphinx:application:common:wrappers:wrapper-rsa'
include ':sphinx:application:common:wrappers:wrapper-subscription'
Expand All @@ -28,6 +30,8 @@ include ':sphinx:application:data:concepts:concept-coredb'
include ':sphinx:application:data:features:feature-coredb'
include ':sphinx:application:data:concepts:concept-image-loader'
include ':sphinx:application:data:features:image-loader:feature-image-loader-android'
include ':sphinx:application:data:concepts:concept-meme-server'
include ':sphinx:application:data:features:feature-meme-server'
include ':sphinx:application:data:concepts:concept-paging'
include ':sphinx:application:data:concepts:concept-relay'
include ':sphinx:application:data:features:feature-relay'
Expand All @@ -44,7 +48,11 @@ include ':sphinx:application:data:features:feature-repository-android'

include ':sphinx:application:network:concepts:clients:concept-network-client'
include ':sphinx:application:network:concepts:clients:concept-network-client-cache'
include ':sphinx:application:network:concepts:clients:concept-network-client-crypto'
include ':sphinx:application:network:features:feature-network-client'

include ':sphinx:application:network:concepts:queries:concept-network-query-attachment'
include ':sphinx:application:network:features:queries:feature-network-query-attachment'
include ':sphinx:application:network:concepts:queries:concept-network-query-chat'
include ':sphinx:application:network:features:queries:feature-network-query-chat'
include ':sphinx:application:network:concepts:queries:concept-network-query-contact'
Expand Down Expand Up @@ -91,18 +99,20 @@ include ':sphinx:screens:splash:key-restore'

// Screens-Detail
include ':sphinx:screens-detail:add-friend:add-friend'
include ':sphinx:screens-detail:podcast-player:podcast-player'
include ':sphinx:screens-detail:common:detail-resources'
include ':sphinx:screens-detail:create-tribe:create-tribe'
include ':sphinx:screens-detail:join-tribe:join-tribe'
include ':sphinx:screens-detail:new-contact:new-contact'
include ':sphinx:screens-detail:payments:payment-receive:payment-receive'
include ':sphinx:screens-detail:payments:payment-send:payment-send'
include ':sphinx:screens-detail:podcast-player:podcast-player'
include ':sphinx:screens-detail:qr-code:qr-code'
include ':sphinx:screens-detail:scanner:scanner'
include ':sphinx:screens-detail:scanner:scanner-view-model-coordinator'
include ':sphinx:screens-detail:send-attachment:send-attachment'
include ':sphinx:screens-detail:send-attachment:send-attachment-view-model-coordinator'
include ':sphinx:screens-detail:support-ticket:support-ticket'
include ':sphinx:screens-detail:transactions:transactions'
include ':sphinx:screens-detail:qr-code:qr-code'

// Service
include ':sphinx:service:concepts:concept-service-media-player'
Expand Down
8 changes: 4 additions & 4 deletions sphinx/activity/main/activitymain/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ dependencies {

api project(path: ':sphinx:screens-detail:add-friend:add-friend')
api project(path: ':sphinx:screens-detail:create-tribe:create-tribe')
api project(path: ':sphinx:screens-detail:join-tribe:join-tribe')
api project(path: ':sphinx:screens-detail:new-contact:new-contact')
api project(path: ':sphinx:screens-detail:payments:payment-receive:payment-receive')
api project(path: ':sphinx:screens-detail:payments:payment-send:payment-send')
api project(path: ':sphinx:screens-detail:scanner:scanner')
api project(path: ':sphinx:screens-detail:podcast-player:podcast-player')
api project(path: ':sphinx:screens-detail:qr-code:qr-code')
api project(path: ':sphinx:screens-detail:scanner:scanner')
api project(path: ':sphinx:screens-detail:send-attachment:send-attachment')
api project(path: ':sphinx:screens-detail:support-ticket:support-ticket')
api project(path: ':sphinx:screens-detail:transactions:transactions')
api project(path: ':sphinx:screens-detail:join-tribe:join-tribe')
api project(path: ':sphinx:screens-detail:podcast-player:podcast-player')
// api project(path: )

implementation deps.chrisbanes.insetter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import chat.sphinx.payment_send.navigation.PaymentSendNavigator
import chat.sphinx.podcast_player.navigation.PodcastPlayerNavigator
import chat.sphinx.qr_code.navigation.QRCodeNavigator
import chat.sphinx.scanner.navigation.ScannerNavigator
import chat.sphinx.send_attachment.navigation.SendAttachmentNavigator
import chat.sphinx.splash.navigation.SplashNavigator
import chat.sphinx.support_ticket.navigation.SupportTicketNavigator
import chat.sphinx.transactions.navigation.TransactionsNavigator
Expand Down Expand Up @@ -220,10 +221,15 @@ internal object NavigationModule {
): JoinTribeNavigator =
joinTribeNavigatorImpl


@Provides
fun provideTribeChatPodcastPlayerNavigator(
tribeChatPodcastPlayerNavigatorImpl: PodcastPlayerNavigatorImpl
): PodcastPlayerNavigator =
tribeChatPodcastPlayerNavigatorImpl

@Provides
fun provideSendAttachmentNavigator(
sendAttachmentNavigatorImpl: SendAttachmentNavigatorImpl
): SendAttachmentNavigator =
sendAttachmentNavigatorImpl
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package chat.sphinx.activitymain.navigation.navigators.detail

import chat.sphinx.activitymain.navigation.drivers.DetailNavigationDriver
import chat.sphinx.qr_code.navigation.QRCodeNavigator
import chat.sphinx.scanner.navigation.ScannerNavigator
import dagger.hilt.android.scopes.ActivityRetainedScoped
import javax.inject.Inject

internal class QRCodeNavigatorImpl @Inject constructor(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package chat.sphinx.activitymain.navigation.navigators.detail

import chat.sphinx.activitymain.navigation.drivers.DetailNavigationDriver
import chat.sphinx.send_attachment.navigation.SendAttachmentNavigator
import javax.inject.Inject

internal class SendAttachmentNavigatorImpl @Inject constructor(
detailDriver: DetailNavigationDriver,
): SendAttachmentNavigator(detailDriver)
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package chat.sphinx.activitymain.navigation.navigators.primary

import chat.sphinx.activitymain.navigation.drivers.DetailNavigationDriver
import chat.sphinx.activitymain.navigation.drivers.PrimaryNavigationDriver
import chat.sphinx.chat_contact.navigation.ContactChatNavigator
import chat.sphinx.payment_send.navigation.ToPaymentSendDetail
import chat.sphinx.wrapper_common.dashboard.ChatId
import chat.sphinx.wrapper_common.dashboard.ContactId
import javax.inject.Inject

internal class ContactChatNavigatorImpl @Inject constructor(
navigationDriver: PrimaryNavigationDriver
navigationDriver: PrimaryNavigationDriver,
private val detailDriver: DetailNavigationDriver,
): ContactChatNavigator(navigationDriver)
{
override suspend fun toPaymentSendDetail(contactId: ContactId, chatId: ChatId?) {
detailDriver.submitNavigationRequest(ToPaymentSendDetail(contactId, chatId))
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package chat.sphinx.activitymain.navigation.navigators.primary

import chat.sphinx.activitymain.navigation.drivers.DetailNavigationDriver
import chat.sphinx.activitymain.navigation.drivers.PrimaryNavigationDriver
import chat.sphinx.chat_group.navigation.GroupChatNavigator
import chat.sphinx.payment_send.navigation.ToPaymentSendDetail
import chat.sphinx.wrapper_common.dashboard.ChatId
import chat.sphinx.wrapper_common.dashboard.ContactId
import javax.inject.Inject

internal class GroupChatNavigatorImpl @Inject constructor(
navigationDriver: PrimaryNavigationDriver
navigationDriver: PrimaryNavigationDriver,
private val detailDriver: DetailNavigationDriver,
): GroupChatNavigator(navigationDriver)
{
override suspend fun toPaymentSendDetail(contactId: ContactId, chatId: ChatId?) {
detailDriver.submitNavigationRequest(ToPaymentSendDetail(contactId, chatId))
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,24 @@ package chat.sphinx.activitymain.navigation.navigators.primary
import chat.sphinx.activitymain.navigation.drivers.DetailNavigationDriver
import chat.sphinx.activitymain.navigation.drivers.PrimaryNavigationDriver
import chat.sphinx.chat_tribe.navigation.TribeChatNavigator
import chat.sphinx.payment_send.navigation.ToPaymentSendDetail
import chat.sphinx.podcast_player.navigation.ToPodcastPlayerScreen
import chat.sphinx.podcast_player.objects.Podcast
import chat.sphinx.send_attachment.navigation.ToSendAttachmentDetail
import chat.sphinx.wrapper_common.dashboard.ChatId
import chat.sphinx.wrapper_common.dashboard.ContactId
import javax.inject.Inject

internal class TribeChatNavigatorImpl @Inject constructor(
navigationDriver: PrimaryNavigationDriver,
private val detailDriver: DetailNavigationDriver,
): TribeChatNavigator(navigationDriver)
{

override suspend fun toPaymentSendDetail(contactId: ContactId, chatId: ChatId?) {
detailDriver.submitNavigationRequest(ToPaymentSendDetail(contactId, chatId))
}

override suspend fun toPodcastPlayerScreen(chatId: ChatId, podcast: Podcast) {
detailDriver.submitNavigationRequest(ToPodcastPlayerScreen(chatId, podcast))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<include app:graph="@navigation/new_contact_nav_graph" />
<include app:graph="@navigation/join_tribe_nav_graph" />
<include app:graph="@navigation/podcast_player_nav_graph" />
<include app:graph="@navigation/send_attachment_nav_graph" />

<fragment
android:id="@+id/navigation_detail_blank_fragment"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package chat.sphinx.resources

import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Typeface
import android.graphics.*
import android.os.Build
import android.os.Handler
import android.os.Looper
import android.renderscript.Allocation
import android.renderscript.Element
import android.renderscript.RenderScript
import android.renderscript.ScriptIntrinsicBlur
import android.view.PixelCopy
import android.view.View
import android.view.Window
import android.widget.TextView
import androidx.annotation.ColorInt
import androidx.annotation.ColorRes
Expand Down Expand Up @@ -80,16 +82,48 @@ inline fun Bitmap.blur(context: Context, radius:Float = 10F): Bitmap?{
return bitmap
}

// https://stackoverflow.com/a/58315279
@Suppress("NOTHING_TO_INLINE")
inline fun View.takeScreenshot(): Bitmap {
val bitmap = Bitmap.createBitmap(this.measuredWidth, this.measuredHeight, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
val bgDrawable = this.background
if (bgDrawable != null) {
bgDrawable.draw(canvas)
inline fun View.takeScreenshot(
window: Window,
crossinline bitmapCallback: (Bitmap) -> Unit,
crossinline errorCallback: () -> Unit,
) {
val width = measuredWidth
val height = measuredHeight
val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val location = IntArray(2)
getLocationInWindow(location)
PixelCopy.request(
window,
Rect(location[0], location[1], location[0] + width, location[1] + height),
bitmap,
{
if (it == PixelCopy.SUCCESS) {
bitmapCallback.invoke(bitmap)
} else {
errorCallback.invoke()
}
},
Handler(Looper.getMainLooper())
)
} else {
canvas.drawColor(Color.WHITE)
val canvas = Canvas(bitmap)
val bgDrawable = background
if (bgDrawable != null) {
bgDrawable.draw(canvas)
} else {
canvas.drawColor(Color.WHITE)
}

try {
this.draw(canvas)
canvas.setBitmap(null)
bitmapCallback.invoke(bitmap)
} catch (e: Exception) {
errorCallback.invoke()
}
}
this.draw(canvas)
return bitmap
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="@android:color/white">
<item android:drawable="@drawable/square_deep_night" />
</ripple>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="344dp"
android:height="276.28dp"
android:viewportWidth="344"
android:viewportHeight="276.28">
<path
android:pathData="M316,276.28H28a28,28 0,0 1,-28 -28v-183a28,28 0,0 1,28 -28H93.27l9.11,-17.84a20.52,20.52 0,0 1,1.77 -2.93C111.16,6.79 124.39,0 136.3,0h70.94c11.92,0 25.14,6.79 32.16,16.52a20.47,20.47 0,0 1,1.8 3L250,37.28h66a28,28 0,0 1,28 28v183A28,28 0,0 1,316 276.28ZM28,61.28a4.05,4.05 0,0 0,-4 4v183a4.05,4.05 0,0 0,4 4H316a4.05,4.05 0,0 0,4 -4v-183a4.05,4.05 0,0 0,-4 -4H242.56a12,12 0,0 1,-10.75 -6.67l-12,-24.27C217.19,27 211.32,24 207.24,24H136.3c-4.08,0 -10,3 -12.54,6.36L111.31,54.74a12,12 0,0 1,-10.69 6.54Z"
android:fillColor="#010101"/>
<path
android:pathData="M171.86,103.12a47.66,47.66 0,1 1,-47.66 47.66,47.35 47.35,0 0,1 47.66,-47.66h0m0,-24a71.66,71.66 0,1 0,71.66 71.66,71.66 71.66,0 0,0 -71.66,-71.66Z"
android:fillColor="#231f20"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="318dp"
android:height="318dp"
android:viewportWidth="318"
android:viewportHeight="318">
<path
android:pathData="M287,0L31,0A31,31 0,0 0,0 31L0,287a31,31 0,0 0,31 31L287,318a31,31 0,0 0,31 -31L318,31A31,31 0,0 0,287 0ZM294,287a7,7 0,0 1,-7 7L31,294a7,7 0,0 1,-7 -7L24,31a7,7 0,0 1,7 -7L287,24a7,7 0,0 1,7 7Z"
android:fillColor="#231f20"/>
<path
android:pathData="M217.08,135.35a12,12 0,0 0,-17 0l-55.17,55.17L122.37,168a12,12 0,0 0,-17 0L38.12,235.25a12,12 0,0 0,17 17l58.79,-58.79 44.26,44.26a12,12 0,0 0,17 -17L161.9,207.5l46.69,-46.69 52.46,52.46a12,12 0,1 0,17 -17Z"
android:fillColor="#231f20"/>
<path
android:pathData="M95.46,132.08A37.61,37.61 0,1 0,57.85 94.47,37.65 37.65,0 0,0 95.46,132.08ZM95.46,80.86A13.61,13.61 0,1 1,81.85 94.47,13.63 13.63,0 0,1 95.46,80.86Z"
android:fillColor="#231f20"/>
</vector>
Loading

0 comments on commit 50bd3ca

Please sign in to comment.