Search in sources :

Example 1 with TravelAdapter

use of com.aphidmobile.flip.demo.adapter.TravelAdapter in project android-flip by openaphid.

the class FlipComplexLayoutActivity 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);
    //Use RGB_565 can reduce peak memory usage on large screen device, but it's up to you to choose the best bitmap format 
    flipView.setAnimationBitmapFormat(Bitmap.Config.RGB_565);
    flipView.setAdapter(new TravelAdapter(this));
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController) TravelAdapter(com.aphidmobile.flip.demo.adapter.TravelAdapter)

Example 2 with TravelAdapter

use of com.aphidmobile.flip.demo.adapter.TravelAdapter in project android-flip by openaphid.

the class FlipDeleteAdapterActivity 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);
    //Use RGB_565 can reduce peak memory usage on large screen device, but it's up to you to choose the best bitmap format 
    flipView.setAnimationBitmapFormat(Bitmap.Config.RGB_565);
    adapter = new TravelAdapter(this);
    flipView.setAdapter(adapter);
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController) TravelAdapter(com.aphidmobile.flip.demo.adapter.TravelAdapter)

Example 3 with TravelAdapter

use of com.aphidmobile.flip.demo.adapter.TravelAdapter 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 4 with TravelAdapter

use of com.aphidmobile.flip.demo.adapter.TravelAdapter 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)

Aggregations

FlipViewController (com.aphidmobile.flip.FlipViewController)4 TravelAdapter (com.aphidmobile.flip.demo.adapter.TravelAdapter)4 View (android.view.View)1