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

Layout position of SlideShowView #3

Open
dantp-ai opened this issue Oct 9, 2015 · 13 comments
Open

Layout position of SlideShowView #3

dantp-ai opened this issue Oct 9, 2015 · 13 comments

Comments

@dantp-ai
Copy link

dantp-ai commented Oct 9, 2015

I have a RelativeLayout as parent and want to position SlideShowView in the center of the parent. However this does not seem to work?

@spiritinlife
Copy link
Owner

<gr.spiritinlife.EasySlideShow.SlideShowView
        android:id="@+id/slideShow"
        android:layout_width="match_parent"
        android:layout_height="170dp"
        android:clickable="true"
       android:layout_centerInParent="true"/>

You have something like the above and it does not get centered ?
If not please provide some code.

@dantp-ai
Copy link
Author

Yes, I define SlideShowView layout like that. I put it inside a RelativeLayout:

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/black">
</RelativeLayout>

In Android Studio Design section, it seems to look correct(Fig. 1), however on my phone it looks different(Fig. 2)

(Fig. 1)
layout-2015-10-11-092055

(Fig.2)
screenshot_2015-10-11-09-26-45

@spiritinlife
Copy link
Owner

I cannot reproduce it.
I use this code and it seems fine

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">


    <gr.spiritinlife.EasySlideShow.SlideShowView
            android:id="@+id/slideShow"
            android:layout_width="match_parent"
            android:layout_height="170dp"
            android:clickable="true"
            android:layout_centerInParent="true"/>


</RelativeLayout>

Sorry i cannot be of more help/

@dantp-ai
Copy link
Author

Does it have something to do with your implementation of newImageViewInstance() ?

@spiritinlife
Copy link
Owner

I don't see something wrong with it . But the whole thing is not correct. I suggest you not use this for any of your apps. At the moment i am working on a new one that will be more stable. Maybe by the end of the day i will have something.

@dantp-ai
Copy link
Author

That would be awesome. \m/

@spiritinlife
Copy link
Owner

@plopd Check the new release that i pushed. It is still a pre release but i believe it is in the right direction.

  • Check the updated readme which is built upon your issue.

Tell if everything works this time
Cheers

@spiritinlife
Copy link
Owner

Closing it

@dantp-ai
Copy link
Author

I managed to get the new version running. However, if I use your example, and I would expect that the 'SlideShowView' layout is centered on the screen, it is still positioned on top.

@spiritinlife spiritinlife reopened this Oct 20, 2015
@spiritinlife
Copy link
Owner

Here is a screenshot. Could you send me the specs of your testing device to try to emulate it ?
The following screenshot is from a nexus 4 running android 5+
screenshot_2015-10-21-18-15-16

@dantp-ai
Copy link
Author

Android 4.2.2 Samsung Galaxy S2

@spiritinlife
Copy link
Owner

I have tested in genmotion emulator
With Samsung Galaxy S2 4.1.1 and Samsung Galaxy S3 4.2.2 and it looks correct.

Can you share some code?
At the moment , i do not see how this is not working for you.
Can you run your project on an emulator also to confirm that is not device specific ?

@dantp-ai
Copy link
Author

Yes, I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants