Skip to content

Commit

Permalink
WIP Basic toot creation screen ui layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed Boukadir committed Dec 21, 2022
1 parent cb80c6c commit c62c180
Show file tree
Hide file tree
Showing 20 changed files with 717 additions and 13 deletions.
1 change: 1 addition & 0 deletions app-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<activity
android:name="social.androiddev.dodo.MainActivity"
android:exported="true"
android:windowSoftInputMode="adjustResize"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ include(":ui:common")
include(":ui:root")
include(":ui:signed-in")
include(":ui:signed-out")

include(":ui:compose-toot")
include(":domain:timeline")
include(":domain:authentication")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* This file is part of Dodo.
*
* Dodo 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.
*
* Dodo 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 Dodo. If not, see <https://www.gnu.org/licenses/>.
*/
package social.androiddev.common.modifiers

import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.navigationBarsPadding
import androidx.compose.ui.Modifier

actual fun Modifier.moveWithKeyboard(): Modifier {
return this.navigationBarsPadding().imePadding()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* This file is part of Dodo.
*
* Dodo 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.
*
* Dodo 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 Dodo. If not, see <https://www.gnu.org/licenses/>.
*/
package social.androiddev.common.modifiers

import androidx.compose.ui.Modifier

/**
*
* Use navigationBarsPadding() and imePadding() to move the composable above both the
* navigation bar, and on-screen keyboard (IME)
*/
expect fun Modifier.moveWithKeyboard(): Modifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* This file is part of Dodo.
*
* Dodo 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.
*
* Dodo 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 Dodo. If not, see <https://www.gnu.org/licenses/>.
*/
package social.androiddev.common.modifiers

import androidx.compose.ui.Modifier

/**
*
* Use navigationBarsPadding() and imePadding() to move the composable above both the
* navigation bar, and on-screen keyboard (IME)
*/
actual fun Modifier.moveWithKeyboard(): Modifier {
// no-op in desktop
return this
}
27 changes: 27 additions & 0 deletions ui/compose-toot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
plugins {
id("social.androiddev.library.ui")
id("social.androiddev.codequality")
}

android {
namespace = "social.androiddev.ui.composetoot"
}

kotlin {

sourceSets {
val commonMain by getting {
dependencies {
implementation(projects.domain.timeline)
implementation(projects.ui.common)
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material)
implementation(compose.materialIconsExtended)
implementation(libs.io.insert.koin.core)

}
}

}
}
2 changes: 2 additions & 0 deletions ui/compose-toot/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* This file is part of Dodo.
*
* Dodo 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.
*
* Dodo 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 Dodo. If not, see <https://www.gnu.org/licenses/>.
*/
package social.androidev.composetoot

import kotlinx.coroutines.flow.StateFlow

/**
* The base component describing all business logic needed for the toot screen
*/
interface ComposeTootComponent {

val state: StateFlow<ComposeTootState>
fun onCloseClicked()

fun onTootContentChange(text: String)
fun onPostClicked()
fun onActionClicked(action: Action)
}
Loading

0 comments on commit c62c180

Please sign in to comment.