@Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   // Inflate the layout for this fragment
   View v;
   v = inflater.inflate(R.layout.fragment_news, container, false);
   mFlipView = (FlipView) v.findViewById(R.id.flip_view);
   mAdapter = new FlipAdapter(getActivity(), (new NewsList().newsList));
   mFlipView.setAdapter(mAdapter);
   mFlipView.peakNext(false);
   mFlipView.setOverFlipMode(OverFlipMode.RUBBER_BAND);
   return v;
 }
Exemplo n.º 2
0
  public FlipView(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.FlipView);

    // 0 is vertical, 1 is horizontal
    mIsFlippingVertically =
        a.getInt(R.styleable.FlipView_orientation, VERTICAL_FLIP) == VERTICAL_FLIP;

    setOverFlipMode(OverFlipMode.values()[a.getInt(R.styleable.FlipView_overFlipMode, 0)]);

    a.recycle();

    init();
  }