recruit-lifestyle / floatingview Goto Github PK
View Code? Open in Web Editor NEWHome Page: http://engineer.recruit-lifestyle.co.jp/techblog/2015-07-29-floatingview/
License: Apache License 2.0
Home Page: http://engineer.recruit-lifestyle.co.jp/techblog/2015-07-29-floatingview/
License: Apache License 2.0
Hello,
I tried opening a popupwindow calling the following method in the onclicklistener of the chathead, but I did not manage to show it properly.
Whatever size I define my popup seems to be displayed within the range of the chathead. I would like to display it below the chathead, filling all the display size available below.
I tried also with ListPopupWindow and that is working fine.
This is my code:
`private void displayPopupWindow(View anchorView) {
LayoutInflater mInflater;
Context context=this.getApplicationContext();
mInflater = LayoutInflater.from(context);
int width;
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
Point size = new Point();
display.getSize(size);
width = size.x;
View popupView = mInflater.inflate(R.layout.webview, null);
PopupWindow popup = new PopupWindow(popupView);
WebView webView = (WebView) popupView.findViewById(R.id.webView1);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://www.google.com");
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
});
popup.setContentView(webView);
// Set content width and height
popup.setHeight(500);
popup.setWidth((int)width);
// Closes the popup window when touch outside of it - when looses focus
popup.setOutsideTouchable(true);
popup.setFocusable(true);
popup.setBackgroundDrawable(new BitmapDrawable());
// Show anchored to button
popup.showAtLocation(anchorView, Gravity.BOTTOM | Gravity.LEFT, 0, -100);
//popup.showAsDropDown(anchorView, 0, -150);
}`
Can you please help me? Thank you.
First of all, i'm sorry for posting here, i can't found your contact.
Can you make it supports a complicated view. I'm using the library, and my view has some buttons, the problem is i can't click on any button. Thanks in advanced.
Upon clicking the FloatingView I want a custom layout to be displayed within itself and not as an intent.
How to do this?
Please let me know.
Thanks.
Would it be possible to implement more than one action while dragging (the X button and something else for example)?
When a FloatingView is a layout which contains a button child.
How could i catch the button's OnClick() Event without it skipping it to the view's onTouch?
This seems to have been an option in previous builds. Is there a way to reenable the floating view to be placed anywhere on the screen instead of snapping to an edge? Thanks!
mMetrics.heightPixels
does not include Cutoutbranch
https://github.com/recruit-lifestyle/FloatingView/tree/feature/support_p
Even setting floatingViewWidth/floatingViewHeight when I call the sample code service I repeatedly have it crash with:
01-28 16:04:10.391 12421 12421 E AndroidRuntime: FATAL EXCEPTION: main
01-28 16:04:10.391 12421 12421 E AndroidRuntime: Process: com.android.systemui, PID: 12421
01-28 16:04:10.391 12421 12421 E AndroidRuntime: java.lang.IllegalArgumentException: width and height must be > 0
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.Bitmap.createBitmap(Bitmap.java:1027)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.Bitmap.createBitmap(Bitmap.java:994)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.Bitmap.createBitmap(Bitmap.java:944)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.Bitmap.createBitmap(Bitmap.java:905)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.drawable.AdaptiveIconDrawable.updateMaskBoundsInternal(AdaptiveIconDrawable.java:333)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.drawable.AdaptiveIconDrawable.updateLayerBounds(AdaptiveIconDrawable.java:295)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.drawable.AdaptiveIconDrawable.onStateChange(AdaptiveIconDrawable.java:782)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.graphics.drawable.Drawable.setState(Drawable.java:775)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.widget.ImageView.drawableStateChanged(ImageView.java:1318)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.view.View.refreshDrawableState(View.java:20028)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.view.View.dispatchAttachedToWindow(View.java:17425)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.view.ViewGroup.addViewInner(ViewGroup.java:4959)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.view.ViewGroup.addView(ViewGroup.java:4750)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.phone.NotificationIconAreaController.updateIconsForLayout(NotificationIconAreaController.java:247)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.phone.NotificationIconAreaController.updateNotificationIcons(NotificationIconAreaController.java:155)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar.updateNotificationShade(StatusBar.java:2171)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar.updateNotifications(StatusBar.java:2351)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar.addNotificationViews(StatusBar.java:7352)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar.addEntry(StatusBar.java:1842)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.phone.StatusBar.onAsyncInflationFinished(StatusBar.java:1859)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.notification.NotificationInflater$AsyncInflationTask.onAsyncInflationFinished(NotificationInflater.java:641)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.notification.NotificationInflater.finishIfDone(NotificationInflater.java:460)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.notification.NotificationInflater.-wrap0(Unknown Source:0)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.systemui.statusbar.notification.NotificationInflater$6.onViewApplied(NotificationInflater.java:343)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.widget.RemoteViews$AsyncApplyTask.onPostExecute(RemoteViews.java:3424)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.widget.RemoteViews$AsyncApplyTask.onPostExecute(RemoteViews.java:3404)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:695)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.os.AsyncTask.-wrap1(Unknown Source:0)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6592)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
01-28 16:04:10.391 12421 12421 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
01-28 16:04:10.400 1938 1992 I ActivityManager: Showing crash dialog for package com.android.systemui u0
Android version: 5.1.1
Device: Samsung Tablet A6
Any help please!
When move floatingview, position between finger and the floatingview is wrong
Thanks for your awesome lib. I trying to play VideoView in FloatingService But it's buggy and when trying to show video screen goes to black (I think it's because of SurfaceView I'm not sure)
I also have another problem when I want to switch from current VideoView
to your service I don't know how to continue from last position which is played. I Ask a question here But I didn't get answer could you please help me to solve this issue?
http://stackoverflow.com/questions/38615981/implement-floating-view-for-video-streaming
Floating view disappear when phone locks for a long time.
mMoveEdgeAnimatorX
and a mMoveEdgeAnimatorY
, not just one. Currently it only moves horizontally or verticallyThis is so that developers can move the floatingView themselves and do something like this:
I need to remember the last position of the view. There is initial x and y options but how to detect view movement so i can save x and y.
Hi i have been trying to run this for hours, i couldn't make it work. So i downloaded the sample project & tried running/debugging that also. No luck so far. I own a Xiaomi Redmi Note 3 with android lollipop 5.1 installed. The code executes, the service runs till end i got a notification up-top but no floating widget anywhere. Can you help me.
Documentation says:
2) Implement Service for displaying FloatingView
Why we have to use service?
I can create instance of FloatingViewManager in Application class, for example.
There is a option of initial animation, I tested it on miui and stock android it doesn't work
Seems like including a default layout to be inflated causes this weird behavior, the trash shaded area is jumping... Idk how to solve it, as I really need the message prompted as the image attached.
I'm using the configurations like the sample app (chat heads one), but inflating this layout instead of only the imageview:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_tin_message"
android:padding="16dp">
<RoundedImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center"
android:scaleType="centerCrop"
android:layout_width="20dp"
android:layout_height="20dp"
app:oval="true"
android:src="@drawable/ic_launcher"/>
<TextView
android:id="@+id/tin_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="16sp"
android:layout_gravity="center_vertical"
android:layout_marginStart="5dp"
android:textAppearance="?android:textAppearanceMedium"
tools:text="My TIN # is: 1125198411"/>
</LinearLayout>
07-26 22:53:21.622 4970-4970/jp.co.recruit.floatingview E/AndroidRuntime: FATAL EXCEPTION: main
Process: jp.co.recruit.floatingview, PID: 4970
java.lang.RuntimeException: Unable to start service jp.co.recruit_lifestyle.sample.service.ChatHeadService@e7250e9 with Intent { cmp=jp.co.recruit.floatingview/jp.co.recruit_lifestyle.sample.service.ChatHeadService }: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@fe840cc -- permission denied for window type 2007
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3556)
at android.app.ActivityThread.-wrap20(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@fe840cc -- permission denied for window type 2007
at android.view.ViewRootImpl.setView(ViewRootImpl.java:788)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:92)
at jp.co.recruit_lifestyle.android.floatingview.FloatingViewManager.addViewToWindow(FloatingViewManager.java:493)
at jp.co.recruit_lifestyle.sample.service.ChatHeadService.onStartCommand(ChatHeadService.java:68)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3539)
at android.app.ActivityThread.-wrap20(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1698)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
It worked fine on old phones. but on marshmallow and nougat it's crashing.
permission denied for this window type. .. on the line
mFloatingViewManager.addViewToWindow(iconView, options);
i guess this will do the job.
params.type = WindowManager.LayoutParams.TYPE_TOAST;
instead of
params.type = WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;
Please kindly update asap.. my app is crashing.
I'm Here's the stacktrace.
java.lang.IllegalArgumentException: View=jp.co.recruit_lifestyle.android.floatingview.a{2d7e2db VFE...C.. ......ID 0,0-216,216} not attached to window manager
Caused By:
android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:509)
android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:399)
android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:123)
jp.co.recruit_lifestyle.android.floatingview.FloatingViewManager.removeAllViewToWindow (SourceFile:550)
com.geecko.QuickLyric.services.LyricsOverlayService.onStartCommand (SourceFile:278)
android.app.ActivityThread.handleServiceArgs (ActivityThread.java:3639)
android.app.ActivityThread.-wrap20 (Unknown Source)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1768)
android.os.Handler.dispatchMessage (Handler.java:108)
android.os.Looper.loop (Looper.java:206)
android.app.ActivityThread.main (ActivityThread.java:6749)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:240)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:845)
Have gotten several thousands crash reports like this in the past 30 days.
The Library version that's used here is 2.3.1.
Important to note it only happens with Android 8.
Perhaps you need to use ViewCompat.isAttachedToWindow()?
java.lang.NoSuchMethodError: No static method canDrawOverlays(Landroid/content/Context;)Z in class Landroid/provider/Settings; or its super classes (declaration of 'android.provider.Settings' appears in /system/framework/framework.jar:classes2.dex)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at jp.co.recruit_lifestyle.sample.fragment.FloatingViewControlFragment.showChatHead(FloatingViewControlFragment.java:165)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at jp.co.recruit_lifestyle.sample.fragment.FloatingViewControlFragment.access$100(FloatingViewControlFragment.java:26)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at jp.co.recruit_lifestyle.sample.fragment.FloatingViewControlFragment$2.onClick(FloatingViewControlFragment.java:98)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at android.view.View.performClick(View.java:4780)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at android.view.View$PerformClick.run(View.java:19866)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:739)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at android.os.Looper.loop(Looper.java:135)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5254)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:372)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
11-03 16:50:16.142 26338-26338/jp.co.recruit.floatingview E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
How to change the view to right of screen
Hello, I would like to get draggable event when the my widget_chathead receive drag, checking the README I see Click Listener.
final LinearLayout iconView = (LinearLayout) inflater.inflate(R.layout.widget_chathead, null);
iconView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//works fine
}
});
It's works! but I want get event when user drag the widget, ex:
iconView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//not works :(
return false;
}
});
Someone can help-me? Thank you
By default view moved on screen by cells.
How to set view to move smoothly?
I have a project built with Dagger 2.0. When i added compile 'com.github.recruit-lifestyle:FloatingView:2.2.3
to build.gradle
i got DaggerApplicationComponent can not be resolved
error wich means Dagger
can not compile together with this library.
I know this error of Dagger and had solved it before but this time the only solution is to remove the FloatingView
dependency but i need it !!
Any solution ?
I run code on Android 5.0,FloatingView can show,but the version of Android later can`t show the floating view.
When I press on float view it dragged.
How to disable it?
I'm getting error:
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?
at android.view.ViewRootImpl.setView(ViewRootImpl.java:562)
Error happens when i Pass applicationsContext instead of getActivity() into FloatingViewManager.
mFloatingViewManager = new FloatingViewManager(getApplicationContext()
I have permission
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
in manifest but its not helps.
How to fix it?
I trying to create the RelativeLayout class to replace the iconView
final ImageView iconView = (ImageView) inflater.inflate(R.layout.widget_mail, null, false);
like is
final MapRelativeLayout mapView = new MapRelativeLayout(getApplicationContext());
the mapView can show on screen, but the button OnClickListener is not working,
How can I fix it?
and there is my MapRelativeLayout class
public class MapRelativeLayout extends RelativeLayout {
LayoutInflater mInflater;
public MapRelativeLayout(Context context){
super(context);
mInflater = LayoutInflater.from(context);
init();
}
public void init()
{
View v = mInflater.inflate(R.layout.widget_map_relative_layout, this, true);
Button btn = findViewById(R.id.button);
btn.setText("Testing");
btn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View view) {
Log.d("TEST", "Testing");
}
});
}
}
Hi! First of all thanks for this great library, it's really awesome to use. However, when I try to drag chatHead(Floating view) to bottom(to close it) and after Floating View closes I get the following error:
java.lang.IllegalArgumentException: View=jp.co.recruit_lifestyle.android.floatingview.FloatingView{79038e7 G.E...... ......ID 0,0-78,78} not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:473)
at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:368)
at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:101)
at jp.co.recruit_lifestyle.android.floatingview.FloatingView.updateViewLayout(FloatingView.java:507)
at jp.co.recruit_lifestyle.android.floatingview.FloatingView.onUpdateSystemLayout(FloatingView.java:418)
at jp.co.recruit_lifestyle.android.floatingview.FloatingViewManager.onScreenChanged(FloatingViewManager.java:234)
at jp.co.recruit_lifestyle.android.floatingview.FullscreenObserverView.onSystemUiVisibilityChange(FullscreenObserverView.java:129)
at android.view.View.dispatchSystemUiVisibilityChanged(View.java:20483)
at android.view.ViewRootImpl.handleDispatchSystemUiVisibilityChanged(ViewRootImpl.java:5622)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3674)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6128)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Hi,
I search for method like removeView() to remove floating view from screen.
I found method mFloatingViewManager.removeAllViewToWindow() but seems its not working.
The floatingview will not be under your finger. It is slightly to the right.
Waiting for Android O Final Release
Please check the progress on this branch
https://github.com/recruit-lifestyle/FloatingView/tree/android_o
When I close the app , the chat head (Floating View ) disappears. Whats the issue ?
Aright I did download the sample app and that is working fine, But when I add dependency of of FloatingView in my project everything is fine background service is running, I have add permission in manifest check it again and again but whenever I run the app click to button to show bubble but it never shows up mean while service gets started no error in log not at all. just can't see the bubble ...
awesome work btw...
Hi,
I try to run the sample application of this project.
I am getting following exception:
Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@990cb01 -- permission denied for window type 2038
at android.view.ViewRootImpl.setView(ViewRootImpl.java:789)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:356)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
at de.derdoenerdon.ressourcencockpit.library.src.main.java.jp.co.recruit_lifestyle.android.floatingview.FloatingViewManager.addViewToWindow(FloatingViewManager.java:502)
at de.derdoenerdon.ressourcencockpit.service.ChatHeadService.onStartCommand(ChatHeadService.java:66)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3474)
at android.app.ActivityThread.-wrap20(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
I also set this to my manifest:
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
My build.file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "de.derdoenerdon.ressourcencockpit"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:27.1.1'
implementation 'com.github.OPCFoundation:UA-Java:1.03.342.0'
//added librarys
//pdf
implementation 'com.github.barteksc:android-pdf-viewer:3.0.0-beta.5'
//smiley
implementation 'com.github.sujithkanna:smileyrating:1.6.8'
//image picker
implementation 'com.yanzhenjie:album:2.1.1'
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
//MaterialDrawer
implementation("com.mikepenz:materialdrawer:6.0.7@aar") {
transitive = true
}
//required support lib modules
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation "com.mikepenz:crossfader:1.5.2@aar"
//bubbles
implementation 'com.github.recruit-lifestyle:FloatingView:2.3.0'
testImplementation 'junit:junit:4.12'
testImplementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.7'
}
apply plugin: 'com.google.gms.google-services'
I use this implementation 'com.github.recruit-lifestyle:FloatingView:2.3.0' instead of
implementation 'com.github.recruit-lifestyle:FloatingView:2.3.1', because I get an exception, that I can not resolve the classpaths etc..but with this version, I could.
Also the project and images, how the bubble shall look like, seems to be nice, but the sample is very complicated and also need to include the "library".
I would be happy, if someone can help me to run this sample
Thanks
Hi @YoshihideSogawa,
I am currently using this library to implement a floating view for my application, however my projects requires two funtionalities:
What I have come to realize is that if I use:
options.floatingViewX = metrics.widthPixels - sizeOfChatHead;
options.floatingViewY = (int) this.getResources().getDimension(R.dimen.general_padding);
to set the icon to bottom left corner, I lose the second functionality.
If I don't set this option, it works the way I want it but it defaults the position on the top left corner of the screen.
Is there a way around this?
floatview can display over native adroid app,
but when i open game, it get killed.
any way to solve that?
Keyboard doesn't show, and text is not able to be selected when using an EditText layout. It's possible with Wei's library, which is now outdated.
Any way to handle this error?
Error: "FloatingView not attached to window manager"
What is the Physics-based Animations
To solve #19
Can someone tell me how can i retrieve last x and y positions of floating view ?
Calling floatingViewManager.removeAllViewToWindow();
cause IllegalArgumentException.
java.lang.IllegalArgumentException: View=jp.co.recruit_lifestyle.android.floatingview.FloatingView{f72bf3a V.E...... ......I. 0,0-540,303} not attached to window manager
at android.view.WindowManagerGlobal.findViewLocked(WindowManagerGlobal.java:473)
at android.view.WindowManagerGlobal.updateViewLayout(WindowManagerGlobal.java:368)
at android.view.WindowManagerImpl.updateViewLayout(WindowManagerImpl.java:99)
at jp.co.recruit_lifestyle.android.floatingview.FloatingView$FloatingAnimationHandler.handleMessage(FloatingView.java:1051)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Just as title, how can i reduce the size of trash_fixed_icon. it is too large on my screen. I am setting a bitmap to the floating icon.
Hi there
We are trying to use your library with full screen apps like games for example but we noticed that the floating view jumps position when loading a game, i noticed code that adjusts when screen size changes but i want to disable this, so how can i do so?
We need when it starts a particular position it doesn´t move when opening a full screen app.
Any idea how can we achieve this?
Hi, first of all, thank you!
I have a problem, i just realized that the floatingview i implemented on my app isn't showing on android 4 devices. And, searching for the problem, I tried the sample you gave us on an android 4 device and it isn't showing too.
I saw another closed issue where it was supposely working on android 4. Is there a workaround that i need to implement for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.