-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into feat/update-image-block-upload-visuals
- Loading branch information
Showing
131 changed files
with
881 additions
and
383 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
No updates this week! Enjoy these reindeer facts: | ||
- Male reindeer shed their antlers in fall and females in spring, so Santa’s reindeer are female. | ||
- Reindeer don’t actually have red noses. | ||
- Santa hasn’t eaten milk and cookies since 2003 because Blitzen always gets there first. | ||
* [*] Filter media types when sharing files to the editor [https://github.com/wordpress-mobile/WordPress-Android/pull/19754] | ||
* [***] [Jetpack-only] Plans: Upgrade to a Plan from domains dashboard in Jetpack app [https://github.com/wordpress-mobile/WordPress-Android/pull/19818] | ||
* [**] [internal] Removes unused resources and code [https://github.com/wordpress-mobile/WordPress-Android/pull/19788] | ||
* [*] Block Editor: Add support for unselecting blocks with the hardware back button [https://github.com/wordpress-mobile/WordPress-Android/pull/19828] | ||
* [**] [internal] Removes unused code using android tool [https://github.com/wordpress-mobile/WordPress-Android/pull/19850] | ||
* [**] [internal] [Jetpack-only] Adds support for dynamic dashboard cards driven by the backend [https://github.com/wordpress-mobile/WordPress-Android/pull/19801] | ||
* [***] Block Editor: Avoid keyboard dismiss when interacting with text blocks [https://github.com/WordPress/gutenberg/pull/57070] | ||
* [**] Block Editor: Auto-scroll upon block insertion [https://github.com/WordPress/gutenberg/pull/57273] | ||
|
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
No updates this week! Enjoy these reindeer facts: | ||
- Male reindeer shed their antlers in fall and females in spring, so Santa’s reindeer are female. | ||
- Reindeer don’t actually have red noses. | ||
- Santa hasn’t eaten milk and cookies since 2003 because Blitzen always gets there first. | ||
* [*] Filter media types when sharing files to the editor [https://github.com/wordpress-mobile/WordPress-Android/pull/19754] | ||
* [**] [internal] Removes unused resources and code [https://github.com/wordpress-mobile/WordPress-Android/pull/19788] | ||
* [*] Block Editor: Add support for unselecting blocks with the hardware back button [https://github.com/wordpress-mobile/WordPress-Android/pull/19828] | ||
* [**] [internal] Removes unused code using android tool [https://github.com/wordpress-mobile/WordPress-Android/pull/19850] | ||
* [**] [internal] [Jetpack-only] Adds support for dynamic dashboard cards driven by the backend [https://github.com/wordpress-mobile/WordPress-Android/pull/19801] | ||
* [***] Block Editor: Avoid keyboard dismiss when interacting with text blocks [https://github.com/WordPress/gutenberg/pull/57070] | ||
* [**] Block Editor: Auto-scroll upon block insertion [https://github.com/WordPress/gutenberg/pull/57273] | ||
|
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
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
29 changes: 29 additions & 0 deletions
29
...ain/java/org/wordpress/android/ui/debug/preferences/DebugSharedPreferenceFlagsActivity.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,29 @@ | ||
package org.wordpress.android.ui.debug.preferences | ||
|
||
import android.os.Bundle | ||
import androidx.activity.viewModels | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.compose.runtime.collectAsState | ||
import androidx.compose.runtime.getValue | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import org.wordpress.android.ui.domains.management.M3Theme | ||
import org.wordpress.android.util.extensions.setContent | ||
|
||
@AndroidEntryPoint | ||
class DebugSharedPreferenceFlagsActivity : AppCompatActivity() { | ||
private val viewModel: DebugSharedPreferenceFlagsViewModel by viewModels() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContent { | ||
M3Theme { | ||
val uiState by viewModel.uiStateFlow.collectAsState() | ||
DebugSharedPreferenceFlagsScreen( | ||
flags = uiState, | ||
onFlagChanged = viewModel::setFlag, | ||
onBackTapped = { onBackPressedDispatcher.onBackPressed() }, | ||
) | ||
} | ||
} | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
.../main/java/org/wordpress/android/ui/debug/preferences/DebugSharedPreferenceFlagsScreen.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,95 @@ | ||
package org.wordpress.android.ui.debug.preferences | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.foundation.lazy.LazyColumn | ||
import androidx.compose.foundation.lazy.items | ||
import androidx.compose.material3.Checkbox | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Scaffold | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment.Companion.CenterVertically | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import androidx.compose.ui.unit.dp | ||
import org.wordpress.android.R | ||
import org.wordpress.android.ui.compose.components.MainTopAppBar | ||
import org.wordpress.android.ui.compose.components.NavigationIcons | ||
import org.wordpress.android.ui.domains.management.M3Theme | ||
|
||
@Composable | ||
fun DebugSharedPreferenceFlagsScreen( | ||
flags: Map<String, Boolean>, | ||
onBackTapped: () -> Unit, | ||
onFlagChanged: (String, Boolean) -> Unit, | ||
) { | ||
Scaffold( | ||
topBar = { | ||
MainTopAppBar( | ||
title = stringResource(R.string.debug_settings_debug_flags_screen), | ||
navigationIcon = NavigationIcons.BackIcon, | ||
onNavigationIconClick = onBackTapped, | ||
backgroundColor = MaterialTheme.colorScheme.surface, | ||
contentColor = MaterialTheme.colorScheme.onSurface, | ||
) | ||
}, | ||
) { paddingValues -> | ||
LazyColumn(modifier = Modifier.padding(paddingValues)) { | ||
items(flags.toList()) { (key, value) -> | ||
DebugFlagRow( | ||
key = key, | ||
value = value, | ||
onFlagChanged = onFlagChanged, | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun DebugFlagRow( | ||
key: String, | ||
value: Boolean, | ||
onFlagChanged: (String, Boolean) -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Row( | ||
modifier = modifier | ||
.padding(vertical = 4.dp) | ||
.clickable { onFlagChanged(key, !value) } | ||
) { | ||
Text( | ||
text = key, | ||
modifier = Modifier | ||
.weight(1f) | ||
.align(CenterVertically) | ||
.padding(start = 16.dp) | ||
) | ||
Checkbox( | ||
checked = value, | ||
modifier = Modifier.align(CenterVertically).padding(end = 8.dp), | ||
onCheckedChange = { onFlagChanged(key, it) } | ||
) | ||
} | ||
} | ||
|
||
@Preview | ||
@Composable | ||
fun DebugFlagsScreenPreview() { | ||
M3Theme { | ||
DebugSharedPreferenceFlagsScreen( | ||
flags = mapOf( | ||
"EXAMPLE_FEATURE_FLAG" to true, | ||
"RANDOM_FLAG" to false, | ||
"ANOTHER_FLAG" to true, | ||
"YET_ANOTHER_FLAG" to false, | ||
|
||
), | ||
onBackTapped = {}, | ||
onFlagChanged = { _, _ -> }, | ||
) | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...in/java/org/wordpress/android/ui/debug/preferences/DebugSharedPreferenceFlagsViewModel.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 @@ | ||
package org.wordpress.android.ui.debug.preferences | ||
|
||
import androidx.lifecycle.ViewModel | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.asStateFlow | ||
import org.wordpress.android.ui.prefs.AppPrefsWrapper | ||
import javax.inject.Inject | ||
|
||
@HiltViewModel | ||
class DebugSharedPreferenceFlagsViewModel @Inject constructor( | ||
private val prefsWrapper: AppPrefsWrapper | ||
) : ViewModel() { | ||
private val _uiStateFlow = MutableStateFlow<Map<String, Boolean>>(emptyMap()) | ||
val uiStateFlow = _uiStateFlow.asStateFlow() | ||
|
||
init { | ||
val flags = prefsWrapper.getAllPrefs().mapNotNull { (key, value) -> | ||
if (value is Boolean) key to value else null | ||
}.toMap() | ||
_uiStateFlow.value = flags | ||
} | ||
|
||
fun setFlag(key: String, value: Boolean) { | ||
prefsWrapper.putBoolean({ key }, value) | ||
_uiStateFlow.value = _uiStateFlow.value.toMutableMap().apply { this[key] = value } | ||
} | ||
} |
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
Oops, something went wrong.