Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
a8630d7
Add mobile script
Rokt33r Jun 5, 2021
01439a5
Implement basic functionality
Rokt33r Jun 15, 2021
ba4dc5c
Fix navigator
Rokt33r Jul 1, 2021
1fb6eeb
Fix style errors in MarkdownView
Rokt33r Jul 1, 2021
85b2bb0
Add justify-center className to ModalLine
Rokt33r Jul 1, 2021
bd5aec0
Clean up settings modal
Rokt33r Jul 1, 2021
b336ecd
Justify placeholder text of RoundedImage
Rokt33r Jul 1, 2021
398a979
Clean up all pages
Rokt33r Jul 1, 2021
552bc90
Implement SearchModal
Rokt33r Jul 2, 2021
87c0f82
Implement DocCreateModal
Rokt33r Jul 2, 2021
638b751
Implement DocInfoModal
Rokt33r Jul 2, 2021
94c73b8
Improvie smart folder modal style
Rokt33r Jul 2, 2021
89e5a5d
Improve contentmanager style
Rokt33r Jul 2, 2021
f066c0d
Add build script for mobile
Rokt33r Jul 2, 2021
66f043d
Add initial document backup
Rokt33r Jul 6, 2021
b6fa799
Copy static files for mobile app
Rokt33r Jul 6, 2021
70dff47
Fix invalid backup realtime server url
Rokt33r Jul 6, 2021
945c054
Replace contextmenu
Rokt33r Jul 6, 2021
a5b4eb3
Resize UI for mobile device
Rokt33r Jul 6, 2021
4441a43
Discard unused statements
Rokt33r Jul 6, 2021
ac189ec
Fix settings team form in members tab
Rokt33r Jul 6, 2021
75c923e
Init accesstoken always
Rokt33r Jul 6, 2021
a187549
Add favicon for mobile app
Rokt33r Jul 6, 2021
9f5bb78
Improve sign in page
Rokt33r Jul 6, 2021
65129fa
Discard deprecated SignOutButton
Rokt33r Jul 6, 2021
74737af
Fix style syntax error in shared/Link
Rokt33r Jul 6, 2021
f1454e6
Style root page after authenticated
Rokt33r Jul 6, 2021
5ee97ba
Extract signOut method
Rokt33r Jul 6, 2021
a4d6743
Adjust navigation text colors
Rokt33r Jul 6, 2021
fc137e4
Style cooperate page
Rokt33r Jul 6, 2021
98829ce
Fix i18n
Rokt33r Jul 6, 2021
f0f4db6
Add DeleteAccountPage for mobile
Rokt33r Jul 6, 2021
b0f6938
Add mobile property to query when signing in
Rokt33r Jul 6, 2021
26d751b
Fix redirect after creating team
Rokt33r Jul 6, 2021
bc7d9e3
Restyle create team page
Rokt33r Jul 6, 2021
7d7e46a
Add setting page
Rokt33r Jul 7, 2021
05b101b
Fix compiler errors
Rokt33r Jul 7, 2021
6ea1817
Fix root page routing
Rokt33r Jul 7, 2021
7110546
Discard UploadsPage
Rokt33r Jul 7, 2021
45d4bc0
Reintroduce search modal
Rokt33r Jul 7, 2021
b26e375
Fix react warnings from cooperate page
Rokt33r Jul 7, 2021
1f37521
Discard legacy version access token handling
Rokt33r Jul 8, 2021
d392f5e
Add getWorkspaceHref and getTagHref for mobile
Rokt33r Jul 8, 2021
74f3e82
Replace desktop modals with mobile modals
Rokt33r Jul 8, 2021
befd140
Discard comment from markdown view of mobile app
Rokt33r Jul 9, 2021
d96a112
Fix conetxtmenu overflow
Rokt33r Jul 9, 2021
494b491
Show folder name
Rokt33r Jul 9, 2021
6ef7132
Replace workspaces label with folders
Rokt33r Jul 9, 2021
83469f9
Adjust side padding of doc preview and content list view
Rokt33r Jul 9, 2021
aa564ce
Discard attachment nav item
Rokt33r Jul 9, 2021
1193016
Fix move modals
Rokt33r Jul 9, 2021
87f9962
Fix page label of doc status show page and tags show page
Rokt33r Jul 9, 2021
f19985c
Fix zoom in issue in iOS
Rokt33r Jul 9, 2021
615c37f
Fix new doc/folder button in content manager
Rokt33r Jul 9, 2021
d7aa891
Fix folder edit modal
Rokt33r Jul 9, 2021
0946250
Add sign out button to space selector
Rokt33r Jul 9, 2021
de114f6
Fix smart folder form
Rokt33r Jul 9, 2021
702ad2d
Fix mobile redirect url
Rokt33r Jul 9, 2021
7dea4a4
Discard deprecated legacy boostnot url
Rokt33r Jul 13, 2021
931bd33
Implement native app authtication handling
Rokt33r Jul 13, 2021
d637e71
Add android project
Rokt33r Jul 13, 2021
e9891c6
Add ios project
Rokt33r Jul 13, 2021
3742048
Use general gitignore config for ios project
Rokt33r Jul 13, 2021
328b649
Fix navigator space selector image icon
Rokt33r Jul 13, 2021
8453d4a
Fix modifying label
Rokt33r Jul 13, 2021
251416d
Add upgradeIntro modal for mobile
Rokt33r Jul 13, 2021
7b89493
Fix icon image of space selector in root page
Rokt33r Jul 13, 2021
f8829ee
Fix external link handling for native mobile app
Rokt33r Jul 13, 2021
c1e3475
Add android release bundle to gitignore
Rokt33r Jul 13, 2021
f39cb46
Configure android app
Rokt33r Jul 13, 2021
ddd3472
Fix mobile app open link event handling
Rokt33r Jul 13, 2021
ee43c7a
Disable revisions temporarily
Rokt33r Jul 13, 2021
5814523
Disable subscription updating temporarily
Rokt33r Jul 13, 2021
19b1943
Bump build version to 5
Rokt33r Jul 13, 2021
76c24ae
Always open new browser when clicking link in markdown view
Rokt33r Jul 14, 2021
0198af8
Fix doc share ui
Rokt33r Jul 14, 2021
1322822
Detect mobile os name
Rokt33r Jul 15, 2021
c475c65
Hide 3rd party login options for ios
Rokt33r Jul 15, 2021
7aba2a3
Implement webview error handling for android(inactive)
Rokt33r Jul 21, 2021
31c0095
Fix notch layout issue
Rokt33r Jul 21, 2021
3b17c4d
Fix keyboard popup issue
Rokt33r Jul 21, 2021
6573916
Fix copy button of open invite
Rokt33r Jul 21, 2021
84ddf7f
Fix content menu item overflow
Rokt33r Jul 21, 2021
285b2be
Don't focus back when focusing move to child components
Rokt33r Jul 21, 2021
ef60046
Set max-height to context menu
Rokt33r Jul 21, 2021
68eb9cb
Disble overscroll
Rokt33r Jul 21, 2021
105c119
Migrate doc info children to mobile
Rokt33r Jul 21, 2021
e989601
Clone doctags list for mobile
Rokt33r Jul 21, 2021
e71661d
Merge branch 'master' into mobile
Rokt33r Jul 21, 2021
a945038
Discard unused component
Rokt33r Jul 21, 2021
b8fccec
Fix compiler warnings
Rokt33r Jul 21, 2021
8d0b645
Mobile build version 5 -> 6
Rokt33r Jul 26, 2021
646e919
Merge branch 'master' into mobile
Rokt33r Jul 26, 2021
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
1 change: 0 additions & 1 deletion .env.default
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
BOOST_NOTE_BASE_URL=https://note.boostio.co
BOOST_HUB_BASE_URL=https://boosthub.io

AMPLIFY_AUTH_IDENTITY_POOL_ID=
Expand Down
16 changes: 16 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
/app/release
1 change: 1 addition & 0 deletions android/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
49 changes: 49 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
applicationId "com.boostio.boostnote2021"
minSdkVersion 19
targetSdkVersion 30
versionCode 2
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "androidx.browser:browser:1.3.0"
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

repositories {
}
21 changes: 21 additions & 0 deletions android/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
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.boostio.boostnote

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.boostio.boostnote", appContext.packageName)
}
}
40 changes: 40 additions & 0 deletions android/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"
package="com.boostio.boostnote2021">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApplication"
android:usesCleartextTraffic="true">
<activity
android:name=".MainActivity"
android:theme="@style/CustomTheme"
>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="boosthub"
android:scheme="boostnote" />

</intent-filter>

</activity>
</application>

</manifest>
163 changes: 163 additions & 0 deletions android/app/src/main/java/com/boostio/boostnote/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
//package com.boostio.boostnote
//
//import androidx.appcompat.app.AppCompatActivity
//import android.os.Bundle
//
//class MainActivity : AppCompatActivity() {
// override fun onCreate(savedInstanceState: Bundle?) {
// super.onCreate(savedInstanceState)
// setContentView(R.layout.activity_main)
// }
//}

package com.boostio.boostnote2021

import android.app.AlertDialog
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.util.Log
import android.webkit.*
import android.webkit.WebView
//import androidx.annotation.RequiresApi
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat.startActivity



class MainActivity : AppCompatActivity() {
val ctx: AppCompatActivity = this

val authStatePreferencesKey = "com.boostio.boostnote.authState"
// val mobileBaseUrl = "http://localhost:3005"
val mobileBaseUrl = "https://m.boostnote.io"
private var webviewReloadAlertDialog: AlertDialog? = null

class WebAppInterface(private val mContext: MainActivity) {

@JavascriptInterface
fun openUrl(url: String) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))
startActivity(mContext, intent, null);
}
@JavascriptInterface
fun openAuthUrl(url: String, state: String) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url))

val sharedPref = mContext.getPreferences(Context.MODE_PRIVATE)
with (sharedPref.edit()) {
putString(mContext.authStatePreferencesKey, state)
apply()
}
startActivity(mContext, intent, null);
}
}

fun showReloadDialog(description: String?) {
if (this.webviewReloadAlertDialog != null) {
return
}
val builder = AlertDialog.Builder(this)

builder.setMessage("Choose OK to reload the app")
.setTitle("""Error $description""")
.setPositiveButton("OK", DialogInterface.OnClickListener { _, _ ->
this.webviewReloadAlertDialog = null
val view = findViewById<WebView>(R.id.webview);
view?.reload()
})
.setCancelable(false)

this.webviewReloadAlertDialog = builder.create()
this.webviewReloadAlertDialog!!.show()
}


override fun onCreate(savedInstanceState: Bundle?) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main);

val view = findViewById<WebView>(R.id.webview);
val settings = view.settings;
settings.javaScriptEnabled = true;
settings.allowContentAccess = true;
settings.domStorageEnabled = true;
settings.userAgentString = settings.userAgentString + " BoostNote-Mobile-Android"

view.webViewClient = object: WebViewClient() {
// override fun onReceivedError(
// view: WebView?,
// errorCode: Int,
// description: String?,
// failingUrl: String?
// ) {
// super.onReceivedError(view, errorCode, description, failingUrl)
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){ return }
//
// this@MainActivity.showReloadDialog(description)
// }
//
// @RequiresApi(Build.VERSION_CODES.M)
// override fun onReceivedError(
// view: WebView?,
// request: WebResourceRequest?,
// error: WebResourceError?
// ) {
// super.onReceivedError(view, request, error)
//
// this@MainActivity.showReloadDialog(error?.description as String)
// }
}
view.webChromeClient = object : WebChromeClient() {
override fun onConsoleMessage(message: String, lineNumber: Int, sourceID: String) {
Log.d("WebView", "$message -- From line $lineNumber of $sourceID")
}
}
view.addJavascriptInterface(WebAppInterface(this), "Android")

this.handleIntent(intent)
}

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)

Log.d("Yolo","from new intent");
this.handleIntent(intent)
}

fun handleIntent(intent: Intent) {
if (
!this.resolveAuthIntent(intent)) {

val view = findViewById<WebView>(R.id.webview);
view.loadUrl(this.mobileBaseUrl);
}
}

fun resolveAuthIntent(intent: Intent):Boolean {
val sharedPref = this.getPreferences(Context.MODE_PRIVATE) ?: return false
val state = sharedPref.getString(authStatePreferencesKey, "")

val data: Uri? = intent.data

if (state === "") {return false }
if (data == null) {return false}
if (data.host != "boosthub") {return false}
if (data.path != "/login") {return false}

val code = data.getQueryParameter("code") ?: return false

val view = findViewById<WebView>(R.id.webview);
view.loadUrl(this.mobileBaseUrl + "?state=" + state + "&code="+code);
return true
}



}
24 changes: 24 additions & 0 deletions android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<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="M46.211,67.84C46.221,67.817 46.23,67.794 46.238,67.771C46.478,67.164 46.564,66.559 46.544,65.973C43.546,68.451 40.356,70.035 37.604,70.501C38.07,67.75 39.654,64.56 42.131,61.562C41.544,61.541 40.936,61.628 40.327,61.869C40.3,61.88 40.272,61.891 40.245,61.902C38.259,62.7 36.372,63.922 34.732,65.563C31.208,69.087 29.611,73.75 30.013,78.092C34.355,78.493 39.018,76.897 42.542,73.373C44.188,71.727 45.413,69.833 46.211,67.84Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M60.486,85.272L52.065,64.78L78.187,29.869L60.486,85.272Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M78.187,29.869L43.321,56.036L22.764,47.569L78.187,29.869Z"
android:fillColor="#ffffff"
android:fillAlpha="0.8"/>
<path
android:pathData="M78.186,29.869L51.808,56.247L43.321,56.036L78.186,29.869Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M52.065,64.78L51.808,56.247L78.186,29.869L52.065,64.78Z"
android:fillColor="#ffffff"
android:fillAlpha="0.8"/>
</vector>
23 changes: 23 additions & 0 deletions android/app/src/main/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<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="M0,0h108v108h-108z">
<aapt:attr name="android:fillColor">
<gradient
android:startY="108"
android:startX="54"
android:endY="1.21072E-7"
android:endX="54"
android:type="linear">
<item android:offset="0" android:color="#FF004654"/>
<item android:offset="1" android:color="#FF007C8D"/>
</gradient>
</aapt:attr>
</path>
</vector>
17 changes: 17 additions & 0 deletions android/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>

<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"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">


<WebView
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"

/>
</LinearLayout>
Loading