Merge pull request #313 from metaphore/light-theme

Light Theme Tweaks
This commit is contained in:
Niels Andriesse 2020-09-03 11:42:33 +10:00 committed by GitHub
commit 0da8613075
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 4 deletions

View File

@ -136,7 +136,8 @@
android:theme="@style/Theme.Session.DayNight.FlatActionBar"/> android:theme="@style/Theme.Session.DayNight.FlatActionBar"/>
<activity <activity
android:name="org.thoughtcrime.securesms.loki.activities.CreatePrivateChatActivity" android:name="org.thoughtcrime.securesms.loki.activities.CreatePrivateChatActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait"
android:theme="@style/Theme.Session.DayNight.FlatActionBar"/>
<activity <activity
android:name="org.thoughtcrime.securesms.loki.activities.CreateClosedGroupActivity" android:name="org.thoughtcrime.securesms.loki.activities.CreateClosedGroupActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
@ -146,7 +147,8 @@
<activity <activity
android:name="org.thoughtcrime.securesms.loki.activities.JoinPublicChatActivity" android:name="org.thoughtcrime.securesms.loki.activities.JoinPublicChatActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" /> android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.Session.DayNight.FlatActionBar" />
<activity <activity
android:name="org.thoughtcrime.securesms.loki.activities.SeedActivity" android:name="org.thoughtcrime.securesms.loki.activities.SeedActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />

View File

@ -1,14 +1,18 @@
package org.thoughtcrime.securesms.loki.dialogs package org.thoughtcrime.securesms.loki.dialogs
import android.app.Dialog
import android.os.Bundle import android.os.Bundle
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.android.synthetic.main.fragment_light_theme_feature_intro_bottom_sheet.* import kotlinx.android.synthetic.main.fragment_light_theme_feature_intro_bottom_sheet.*
import kotlinx.android.synthetic.main.fragment_open_group_suggestion_bottom_sheet.*
import network.loki.messenger.R import network.loki.messenger.R
class LightThemeFeatureIntroBottomSheet : BottomSheetDialogFragment() { class LightThemeFeatureIntroBottomSheet : BottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
@ -23,4 +27,15 @@ class LightThemeFeatureIntroBottomSheet : BottomSheetDialogFragment() {
okButton.setOnClickListener { dismiss() } okButton.setOnClickListener { dismiss() }
} }
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState)
// Make the bottom sheet be expanded by default.
dialog.setOnShowListener {
val d = dialog as BottomSheetDialog
val bottomSheet = d.findViewById<FrameLayout>(com.google.android.material.R.id.design_bottom_sheet)
BottomSheetBehavior.from(bottomSheet!!).setState(BottomSheetBehavior.STATE_EXPANDED);
}
return dialog
}
} }