-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP Basic toot creation screen ui layer
- Loading branch information
Mohammed Boukadir
committed
Dec 25, 2022
1 parent
0bf705a
commit 1164b6f
Showing
19 changed files
with
752 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
ui/common/src/androidMain/kotlin/social/androiddev/common/modifiers/WindowInsets.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* 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() | ||
} |
22 changes: 22 additions & 0 deletions
22
ui/common/src/commonMain/kotlin/social/androiddev/common/modifiers/WindowInsets.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
*/ | ||
expect fun Modifier.moveWithKeyboard(): Modifier |
25 changes: 25 additions & 0 deletions
25
ui/common/src/desktopMain/kotlin/social/androiddev/common/modifiers/WindowInsets.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
} | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"/> |
28 changes: 28 additions & 0 deletions
28
ui/compose-toot/src/commonMain/kotlin/social/androidev/composetoot/ComposeTootComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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) | ||
} |
Oops, something went wrong.