Skip to content

Convert ReaderPostPagerActivity to Kotlin #21822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6d429ca
Make ReaderPostPagerActivity fullscreen
nbradbury Apr 18, 2025
bc635fb
Reverted custom theme
nbradbury Apr 18, 2025
7619d7d
Use EdgeToEdge.enable
nbradbury Apr 18, 2025
9c0c027
Converted pager activity to ConstraintLayout
nbradbury Apr 18, 2025
486b4f1
Don't overlay navigation bar
nbradbury Apr 18, 2025
8e89c95
Hide navigation bar
nbradbury Apr 18, 2025
d8164fd
Only enable fullscreen for Android 33+
nbradbury Apr 18, 2025
945e219
Use non-deprecated fullscreen
nbradbury Apr 19, 2025
b91225a
Rename .java to .kt
nbradbury Apr 19, 2025
702f0af
First pass at converting ReaderPostPagerActivity to Kotlin
nbradbury Apr 19, 2025
704dcb9
Second pass at converting ReaderPostPagerActivity to Kotlin
nbradbury Apr 19, 2025
7569197
Use lateinit var
nbradbury Apr 21, 2025
ff95fed
Fixed unnecessary nonnull assertions
nbradbury Apr 21, 2025
5ee2306
Suppress deprecation warnings
nbradbury Apr 21, 2025
d43abd9
First pass at renaming variables
nbradbury Apr 21, 2025
137373c
Second pass at renaming variables
nbradbury Apr 21, 2025
4e84109
Use BundleCompat for serializable extras
nbradbury Apr 21, 2025
ab9df83
Suppress unchecked cast
nbradbury Apr 21, 2025
57262de
Renamed adapter variables
nbradbury Apr 21, 2025
f0360f3
Moved adapter
nbradbury Apr 21, 2025
beb2287
Mark class deprecated
nbradbury Apr 21, 2025
78cbb9f
Merge branch 'trunk' of https://github.com/wordpress-mobile/WordPress…
nbradbury Apr 21, 2025
8e922b2
Removed Java activity
nbradbury Apr 21, 2025
2d42224
Fixed Detekt warnings
nbradbury Apr 21, 2025
06cb147
Merge branch 'trunk' into issue/CMM-288-kotlin-reader-post-pager-acti…
nbradbury Apr 22, 2025
dee7d20
Merge branch 'trunk' into issue/CMM-288-kotlin-reader-post-pager-acti…
nbradbury Apr 22, 2025
1f0f899
Use Kotlin isNullOrEmpty instead of TextUtils.isEmpty
nbradbury Apr 22, 2025
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
Next Next commit
Make ReaderPostPagerActivity fullscreen
  • Loading branch information
nbradbury committed Apr 18, 2025
commit 6d429cab5c137a6263cec9ab8c99b6d74ea82aa9
2 changes: 1 addition & 1 deletion WordPress/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
<activity
android:name=".ui.reader.ReaderPostPagerActivity"
android:excludeFromRecents="true"
android:theme="@style/WordPress.NoActionBar.NoEdgeToEdge"
android:theme="@style/ReaderPostPagerTheme"
android:windowSoftInputMode="adjustResize" >
</activity>
<activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import org.wordpress.android.ui.posts.EditPostActivity
import org.wordpress.android.ui.posts.sharemessage.EditJetpackSocialShareMessageActivity
import org.wordpress.android.ui.prefs.ExperimentalFeaturesActivity
import org.wordpress.android.ui.reader.ReaderCommentListActivity
import org.wordpress.android.ui.reader.ReaderPostPagerActivity
import org.wordpress.android.ui.selfhostedusers.SelfHostedUsersActivity
import org.wordpress.android.ui.sitemonitor.SiteMonitorParentActivity

Expand Down Expand Up @@ -91,6 +92,8 @@ private val excludedActivities = listOf(
SiteMonitorParentActivity::class.java.name,
SupportWebViewActivity::class.java.name,

ReaderPostPagerActivity::class.java.name,

// these are excluded and use the NoEdgeToEdge style to avoid the keyboard overlapping
// their editors
EditPostActivity::class.java.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import androidx.activity.OnBackPressedCallback;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.WindowCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
Expand Down Expand Up @@ -185,6 +186,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
((WordPress) getApplication()).component().inject(this);
mJetpackFullScreenViewModel = new ViewModelProvider(this).get(JetpackFeatureFullScreenOverlayViewModel.class);

WindowCompat.setDecorFitsSystemWindows(getWindow(), false);
setContentView(R.layout.reader_activity_post_pager);

OnBackPressedCallback callback = new OnBackPressedCallback(true) {
Expand Down
6 changes: 5 additions & 1 deletion WordPress/src/main/res/values/reader_styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<item name="android:windowFullscreen">true</item>
</style>

<style name="ReaderPostPagerTheme" parent="WordPress.NoActionBar">
<item name="android:windowFullscreen">true</item>
</style>

<style name="ReaderRecyclerView">
<item name="android:background">@color/reader_post_list_background</item>
</style>
Expand Down Expand Up @@ -47,7 +51,7 @@
<item name="android:maxLines">1</item>
<item name="android:alpha">@dimen/material_emphasis_high_type</item>
</style>

<style name="ReaderTextView.Post.Title" parent="ReaderTextView">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
Expand Down