Search in sources :

Example 1 with FlipViewController

use of com.aphidmobile.flip.FlipViewController 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 FlipViewController

use of com.aphidmobile.flip.FlipViewController 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 FlipViewController

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

the class FlipTextViewActivity 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) {
            NumberTextView view;
            if (convertView == null) {
                final Context context = parent.getContext();
                view = new NumberTextView(context, position);
                view.setTextSize(context.getResources().getDimension(R.dimen.textSize));
            } else {
                view = (NumberTextView) convertView;
                view.setNumber(position);
            }
            return view;
        }
    });
    setContentView(flipView);
}
Also used : Context(android.content.Context) ViewGroup(android.view.ViewGroup) FlipViewController(com.aphidmobile.flip.FlipViewController) NumberTextView(com.aphidmobile.flip.demo.views.NumberTextView) BaseAdapter(android.widget.BaseAdapter) NumberTextView(com.aphidmobile.flip.demo.views.NumberTextView) View(android.view.View)

Example 4 with FlipViewController

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

the class FlipWebViewActivity method onCreate.

/**
   * Called when the activity is first created.
   */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle(R.string.activity_title);
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    //flip horizontally may be the better choice as most web pages need scroll vertically
    flipView = new FlipViewController(this, FlipViewController.HORIZONTAL);
    flipView.setAdapter(new MyBaseAdapter(this, flipView));
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController)

Example 5 with FlipViewController

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

the class Issue5Activity 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 GalleryFlipAdapter(this, flipView));
    setContentView(flipView);
}
Also used : FlipViewController(com.aphidmobile.flip.FlipViewController) GalleryFlipAdapter(com.aphidmobile.flip.demo.issue5.GalleryFlipAdapter)

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