Skip to content

Commit 9c21690

Browse files
author
Mohammed Boukadir
committed
WIP Basic toot creation screen ui layer
1 parent 0bf705a commit 9c21690

19 files changed

Lines changed: 741 additions & 10 deletions

File tree

app-android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<activity
1313
android:name="social.androiddev.dodo.MainActivity"
1414
android:exported="true"
15+
android:windowSoftInputMode="adjustResize"
1516
android:launchMode="singleInstance">
1617
<intent-filter>
1718
<action android:name="android.intent.action.MAIN" />

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ include(":ui:signed-in")
3333
include(":ui:signed-out")
3434
include(":ui:desktop-webview")
3535

36+
include(":ui:compose-toot")
3637
include(":domain:timeline")
3738
include(":domain:authentication")
3839

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* This file is part of Dodo.
3+
*
4+
* Dodo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
5+
* published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6+
*
7+
* Dodo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
8+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9+
*
10+
* You should have received a copy of the GNU General Public License along with Dodo.
11+
* If not, see <https://www.gnu.org/licenses/>.
12+
*/
13+
package social.androiddev.common.modifiers
14+
15+
import androidx.compose.foundation.layout.imePadding
16+
import androidx.compose.foundation.layout.navigationBarsPadding
17+
import androidx.compose.ui.Modifier
18+
19+
actual fun Modifier.moveWithKeyboard(): Modifier {
20+
return this.navigationBarsPadding().imePadding()
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* This file is part of Dodo.
3+
*
4+
* Dodo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
5+
* published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6+
*
7+
* Dodo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
8+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9+
*
10+
* You should have received a copy of the GNU General Public License along with Dodo.
11+
* If not, see <https://www.gnu.org/licenses/>.
12+
*/
13+
package social.androiddev.common.modifiers
14+
15+
import androidx.compose.ui.Modifier
16+
17+
/**
18+
*
19+
* Use navigationBarsPadding() and imePadding() to move the composable above both the
20+
* navigation bar, and on-screen keyboard (IME)
21+
*/
22+
expect fun Modifier.moveWithKeyboard(): Modifier
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* This file is part of Dodo.
3+
*
4+
* Dodo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
5+
* published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6+
*
7+
* Dodo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
8+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9+
*
10+
* You should have received a copy of the GNU General Public License along with Dodo.
11+
* If not, see <https://www.gnu.org/licenses/>.
12+
*/
13+
package social.androiddev.common.modifiers
14+
15+
import androidx.compose.ui.Modifier
16+
17+
/**
18+
*
19+
* Use navigationBarsPadding() and imePadding() to move the composable above both the
20+
* navigation bar, and on-screen keyboard (IME)
21+
*/
22+
actual fun Modifier.moveWithKeyboard(): Modifier {
23+
// no-op in desktop
24+
return this
25+
}

ui/compose-toot/build.gradle.kts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
id("social.androiddev.library.ui")
3+
id("social.androiddev.codequality")
4+
}
5+
6+
android {
7+
namespace = "social.androiddev.ui.composetoot"
8+
}
9+
10+
kotlin {
11+
12+
sourceSets {
13+
val commonMain by getting {
14+
dependencies {
15+
implementation(projects.domain.timeline)
16+
implementation(projects.ui.common)
17+
implementation(compose.runtime)
18+
implementation(compose.foundation)
19+
implementation(compose.material)
20+
implementation(compose.materialIconsExtended)
21+
implementation(libs.io.insert.koin.core)
22+
23+
}
24+
}
25+
26+
}
27+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"/>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* This file is part of Dodo.
3+
*
4+
* Dodo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as
5+
* published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
6+
*
7+
* Dodo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
8+
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
9+
*
10+
* You should have received a copy of the GNU General Public License along with Dodo.
11+
* If not, see <https://www.gnu.org/licenses/>.
12+
*/
13+
package social.androidev.composetoot
14+
15+
import kotlinx.coroutines.flow.StateFlow
16+
17+
/**
18+
* The base component describing all business logic needed for the toot screen
19+
*/
20+
interface ComposeTootComponent {
21+
22+
val state: StateFlow<ComposeTootState>
23+
fun onCloseClicked()
24+
25+
fun onTootContentChange(text: String)
26+
fun onPostClicked()
27+
fun onActionClicked(action: Action)
28+
}

0 commit comments

Comments
 (0)