scale

Disable OnClickListener while scaling or dragging a View

感情迁移 提交于 2019-12-11 09:42:56
问题 Hi I'm using MPAndroidChart and my added OnClickListener is triggered right after i zoomed into or dragged a chart. How can i disable this behavior? This are my chart properties: chart.setTouchEnabled(true); chart.setScaleEnabled(true); chart.setDragEnabled(true); chart.setPinchZoom(true); chart.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //this only should run if i really click on the chart, not if i zoom or drag it. ... }); Is there an easy way to

Scale a Canvas to fit a View programmatically

怎甘沉沦 提交于 2019-12-11 09:33:35
问题 I'm looking for help with the following scaling problem. I have built my own View class (custom view) which is a child of a Dialog . In this custom view I plot a graph in vertical direction from bottom to top. The graph can be greater or less than the size of the View . Therefore I would like to draw the graph onto the Canvas (which is greater than the View ) using the onDraw() method (see code below) and later scale the Canvas to fit into the View . Things I've tried already include using a

How can get the div background image to scale to the page size?

淺唱寂寞╮ 提交于 2019-12-11 09:30:00
问题 I am trying to make the background image of the div header scale to the size of the page. Here is the current css: .Header { background-image: url(Images/logo.png); height: 160px; width: 960px; margin-left: auto; margin-right: auto; margin-top: 20px; } 回答1: Make the position as absolute of the header and width as 100% position:absolute; width:100%; 来源: https://stackoverflow.com/questions/28653177/how-can-get-the-div-background-image-to-scale-to-the-page-size

Transform and scale animation on a View

ⅰ亾dé卋堺 提交于 2019-12-11 09:24:55
问题 I have a linear layout with three images in it. On the click of any ImageView I want to animate the whole linear layout. The animation consists of two animations - scale and transform. I don't know how to perform this animation. This is what I want - Image 1 - Before Animation Image 2 - After Animation I want to not only animate the View but actually shift the view to its new location with animation. After animation I should be able to click the Images at their new locatoin not the old

Fluid, flexible and scalable tiles to fill entire width of viewport

痞子三分冷 提交于 2019-12-11 09:14:46
问题 I am trying to create fluid and flexible "tiles" for a website, that span across 100% of the viewport of the browser. However, I would like them to scale a bit if needed to eliminate all white space if a the next tile doesn't fit. A normal div tag with a min-width & min-height of 200px, set to "display: inline-block" gets me most of the way. As I expand the browser window, the boxes will move up to the top line if there is room for another. My problem is when there isn't room for the next div

Android, WebView.getWidth() == window.innerWidth

心不动则不痛 提交于 2019-12-11 08:26:26
问题 What combination of META tag settings in HTML and WebSettings in Java should I use to get the following result: window.innerWidth in Javascript should be always (in any Android version and on any device) equal to the WebView width in pixels. For instance, I set the WebView width to 1024px. In Android AVD emulator, window.innerWidth is equal to 683px (2/3 of 1024, or 150% scale). I tried the following META: <meta name="viewport" content="width=device-width; user-scalable=no; initial-scale=1.0;

CSS @keyframes scale text blurry

自作多情 提交于 2019-12-11 07:58:12
问题 I scale text in @keyframes animation, when the text is increased, it becomes a blurry, how can I prevent it? JS Bin Example Thanks! 回答1: Easiest way to resolve issue is to make the largest state scale 1, and the smaller state scale 0.5, and adjust the font size accordingly. See http://jsbin.com/zonuriza/3/edit. I also updated it to function properly in Firefox. 来源: https://stackoverflow.com/questions/24415066/css-keyframes-scale-text-blurry

GridView not stretching to all screens

可紊 提交于 2019-12-11 07:40:04
问题 I have a GridView that is showing 2 images on a row. I have an SGS and Galaxy 5 to test the app. Unfortunately, it's not well scaling. I change values attributes in XML to fill the screen of SGS and when i test in Galaxy 5 it's bad, very bad. I don't know what to do. Please try to help me, the GridView is my main layout that launches other activities. XML: <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview"

ThreeJS - How do I scale down intersected object on “mouseout”

一世执手 提交于 2019-12-11 07:03:48
问题 I have n+1 hexshapes in a honeycomb grid. The objects are stacked close together. With this code: // Get intersected objects, a.k.a objects "hit" by mouse, a.k.a objects that are mouse-overed const intersects = raycaster.intersectObjects(hexObjects); // If there is one (or more) intersections let scaleTween = null; if (intersects.length > 0) { // If mouse is not currently over an object // Set cursor to pointer so that the user can see that the object is clickable document.body.style.cursor =

Scaling a QPolygon or QPolygonF

蓝咒 提交于 2019-12-11 07:03:46
问题 I need to scale a polygon. write the following Qt Code: QPolygonF qpf=QPolygonF(QPolygon(4,points)); QTransform trans; trans=trans.scale(1.5,1.5); QPolygonF qpf2=trans.map(qpf); path.addPolygon(qpf2); for the points: Qt Code: static const int points[8] = { 10, 80, 20, 10, 80, 30, 90, 70 }; it generates ---15,120-- ---30,15-- ---120,45-- ---135,105-- thus it moves slightly too. is there a way to scale from center? for example origin of the shape should be the same point after scaling. is there