-
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 pull request #16918 from wordpress-mobile/Jetpack-Focus-Full-Sc…
…reen-Bottom-Sheet- Jetpack focus full screen bottom sheet
- Loading branch information
Showing
19 changed files
with
278 additions
and
25 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
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
33 changes: 33 additions & 0 deletions
33
WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListViewModel.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,33 @@ | ||
package org.wordpress.android.ui.notifications | ||
|
||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.MutableLiveData | ||
import dagger.hilt.android.lifecycle.HiltViewModel | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import org.wordpress.android.modules.UI_THREAD | ||
import org.wordpress.android.util.BuildConfigWrapper | ||
import org.wordpress.android.util.config.JetpackPoweredFeatureConfig | ||
import org.wordpress.android.viewmodel.Event | ||
import org.wordpress.android.viewmodel.ScopedViewModel | ||
import javax.inject.Inject | ||
import javax.inject.Named | ||
|
||
@HiltViewModel | ||
class NotificationsListViewModel@Inject constructor( | ||
@Named(UI_THREAD) mainDispatcher: CoroutineDispatcher, | ||
private val jetpackPoweredFeatureConfig: JetpackPoweredFeatureConfig, | ||
private val buildConfigWrapper: BuildConfigWrapper | ||
) : ScopedViewModel(mainDispatcher) { | ||
private val _showJetpackPoweredBottomSheet = MutableLiveData<Event<Boolean>>() | ||
val showJetpackPoweredBottomSheet: LiveData<Event<Boolean>> = _showJetpackPoweredBottomSheet | ||
|
||
init { | ||
showJetpackPoweredBottomSheet() | ||
} | ||
|
||
private fun showJetpackPoweredBottomSheet() { | ||
_showJetpackPoweredBottomSheet.value = Event( | ||
jetpackPoweredFeatureConfig.isEnabled() && !buildConfigWrapper.isJetpackApp | ||
) | ||
} | ||
} |
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
85 changes: 85 additions & 0 deletions
85
WordPress/src/main/res/layout-land/jetpack_powered_bottom_sheet.xml
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,85 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:animateLayoutChanges="true" | ||
android:background="@color/jetpack_powered_bottom_sheet_background" | ||
android:orientation="vertical"> | ||
|
||
<androidx.constraintlayout.widget.Guideline | ||
android:id="@+id/guideline3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
app:layout_constraintGuide_end="130dp" /> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:id="@+id/content_recycler_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginEnd="@dimen/margin_extra_extra_medium_large" | ||
android:layout_marginStart="@dimen/margin_extra_extra_medium_large" | ||
android:layout_marginTop="@dimen/margin_medium" | ||
android:clipToPadding="false" | ||
android:descendantFocusability="beforeDescendants" | ||
android:scrollbars="vertical" | ||
app:layout_constrainedHeight="true" | ||
app:layout_constraintBottom_toTopOf="@+id/primary_button" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/handle" | ||
app:layout_constraintVertical_bias="0.0" /> | ||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/primary_button" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_marginEnd="@dimen/margin_extra_extra_medium_large" | ||
android:layout_marginStart="@dimen/margin_extra_extra_medium_large" | ||
android:backgroundTint="@color/jetpack_green_40" | ||
android:gravity="center" | ||
android:minHeight="@dimen/margin_extra_extra_large" | ||
android:text="@string/wp_jetpack_get_new_jetpack_app" | ||
android:textAppearance="?attr/textAppearanceSubtitle2" | ||
android:textColor="?attr/colorOnSecondary" | ||
app:layout_constraintTop_toBottomOf="@id/content_recycler_view" | ||
app:layout_constraintBottom_toTopOf="@id/secondary_button" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_goneMarginBottom="@dimen/margin_extra_large" /> | ||
|
||
<com.google.android.material.button.MaterialButton | ||
android:id="@+id/secondary_button" | ||
android:visibility="gone" | ||
style="@style/Widget.MaterialComponents.Button.TextButton" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="center" | ||
android:layout_marginBottom="@dimen/margin_extra_extra_medium_large" | ||
android:layout_marginEnd="@dimen/margin_extra_extra_medium_large" | ||
android:layout_marginStart="@dimen/margin_extra_extra_medium_large" | ||
android:gravity="center" | ||
android:minHeight="@dimen/margin_extra_extra_large" | ||
android:textAppearance="?attr/textAppearanceSubtitle2" | ||
android:textAllCaps="false" | ||
android:textColor="@color/jetpack_green" | ||
app:layout_constraintTop_toBottomOf="@id/primary_button" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
tools:text="Continue to Reader" | ||
tools:visibility="visible"/> | ||
|
||
<include | ||
android:id="@+id/handle" | ||
layout="@layout/bottom_sheet_handle_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginBottom="@dimen/margin_small" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
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.