Skip to content

Commit

Permalink
prepare for v0.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
saulhdev committed Jun 9, 2021
1 parent 1715e3a commit ed960d7
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ class OpenWidgetsGestureHandler(context: Context, config: JSONObject?) :
}
}

@Keep
class OpenDashGestureHandler(context: Context, config: JSONObject?) :
GestureHandler(context, config) {

override val displayName = context.getString(R.string.action_open_dash)

override val requiresForeground = true

override fun onGestureTrigger(controller: GestureController, view: View?) {
DashBottomSheet.show(controller.launcher, false)
}
}

@Keep
class StartGlobalSearchGestureHandler(context: Context, config: JSONObject?) :
GestureHandler(context, config) {
Expand Down Expand Up @@ -315,16 +328,6 @@ class OpenSettingsGestureHandler(context: Context, config: JSONObject?) :
}
}

@Keep
class OpenDashGestureHandler(context: Context, config: JSONObject?) :
GestureHandler(context, config) {

override val displayName = context.getString(R.string.action_open_dash)
override fun onGestureTrigger(controller: GestureController, view: View?) {
DashBottomSheet.show(controller.launcher, true)
}
}

@Keep
class OpenOverviewGestureHandler(context: Context, config: JSONObject?) :
GestureHandler(context, config) {
Expand Down
37 changes: 26 additions & 11 deletions Omega/src/com/saggitt/omega/views/CenterFloatingView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,30 @@ import android.view.View
import android.view.ViewGroup
import com.android.launcher3.Insettable
import com.android.launcher3.Launcher
import com.android.launcher3.R
import com.android.launcher3.R.layout
import com.android.launcher3.anim.Interpolators
import com.android.launcher3.util.SystemUiController
import com.android.launcher3.util.Themes
import com.android.launcher3.views.AbstractSlideInView

class CenterFloatingView @JvmOverloads constructor(
context: Context?,
attrs: AttributeSet?,
defStyleAttr: Int = 0
) :
AbstractSlideInView(context, attrs, defStyleAttr), Insettable {
) : AbstractSlideInView(context, attrs, defStyleAttr), Insettable {
private val mInsets: Rect
private val mColorScrim: ColorScrim

init {
setWillNotDraw(false)
mColorScrim = ColorScrim.createExtractedColorScrim(this)
mInsets = Rect()
mContent = this
}

fun show(view: View?, animate: Boolean) {
(findViewById<View>(com.android.launcher3.R.id.sheet_contents) as ViewGroup).addView(view)
(findViewById<View>(R.id.sheet_contents) as ViewGroup).addView(view)
mLauncher.dragLayer.addView(this)
mIsOpen = false
animateOpen(animate)
Expand All @@ -60,19 +70,31 @@ class CenterFloatingView @JvmOverloads constructor(
return type and TYPE_SETTINGS_SHEET != 0
}

private fun setupNavBarColor() {
val isSheetDark = Themes.getAttrBoolean(mLauncher, R.attr.isMainColorDark)
mLauncher.systemUiController.updateUiState(
SystemUiController.UI_STATE_WIDGET_BOTTOM_SHEET,
if (isSheetDark) SystemUiController.FLAG_DARK_NAV else SystemUiController.FLAG_LIGHT_NAV
)
}

private fun animateOpen(animate: Boolean) {
if (mIsOpen || mOpenCloseAnimator.isRunning) {
return
}
mIsOpen = true
setupNavBarColor()
mOpenCloseAnimator.setValues(
PropertyValuesHolder.ofFloat(TRANSLATION_SHIFT, TRANSLATION_SHIFT_OPENED)
)
mOpenCloseAnimator.interpolator = Interpolators.FAST_OUT_SLOW_IN
if (!animate) {
mOpenCloseAnimator.duration = 0
}
mOpenCloseAnimator.start()
post {
mOpenCloseAnimator.start()
mContent.animate().alpha(1f).duration = 150
}
}

override fun handleClose(animate: Boolean) {
Expand All @@ -92,11 +114,4 @@ class CenterFloatingView @JvmOverloads constructor(
) as CenterFloatingView
}
}

init {
setWillNotDraw(false)
mColorScrim = ColorScrim.createExtractedColorScrim(this)
mInsets = Rect()
mContent = this
}
}
14 changes: 10 additions & 4 deletions assets/changelog.htm
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@

<body id="top">
<div>
<h2>v0.8.0 (Build 160)</h2>
<h4>Release date: 05-15-2021</h4>
<h2>v0.8.0 (Build 168)</h2>
<h4>Release date: 06-08-2021</h4>
<ul class="changelog">
<li>Add: Keep Empty screen preference</li>
<li>Merge android-11.0.0_r31</li>
<li>Add: Color selector for tabs</li>
<li>Add: additional dash controls</li>
<li>Add: Dash Customization</li>
<li>Add: Support quickswitch</li>
<li>Add: Support QuickSwitch</li>
<li>Add: FiveSecs KLWP</li>
<li>Add: Searx provider</li>
<li>Add: Sleep assistant</li>
<li>Add: Vertical List Apps (Experimental)</li>
<li>Fix: Dock size on long screens</li>
<li>Fix: Crash when opening Google Assistant</li>
</ul>
<p><a href="#top">Back to the top</a></p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
compileSdkVersion 30

def name = "0.8.0"
def code = 167
def code = 168

defaultConfig {
minSdkVersion 26
Expand Down

0 comments on commit ed960d7

Please sign in to comment.