当前位置: 首页>>代码示例>>Java>>正文


Java Gallery.setSelection方法代码示例

本文整理汇总了Java中android.widget.Gallery.setSelection方法的典型用法代码示例。如果您正苦于以下问题:Java Gallery.setSelection方法的具体用法?Java Gallery.setSelection怎么用?Java Gallery.setSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.Gallery的用法示例。


在下文中一共展示了Gallery.setSelection方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onNewIntent

import android.widget.Gallery; //导入方法依赖的package包/类
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);

    if (null == DetailsActivity.app) {
        Log.w(getClass().getSimpleName(), "No app stored");
        finish();
        return;
    }

    Gallery gallery = ((Gallery) findViewById(R.id.gallery));
    gallery.setAdapter(new FullscreenImageAdapter(
        this,
        DetailsActivity.app.getScreenshotUrls(),
        getWindowManager().getDefaultDisplay().getWidth(),
        getWindowManager().getDefaultDisplay().getHeight()
    ));
    gallery.setSelection(intent.getIntExtra(INTENT_SCREENSHOT_NUMBER, 0));
}
 
开发者ID:yeriomin,项目名称:YalpStore,代码行数:20,代码来源:FullscreenImageActivity.java

示例2: onCreate

import android.widget.Gallery; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
	setContentView(R.layout.main);
	gallery = (Gallery) findViewById(R.id.gallery);
	bitmap = SDUtil.getImagePathFromSD(); 
	imageAdapter = new ImageAdapter(this, bitmap.size());
	gallery.setAdapter(imageAdapter);
	gallery.setOnItemSelectedListener(this);
	gallery.setSelection(1);// 璁剧疆涓�鍔犺浇Activity灏辨樉绀虹殑鍥剧墖涓虹浜屽紶

	gallery.setOnItemClickListener(this);

	iv = (ImageView) findViewById(R.id.iv);
	//imageSwitcher.setFactory(this);

	// 璁剧疆鍔ㄧ敾鏁堟灉 娣″叆娣″嚭
	//imageSwitcher.setInAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_in));
	//imageSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this, android.R.anim.fade_out));
}
 
开发者ID:liningwang,项目名称:camera,代码行数:22,代码来源:PictrueView.java

示例3: initViews

import android.widget.Gallery; //导入方法依赖的package包/类
@Override
protected void initViews(Bundle savedInstanceState) {
	setContentView(R.layout.activity_gallery);

	mGallery = (Gallery) findViewById(R.id.gallery);
	mImgAdapter = new GalleryAdapter(this);
	mGallery.setAdapter(mImgAdapter); 					// 设置图片资源
	mGallery.setGravity(Gravity.CENTER_HORIZONTAL);		// 设置水平居中显示
	mGallery.setSelection(mImgAdapter.mImgs.length * 100); // 设置起始图片显示位置(可以用来制作gallery循环显示效果)

	mGallery.setOnItemClickListener(mClickListener); // 设置点击图片的监听事件(需要用手点击才触发,滑动时不触发)
	mGallery.setOnItemSelectedListener(mSelectedListener); // 设置选中图片的监听事件(当图片滑到屏幕正中,则视为自动选中)
	mGallery.setUnselectedAlpha(0.3f);	// 设置未选中图片的透明度
	mGallery.setSpacing(40); // 设置图片之间的间距
}
 
开发者ID:AskViky,项目名称:CommunityService,代码行数:16,代码来源:GalleryActivity.java

示例4: onCreateView

import android.widget.Gallery; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.payment_zone, container, false);
    mPaymentModes = (Gallery) layout.findViewById(R.id.payment_modes);
    List<PaymentMode> modes = Data.PaymentMode.paymentModes(mContext);
    mPaymentModes.setAdapter(new PaymentModesAdapter(modes));
    mPaymentModes.setOnItemSelectedListener(new PaymentModeItemSelectedListener());
    mPaymentModes.setSelection(0, false);
    mCurrentMode = modes.get(0);

    mInput = (EditText) layout.findViewById(R.id.input);
    mInput.setInputType(InputType.TYPE_NULL); // Should be TextView.
    mNumberPad = (NumKeyboard) layout.findViewById(R.id.numkeyboard);
    mNumberPad.setKeyHandler(new Handler(this));

    mPaymentsList = (ListView) layout.findViewById(R.id.payments_list);
    mPaymentsList.setAdapter(new PaymentsAdapter(mPaymentsListContent, this));

    mRemaining = (TextView) layout.findViewById(R.id.ticket_remaining);
    mGiveBack = (TextView) layout.findViewById(R.id.give_back);

    mCusInfo = (LinearLayout) layout.findViewById(R.id.user_characteristic);
    mCusPrepaid = (TextView) layout.findViewById(R.id.custPrepaidAmount);
    mCusDebt = (TextView) layout.findViewById(R.id.currentDebt);
    mCusDebtMax = (TextView) layout.findViewById(R.id.mountMax);

    LinearLayout customerList = (LinearLayout) layout.findViewById(R.id.customers_list);
    customerList.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mListener.onPfCustomerListClick();
        }
    });

    updateView();
    return layout;
}
 
开发者ID:ScilCoop,项目名称:pasteque-android,代码行数:38,代码来源:PaymentFragment.java

示例5: BbCodesBasePanel

import android.widget.Gallery; //导入方法依赖的package包/类
public BbCodesBasePanel(Context context, Gallery gallery, EditText editText,
                        IGetBitmap getBitmap) {
    mContext = context;
    m_GetBitmapFunc = getBitmap;
    initVars();
    gallery.setAdapter(new ImageAdapter(context, getImages()));
    txtPost = editText;

    gallery.setSelection(3, true);
}
 
开发者ID:slartus,项目名称:4pdaClient-plus,代码行数:11,代码来源:BbCodesBasePanel.java


注:本文中的android.widget.Gallery.setSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。