Comments (10)
Please check this example:
from fancyshowcaseview.
@faruktoptas Thanks. I checked it out.
That sample works if a focus view is not dynamic (e.g regular view vs list item view). For focus view that is dynamic the calculations don't always work.
from fancyshowcaseview.
Calculations are done when build()
method is called with a view. If you build your FancyShowCaseView instance after inflation of target view it should work.
from fancyshowcaseview.
@faruktoptas Thanks for taking time to respond. I am doing calculations in the .customView()
method during the build time like below
.customView(R.layout.my_custom_view, object : OnViewInflateListener {
override fun onViewInflated(view: View) {
val params = view.layoutParams as FrameLayout.LayoutParams
view.post {
// This works
params.leftMargin = fancyShowCaseView.focusCenterX - view.width / 2
view.layoutParams = params
}
// some code for init
...
...
// Get the layout param of top level view group of custom view
val customView = (view as LinearLayout).findViewById<LinearLayout>(R.id.customView)
val customViewParamParams = customView.layoutParams as FrameLayout.LayoutParams
// Adjust the top margin for custom view so that it's on top of focused view.
// This calculation is guesstimate, and DOESN'T WORK when the focused view's height changes dynamically
customViewParams.topMargin =
fancyShowCaseView.focusCenterY - fancyShowCaseViewView.focusHeight - focusedView.measuredHeight / 2
customView.layoutParams = customViewParams
}
})
Let me know if you see something wrong.
from fancyshowcaseview.
Can you share a screenshot to see more details about buggy behaviour.
from fancyshowcaseview.
Sure. Device Pixel 3 A (but it's same behavior on any other Pixel emulators)
Context Use case 1 :
- I created list view with 4 textviews in each list item. I am highlighting item # 5 in the list
- I am showing all 4 text views in this case. Notice how custom view is nicely on top
- Screen shot 1:
Context Use case 2 :
- I am showing only 2 text views out of 4 text views in this case. Notice how custom view is off
- Screen shot 2:
from fancyshowcaseview.
Btw, I appreciate you taking time to respond. I am happy to DM you on twitter or something to save time for both if that works for you.
from fancyshowcaseview.
Hello @faruktoptas , just following up. Let me know if you need anything else on this from my end.
from fancyshowcaseview.
i faced same issue
from fancyshowcaseview.
@rr-akshay-dave @DevHisham
My apologies for the delayed response. If this is an active issue for you please let me know.
from fancyshowcaseview.
Related Issues (20)
- Problem with custom views on ClickListener. HOT 3
- Not Possible to Change Focus Size when using .focusShape(FocusShape.ROUNDED_RECTANGLE) HOT 2
- Gravity issue in Rounded Rectangle shape
- EnableTouchOnFocusedView Not working in case of CustomView HOT 1
- Add focus size factor for rectangular shape HOT 14
- Consider migrating from jcenter HOT 1
- problem to focus on toolbar overflow menu items HOT 4
- mavenCentral() support HOT 1
- Slower focus animations HOT 6
- IllegalArgumentException in DecorCaptionView HOT 1
- using closeOnTouch(true),clicking the view multiple times quickly causes problems HOT 1
- Problem in DialogFragment and BottomSheetDialogFragment HOT 2
- Set tiltle function does not work with custom view HOT 1
- How to add multiple highlighted areas HOT 1
- Focus on landscape has an offset HOT 2
- closeOnTouch set false make showcase skipped HOT 1
- Could not get .pom HOT 1
- ShowCase on BottomNavigation items HOT 2
- Is there an alternative/equivalent for Jetpack Compose ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fancyshowcaseview.