Skip to content
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

Release/v0.5.6 #38

Merged
merged 4 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
97 changes: 97 additions & 0 deletions .github/ISSUE_TEMPLATE/n1_report_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: 🐞 Issue report
description: Report an issue in Floating-Bubble-View
labels: [Bug]
body:

- type: textarea
id: reproduce-steps
attributes:
label: Steps to reproduce
description: Provide an example of the issue.
placeholder: |
Example:
1. First step
2. Second step
3. Issue here
validations:
required: true

- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: Explain what you should expect to happen.
placeholder: |
Example:
"This should happen..."
validations:
required: true

- type: textarea
id: actual-behavior
attributes:
label: Actual behavior
description: Explain what actually happens.
placeholder: |
Example:
"This happened instead..."
validations:
required: true

- type: textarea
id: crash-logs
attributes:
label: Crash logs
placeholder: |
You can paste the crash logs in plain text or upload it as an attachment.

- type: input
id: floating-bubble-view-version
attributes:
label: Floating-Bubble-View version
placeholder: |
Example: "0.0.3"
validations:
required: true

- type: input
id: android-version
attributes:
label: Android version
description: You can find this somewhere in your Android settings.
placeholder: |
Example: "Android 13"
validations:
required: true

- type: input
id: device
attributes:
label: Device
description: List your device and model.
placeholder: |
Example: "Google Pixel 6 pro"
validations:
required: true

- type: textarea
id: other-details
attributes:
label: Other details
placeholder: |
Additional details and attachments.

- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open or closed issue.
required: true
- label: I have written a short but informative title.
required: true
- label: I have updated the library to the latest **[Version](https://github.com/torrydo/Floating-Bubble-View/releases/latest)**.
required: true
- label: I will fill out all of the requested information in this form.
required: true
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/n2_request_feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ⭐ Feature request
description: Suggest a feature to improve Floating-Bubble-View
labels: [Feature request]
body:

- type: textarea
id: feature-description
attributes:
label: Describe your suggested feature
description: How can Floating-Bubble-View be improved?
placeholder: |
Example:
"It should work like this..."
validations:
required: true

- type: textarea
id: other-details
attributes:
label: Other details
placeholder: |
Additional details and attachments.

- type: checkboxes
id: acknowledgements
attributes:
label: Acknowledgements
description: Read this carefully, we will close and ignore your issue if you skimmed through this.
options:
- label: I have searched the existing issues and this is a new ticket, **NOT** a duplicate or related to another open or closed issue.
required: true
- label: I have written a short but informative title.
required: true
- label: I have updated the library to the latest **[Version](https://github.com/torrydo/Floating-Bubble-View/releases/latest)**.
required: true
- label: I will fill out all of the requested information in this form.
required: true
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions FloatingBubbleView/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,21 @@ android {
compose true
}

composeOptions{
composeOptions {
kotlinCompilerExtensionVersion "1.3.2"
}

}

dependencies {


implementation("androidx.core:core-ktx:1.6.0")
implementation("androidx.appcompat:appcompat:1.4.0")

implementation("androidx.dynamicanimation:dynamicanimation:1.0.0")

def compose_version = "1.3.1"
implementation "androidx.compose.foundation:foundation:${compose_version}"
implementation "androidx.compose.foundation:foundation:1.3.1"

implementation "io.github.torrydo:screen-easy:0.0.2"
implementation "io.github.torrydo:screen-easy:0.1.0"

}
1 change: 1 addition & 0 deletions FloatingBubbleView/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.torrydo.floatingbubbleview">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.os.Build

internal object AndroidVersions {

// const val `13` = Build.VERSION_CODES.TIRAMISU // 33
const val `13` = Build.VERSION_CODES.TIRAMISU // 33
const val `12` = Build.VERSION_CODES.S // 31
const val `11` = Build.VERSION_CODES.R // 30
const val `10` = Build.VERSION_CODES.Q // 29
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ internal open class BaseFloatingViewBinding<T : ViewBinding>(
* */
open fun show() {
try {
if(binding.root.windowToken != null) return
// if(binding.root.windowToken != null) return
super.show(binding.root)
}catch (e: Exception){
// Log.d("<>", "show: ${e.stackTraceToString()}"); this line show error in some cases
// Log.e("<>FBV", "show: ${e.stackTraceToString()}"); //this line show error in some cases
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,10 @@ internal class ComposeLifecycleOwner : LifecycleOwner, SavedStateRegistryOwner {

}

// LifecycleOwner methods
private val lifecycleRegistry: LifecycleRegistry = LifecycleRegistry(this)

override fun getLifecycle(): Lifecycle = lifecycleRegistry


// SavedStateRegistry methods
private val savedStateRegistryController = SavedStateRegistryController.create(this)
override val savedStateRegistry: SavedStateRegistry
get() = savedStateRegistryController.savedStateRegistry
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.torrydo.floatingbubbleview

import android.content.Context
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import androidx.annotation.StyleRes
import androidx.compose.runtime.Composable
import com.torrydo.screenez.ScreenRotation

class ExpandableView(
private val builder: Builder,
Expand Down Expand Up @@ -58,7 +58,7 @@ class ExpandableView(


fun remove() {
if(builder.view != null){
if (builder.view != null) {
super.remove(builder.view!!)
builder.listener.onCloseExpandableView()
return
Expand Down Expand Up @@ -91,12 +91,37 @@ class ExpandableView(
override fun setupLayoutParams() {
super.setupLayoutParams()

var mFlag = WindowManager.LayoutParams.FLAG_DIM_BEHIND
var mHeight = WindowManager.LayoutParams.WRAP_CONTENT
var mWidth = WindowManager.LayoutParams.MATCH_PARENT
var mX: Int? = null

if (builder.isDrawUnderSystemUI) {
mFlag = WindowManager.LayoutParams.FLAG_DIM_BEHIND or
WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN or
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS

mWidth = sez.fullWidth
mHeight = sez.fullHeight

if (sez.screenRotation == ScreenRotation.LANDSCAPE) {
mX = -sez.navBarHeight
}

}

windowParams.apply {
width = WindowManager.LayoutParams.MATCH_PARENT
gravity = Gravity.TOP
flags = WindowManager.LayoutParams.FLAG_DIM_BEHIND
width = mWidth
height = mHeight
flags = mFlag
dimAmount = builder.dim // default = 0.5f

// this.verticalMargin = 0.07f // so fun hihi
// y = 100 // so fun hihihi
if (mX != null) {
x = mX
}

builder.viewStyle?.let {
windowAnimations = it
}
Expand All @@ -117,8 +142,18 @@ class ExpandableView(

internal var listener = object : Listener {}

internal var isDrawUnderSystemUI: Boolean = false

internal var dim = 0.5f

/**
* Allow the expandable-view to display under the system UI elements
* */
internal fun drawUnderSystemUI(included: Boolean): Builder {
isDrawUnderSystemUI = included
return this
}

fun view(view: View): Builder {
if (composeView != null) {
throw IllegalStateException("Cannot pass view after setting composable")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import android.view.Gravity
import android.view.LayoutInflater
import android.view.WindowManager
import com.torrydo.floatingbubbleview.databinding.BottomBackgroundBinding
import com.torrydo.screenez.ScreenEz

internal class FloatingBottomBackground(
private val builder: FloatingBubble.Builder
Expand Down Expand Up @@ -44,7 +43,7 @@ internal class FloatingBottomBackground(

windowParams.apply {
width = WindowManager.LayoutParams.MATCH_PARENT
height = ScreenEz.fullHeight / 5
height = sez.fullHeight / 5
gravity = Gravity.BOTTOM or Gravity.CENTER
flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH or
Expand Down
Loading
Loading