Search in sources :

Example 6 with FlipViewController

use of com.aphidmobile.flip.FlipViewController in project android-flip by openaphid.

the class FlipAsyncContentActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    flipView = new FlipViewController(this);
    flipView.setAdapter(new MyBaseAdapter(this, flipView));
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController)

Example 7 with FlipViewController

use of com.aphidmobile.flip.FlipViewController in project android-flip by openaphid.

the class FlipButtonActivity method onCreate.

/**
   * Called when the activity is first created.
   */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    flipView = new FlipViewController(this);
    flipView.setAdapter(new BaseAdapter() {

        @Override
        public int getCount() {
            return 10;
        }

        @Override
        public Object getItem(int position) {
            return position;
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            NumberButton button;
            if (convertView == null) {
                final Context context = parent.getContext();
                button = new NumberButton(context, position);
                button.setTextSize(context.getResources().getDimension(R.dimen.textSize));
            } else {
                button = (NumberButton) convertView;
                button.setNumber(position);
            }
            return button;
        }
    });
    setContentView(flipView);
}
Also used : Context(android.content.Context) ViewGroup(android.view.ViewGroup) FlipViewController(com.aphidmobile.flip.FlipViewController) NumberButton(com.aphidmobile.flip.demo.views.NumberButton) BaseAdapter(android.widget.BaseAdapter) View(android.view.View)

Example 8 with FlipViewController

use of com.aphidmobile.flip.FlipViewController in project android-flip by openaphid.

the class FlipDynamicAdapterActivity method onCreate.

/**
   * Called when the activity is first created.
   */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    flipView = new FlipViewController(this);
    adapter = new TravelAdapter(this);
    flipView.setAdapter(adapter);
    flipView.setOnViewFlipListener(new FlipViewController.ViewFlipListener() {

        @Override
        public void onViewFlipped(View view, int position) {
            if (position == adapter.getCount() - 1) {
                //expand the data size on the last page 
                adapter.setRepeatCount(adapter.getRepeatCount() + 1);
                adapter.notifyDataSetChanged();
            }
        }
    });
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController) TravelAdapter(com.aphidmobile.flip.demo.adapter.TravelAdapter) View(android.view.View)

Example 9 with FlipViewController

use of com.aphidmobile.flip.FlipViewController in project android-flip by openaphid.

the class FlipHorizontalLayoutActivity method onCreate.

/**
   * Called when the activity is first created.
   */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    flipView = new FlipViewController(this, FlipViewController.HORIZONTAL);
    flipView.setAdapter(new TravelAdapter(this));
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController) TravelAdapter(com.aphidmobile.flip.demo.adapter.TravelAdapter)

Example 10 with FlipViewController

use of com.aphidmobile.flip.FlipViewController in project android-flip by openaphid.

the class Issue51Activity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    flipView = new FlipViewController(this);
    flipView.setAdapter(new MyBaseAdapter(this));
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController)

Aggregations

FlipViewController (com.aphidmobile.flip.FlipViewController)11 View (android.view.View)4 TravelAdapter (com.aphidmobile.flip.demo.adapter.TravelAdapter)4 Context (android.content.Context)3 ViewGroup (android.view.ViewGroup)3 BaseAdapter (android.widget.BaseAdapter)3 NumberTextView (com.aphidmobile.flip.demo.views.NumberTextView)2 GalleryFlipAdapter (com.aphidmobile.flip.demo.issue5.GalleryFlipAdapter)1 NumberButton (com.aphidmobile.flip.demo.views.NumberButton)1