GithubHelp home page GithubHelp logo

davideas / flipview Goto Github PK

View Code? Open in Web Editor NEW
489.0 14.0 78.0 23.88 MB

Flipping views like Gmail & beyond

Java 100.00%
flip-animation flipview viewflipper viewanimator gmail imageview textview

flipview's People

Contributors

bryant1410 avatar davideas avatar etibaldi 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  avatar

flipview's Issues

Cannot display text on both front and rear page

Hello,I'm new to this. I created ViewPager with FlipView items in it. Each FlipView Item contains front and rear side (both TextView). However I cannot display any text on these items and have no idea why is it.

FlashCardsSlideAdapter.kt

class FlashCardsSlideAdapter(private val context: Context, private val arrayOfRands: ArrayList<RandDataType>): PagerAdapter(){

    private val myImages = arrayOf(R.drawable.a1, R.drawable.a4, R.drawable.a3, R.drawable.a4)
    private var layoutInflater:LayoutInflater? = null

    override fun isViewFromObject(view: View, `object`: Any): Boolean {
        return view === `object`
    }

    override fun getCount(): Int {
        return arrayOfRands.size
    }

    override fun instantiateItem(container: ViewGroup, position: Int): Any {
        layoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
        val v = layoutInflater!!.inflate(R.layout.item_in_cards, null)

        val vp = container as ViewPager
        vp.addView(v, 0)
        return v
    }

    override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
        val vp = container as ViewPager
        val v = `object` as View
        vp.removeView(v)
    }
}

ViewPager in fragment_flash_cards.xml

<androidx.viewpager.widget.ViewPager android:layout_width="match_parent"
                                         android:layout_height="0dp" app:layout_constraintEnd_toEndOf="parent"
                                         app:layout_constraintStart_toStartOf="parent"
                                         android:layout_marginTop="8dp"
                                         app:layout_constraintTop_toTopOf="parent"
                                         app:layout_constraintBottom_toBottomOf="parent"
                                         android:layout_marginBottom="500dp"
                                         android:id="@+id/flashPager">

</androidx.viewpager.widget.ViewPager>

item_in_cards.xml

<eu.davidea.flipview.FlipView android:layout_width="match_parent"
                                  android:layout_height="250dp" app:layout_constraintStart_toStartOf="parent"
                                  android:layout_marginLeft="8dp"
                                  android:layout_marginStart="8dp" android:layout_marginTop="8dp"
                                  app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="parent"
                                  android:layout_marginEnd="8dp"
                                  android:layout_marginRight="8dp"
    app:frontLayout="@layout/fron_flip"
    app:rearLayout="@layout/rear_flip"
    android:clickable="true">
   
 </eu.davidea.flipview.FlipView>

fron_flip.xml

<TextView android:layout_width="match_parent" android:layout_height="match_parent"
              android:textAlignment="center"
              android:id="@+id/mainWordText"
              android:background="@color/colorAccent"
              android:gravity="center_vertical"
              android:text="@string/HeyString"
/>

rear_flip.xml is almost same as front_flip.

Used library: https://github.com/davideas/FlipView

Before applying FlipView library text in TextViews in ViewPager worked fine.

Thanks for any reply.

Possibilty to remove a rear layout

In FlipView, you can only "add" a rear layout. Meaning, that if you click on it, it shows in that order:

  1. Predefined front layout
  2. Predefined rear layout
  3. Added rear layout

There's no way to remove the second or the third rear layout.

Double Click

Could you add double Click on the FlipView, Thank you

Flip without Scale animation

If i want to flip view without rearImageAnimation, i cannot set it to non.
you must change this code:
setRearImageAnimation(AnimationUtils.loadAnimation(getContext(), animationResId > 0 ? animationResId : R.anim.scale_up));
to :
if(animationResId > 0) setRearImageAnimation(AnimationUtils.loadAnimation(getContext(),animationResId));

Or is there another way?

Is it possible to flip vertically?

Hello folks.

It sounds basic, but I really did not find it. Is it possible to flip the view vertically, instead horizontally?

Thanks in advance!

Can I flip dynamically generated views?

Hi, this is really just a question: is it possible to load dynamic views? Imagine an adapter that displays different views according to their position in the recyclerview. Can I flip those views, and have both front views and rear views dynamically generated? My idea is to have a flip view for each item and add dynamically both front and rear view but I am having trouble achieving it. Thanks for your time & attention.

FlipView flipping multiple rows in listview

Typical listview. Inflating each row in an adapter. Put both front and back layouts inside a FlipView in xml and inflating that instead. If you need to see the code, I can post if necessary.

Row 1 - tap this one
Row 2
Row 3
Row 4 - flipped also
Row 5
Row 6
Row 7 - Flipped also
Row 8
Row 9
Row 10 - flipped also

Circle View not sure why

Hi,

First of all thanks for the library.

I'm trying to create a simple demo to see how it works. I have your view declared as a row of a RecyclerView adapter.

<eu.davidea.flipview.FlipView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="200dp"
    android:layout_height="200dp"
    android:animateFirstView="false"
    android:clickable="false"
    app:frontLayout="@layout/view_list_word_front"
    app:rearLayout="@layout/view_list_word_back">

</eu.davidea.flipview.FlipView>

The front and back are both just a simple CardView, empty.

If I run the code I see a circle shape with the front view as part of it. Where is this circle coming from? Why that shape? Why is not just showing the shape of the CardView?

Thanks

get checked items?

Hi
how to get the checked items? and their count?
how to mark list items?

thanks...

Demo app crashes only with API 23 while flipping entire layouts only on real devices

Experimented that, only with API 23, only flipping entire layouts, demo app:

  • On real devices, is killed with no message and it logs: "E/OpenGLRenderer: resultIndex is -1, the polygon must be invalid!".
  • On emulator, doesn't crash but it logs: "W/OpenGLRenderer: Outline has 0 area, no spot shadow!".

If you know why, please let me know.

NPE when flipping the views

Not sure how this happens, but it happens. Searching a way to find the cause.

This doesn't happen in the example app, which it works.

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.