Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize project and implement UI flow for sending files #1

Merged
merged 64 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8eea774
Init project & set up navigation
hieuwu Apr 15, 2024
540fc37
Add preview for bottom tab
hieuwu Apr 17, 2024
f4a3f22
Add icons extended
hieuwu Apr 17, 2024
724089b
Extract dependency and rename navigation destination
hieuwu Apr 17, 2024
4f7c12f
Add colors & mock destination
hieuwu Apr 17, 2024
8ea7647
Remove unused property
hieuwu Apr 17, 2024
2826dc5
Optimize import, set status bar color
hieuwu Apr 17, 2024
26a5525
Remove unused property
hieuwu Apr 17, 2024
f44cb4a
Add trailing comma, implement screen
hieuwu Apr 17, 2024
18c9957
Add permission required
hieuwu Apr 17, 2024
13c811c
Ask for permission
hieuwu Apr 17, 2024
5dd4702
Add permission for camerax and dependencies
hieuwu Apr 18, 2024
81002da
Add transfer confirmation screen
hieuwu Apr 18, 2024
75571d2
Implement screen
hieuwu Apr 18, 2024
49dd85c
Navigate to confirm after file selection
hieuwu Apr 18, 2024
ba60a14
Add destination
hieuwu Apr 18, 2024
31dcd71
Add QR scanner for app
hieuwu Apr 18, 2024
3bdc801
Remove unused imports
hieuwu Apr 18, 2024
babfef3
ADd appcompat
hieuwu Apr 18, 2024
2710ddb
Add app compat and dependency layout
hieuwu Apr 18, 2024
a438617
Extract dependencies version
hieuwu Apr 18, 2024
8ce4b63
Navigate to QR code scanner
hieuwu Apr 19, 2024
8358279
Ui tweak with scaffold
hieuwu Apr 19, 2024
8a1da86
Add resources
hieuwu Apr 19, 2024
054a261
Hide appbar
hieuwu Apr 19, 2024
e91151c
Add place holder
hieuwu Apr 19, 2024
25d13fb
Add back button
hieuwu Apr 19, 2024
4f351bf
Add icon
hieuwu Apr 19, 2024
e4c3de3
Handle navigating back
hieuwu Apr 19, 2024
5bf78ce
Remove unused imports
hieuwu Apr 19, 2024
f6cc1dd
Add mock avatar
hieuwu Apr 20, 2024
861c38f
Fix crash
hieuwu Apr 20, 2024
7138492
Use mock QR code and avatar
hieuwu Apr 20, 2024
0e44aeb
Create transfer participants header
hieuwu Apr 21, 2024
4d5431f
Add transfer progress screen
hieuwu Apr 21, 2024
28d46a5
Extract strings
hieuwu Apr 21, 2024
f5e790e
Restructure project
hieuwu Apr 21, 2024
28fb80a
On request permission
hieuwu Apr 21, 2024
93eb7c2
Add new color
hieuwu Apr 21, 2024
905a310
Implement dialog and extract composable
hieuwu Apr 21, 2024
a191b13
Register navigation & screen
hieuwu Apr 21, 2024
9d734a2
Mock end point and handle showing dialog
hieuwu Apr 21, 2024
e97b6c9
Remove unused files
hieuwu Apr 21, 2024
f62b44c
Create settings screen and header composables
hieuwu Apr 22, 2024
7b5089c
Add color
hieuwu Apr 22, 2024
91e532e
Create edit profile screen
hieuwu Apr 22, 2024
ad58c6b
Update navigation spec
hieuwu Apr 22, 2024
aa271f5
Extract color
hieuwu Apr 22, 2024
430fa1b
Use color constant instead
hieuwu Apr 22, 2024
deee173
Create check
hieuwu Apr 23, 2024
78169cb
Simplify check
hieuwu Apr 23, 2024
7db8552
Update gitignore
hieuwu May 2, 2024
d2969d2
Update gitignore
hieuwu May 2, 2024
9d830d1
Update gitignore
hieuwu May 2, 2024
319b7b4
Update gitignore
hieuwu May 2, 2024
dee8e95
Remove unused files
hieuwu May 2, 2024
7cb60a3
Remove unused permission
hieuwu May 2, 2024
44c6d56
Extract string resource
hieuwu May 2, 2024
f7f991f
Replace png with vector. Update string resource
hieuwu May 2, 2024
0817598
Remove unused code and replace deprecated value
hieuwu May 2, 2024
53f5fee
Avoid double bang
hieuwu May 2, 2024
d2d5b02
Improve code
hieuwu May 2, 2024
fe26205
Make screen scrollable, rename method
hieuwu May 2, 2024
9ef106a
Renaming the package from com.arkbuilders to dev.arkbuilders
kirillt May 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build the app

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
check:
if: ${{ startsWith(github.actor, 'dependabot') }}
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1.0.5

- name: Build debug APK
run: ./gradlew assembleDebug

build:
if: ${{ ! startsWith(github.actor, 'dependabot') }}
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1.0.5

- name: Build debug APK
run: ./gradlew assembleDebug

- name: Upload debug arm64-v8a APK
uses: actions/upload-artifact@v3
with:
name: ark-drop-debug-apk
path: ./app/build/outputs/apk/debug/app-debug.apk

lint:
environment: Development
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'

- name: Run linter
run: ./gradlew lint

- uses: actions/upload-artifact@v3
with:
name: lint-results
path: ./app/build/reports/lint-results-debug.html
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.iml
.gradle
/local.properties
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/.idea/
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
85 changes: 85 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
}

android {
namespace = "com.arkbuilders.arkdrop"
compileSdk = 34

defaultConfig {
applicationId = "com.arkbuilders.arkdrop"
minSdk = 31
kirillt marked this conversation as resolved.
Show resolved Hide resolved
targetSdk = 34
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.3"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}

dependencies {

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.material.icons.extended)
implementation(libs.androidx.appcompat)
implementation(libs.material)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)

implementation(libs.androidx.camera.core)
implementation(libs.androidx.camera.camera2)
implementation(libs.androidx.camera.lifecycle)
implementation(libs.androidx.camera.view)
implementation (libs.androidx.camera.mlkit.vision)
implementation(libs.barcode.scanning)

testImplementation(libs.junit)

androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)

debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
40 changes: 40 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature android:name="android.hardware.camera.any" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<!--
To handle the reselection within the app on devices running Android 14
or higher if your app targets Android 14 (API level 34) or higher.
-->
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />

<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.ARKDrop">
<activity
android:name=".presentation.feature.qrcodescanner.QRCodeScannerActivity"
android:exported="false"
android:theme="@style/Theme.AppCompat" />
<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.ARKDrop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
79 changes: 79 additions & 0 deletions app/src/main/java/com/arkbuilders/arkdrop/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package com.arkbuilders.arkdrop

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.arkbuilders.arkdrop.presentation.navigation.BottomTab
import com.arkbuilders.arkdrop.presentation.navigation.TransfersDestination
import com.arkbuilders.arkdrop.presentation.navigation.navRegistration
import com.arkbuilders.arkdrop.presentation.permission.PermissionManager
import com.arkbuilders.arkdrop.ui.theme.ARKDropTheme

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Register ActivityResult handler
val requestPermissions =
registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { results ->
// Handle permission requests results
// See the permission example in the Android platform samples: https://github.com/android/platform-samples
}

PermissionManager.initialize(requestPermissions)
PermissionManager.requestPermission(baseContext)
setContent {
ARKDropTheme {
// A surface container using the 'background' color from the theme
val navController = rememberNavController()
val currentBackStack by navController.currentBackStackEntryAsState()
val currentDestination = currentBackStack?.destination
val scope = rememberCoroutineScope()

Scaffold(
bottomBar = {
BottomTab(
navController = navController,
currentDestination = currentDestination
)
}) { innerPadding ->
NavHost(
navController,
startDestination = TransfersDestination.route,
Modifier.padding(innerPadding)
) {
navRegistration(navController)
}
}

}
}
}
}

@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(
text = "Hello $name!",
modifier = modifier
)
}

@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
ARKDropTheme {
Greeting("Android")
}
}
Loading
Loading