Code Monkey home page Code Monkey logo

rotate-layout's People

Contributors

rongi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rotate-layout's Issues

Touch event coordinates coversion issue

Hi, Rongi!

Thanks for your library. I've met an issue on the following layout. I have vertical ListView each item of which has its own ListView rotated counterclockwise. See image:
81bf6-clip-45kb

Rotating inner ListView means that all its items will be rotated. It isn't OK for me cause I need to get a kind of horizontal ListView. So I've rotated layout of each item clockwise for 90 degrees.

Everything works fine except on issue: when starting scrolling horizontally touching the right upper of the horizontal ListView item then horizontal list view jumps.
1befd34068355e580eb38e44d7ff8273

At the same time if I scroll touching other conners of the horizontal ListView item this "jumps" almost were not visible. I suggested that the jumping is caused because of coordinates conversion in RotateLayout.dispatchTouchEvent(MotionEvent event) method. Cause after dispatchTouchEvent this event could be used by another view (horizontal ListView in my example). So I replaced

    @Override
    public boolean dispatchTouchEvent(MotionEvent event) {
        viewTouchPoint[0] = event.getX();
        viewTouchPoint[1] = event.getY();

        rotateMatrix.mapPoints(childTouchPoint, viewTouchPoint);
        event.setLocation(childTouchPoint[0], childTouchPoint[1]);
        return super.dispatchTouchEvent(event);
    }

with the following code that restores back old coords:

    @Override
    public boolean dispatchTouchEvent(MotionEvent event) {
        float oldX = viewTouchPoint[0] = event.getX();
        float oldY = viewTouchPoint[1] = event.getY();

        rotateMatrix.mapPoints(childTouchPoint, viewTouchPoint);
        event.setLocation(childTouchPoint[0], childTouchPoint[1]);

        boolean result = super.dispatchTouchEvent(event);
        event.setLocation(oldX, oldY);
        return result;
    }

So I would like to ask you to check my change. Don't you see any issues that it can bring ? If not maybe you will include this change to your repository. Thanks for attention :).

Change layout angle programmatically

Hey, I might have missed it somewhere but is there a way to change the contained layout angle via code instead of using the xml [app:layout_angle="90"] ?
So that the angle changes dynamically.

EDIT: I tried doing ((RotateLayout.LayoutParams) layout.getView().getLayoutParams()).angle = (int) newAngle; and it worked but it doesn't seem very clean.

Unsupported Method: GradleProject.getProjectDirectory()

i opened the latest project from release in android studio (also tried getting latest repo from git clone)

Gradle sync fails with below message

ERROR: Unsupported method: GradleProject.getProjectDirectory().
The version of Gradle you connect to does not support that method.
To resolve the problem you can change/upgrade the target version of Gradle you connect to.
Alternatively, you can ignore this exception and read other information from the model.

it does not work if include a webview and after the webview loadUrl.

I have a landscape activity and use below layout, and call mWebView.loadUrl("http://www.google.com"); it will cause the webview only fill the center of the screen. And if not call loadUrl, seems it is ok. Why?

1

<com.github.rongi.rotate_layout.layout.RotateLayout xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/form1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#ff0000">

        <WebView
            android:id="@+id/webview"
            app:layout_angle="90"
            android:layout_width="match_parent"
            android:layout_height="match_parent" />

</com.github.rongi.rotate_layout.layout.RotateLayout>

Hello

please change attribute name from angel to anything
Thanks

It fails managing pinch to zoom

I use a chart inside the rotate-layout.
It works well with touch and drag. But it does not with multitouch (pinch to zoom), it works like if it isn't rotate.

I cloned the repo to fix it myself, but I was not able to compile it (I lost two hours trying to do it)

I think that the problem is that in dispatchTouchEvent() is modified only one pointer (the first).
The solution should be to modify all positions, but since the MotionEvent does not have methods to do that, a new MotionEvent must be created. Check this solution

Accessability issue with This Custom Layout

I have implemented this Layout since long in my project now, When I have implemented Accessability with it, Its not working in RotationLayout Only.
Any suggestion or Help..

"error: Error parsing XML: unbound prefix" and "Attribute is missing the Android namespace prefix"

Hello,

I'm using this library to achieve a horizontal list view by implementing the suggestion given by Kc Ochibili as an answer to this question: http://stackoverflow.com/questions/3240331/horizontal-listview-in-android. I'm getting the following errors when I try to use the library:

"error: Error parsing XML: unbound prefix"

and

"Attribute is missing the Android namespace prefix"

Here's what the code looks like so far:

   `<com.github.rongi.rotate_layout.layout.RotateLayout
app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.example.newsfeedreader.NewsDisplay$PlaceholderFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" >

    <TextView
        android:id="@+id/rss_feed"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        app:layout_angle="-90"
        />
 </com.github.rongi.rotate_layout.layout.RotateLayout>`

How can I get rid of these errors so that I can use this library? I'm trying to build an RSS feed reader by following this tutorial: https://www.androidpit.com/java-guide-2-program-your-own-rss-reader.

P.S. I'm a newbie when it comes to android development so please bear with me. :)

#over flow or contextual menu

I appreciate your hard effort. There is every thing perfectly buhh only one thing which I have noticed and faced is overflow/contextual menu are not accurate position in rotation even thy are not rotate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.