當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewPager.getLayoutParams方法代碼示例

本文整理匯總了Java中android.support.v4.view.ViewPager.getLayoutParams方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewPager.getLayoutParams方法的具體用法?Java ViewPager.getLayoutParams怎麽用?Java ViewPager.getLayoutParams使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.view.ViewPager的用法示例。


在下文中一共展示了ViewPager.getLayoutParams方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initUI

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
private void initUI(){		
	previewOperationBar = (LinearLayout) findViewById(R.id.picker_image_preview_operator_bar);
	originalImage = (ImageButton) findViewById(R.id.picker_image_preview_orignal_image);
	originalImage.setOnClickListener(this);
	originalImageSizeTip = (TextView) findViewById(R.id.picker_image_preview_orignal_image_tip);
	if(!isSupportOriginal){
		originalImage.setVisibility(View.INVISIBLE);
		originalImageSizeTip.setVisibility(View.INVISIBLE);
	}
	previewSendBtn = (TextView) findViewById(R.id.picker_image_preview_send);
	previewSendBtn.setOnClickListener(this);
	updateSelectBtnStatus();
	updateOriImageSizeTip(isSendOriginalImage);
			
	imageViewPager = (ViewPager) findViewById(R.id.picker_image_preview_viewpager);
	imageViewPager.setOnPageChangeListener(this);
	imageViewPager.setOffscreenPageLimit(2);
	imageViewPagerAdapter = new PickerPreviewPagerAdapter(this, photoLists, getLayoutInflater(),
			imageViewPager.getLayoutParams().width, imageViewPager.getLayoutParams().height, this);
	imageViewPager.setAdapter(imageViewPagerAdapter);
	
	setTitleIndex(firstDisplayImageIndex);
	updateTitleSelect(firstDisplayImageIndex);
	imageViewPager.setCurrentItem(firstDisplayImageIndex);
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:26,代碼來源:PickerAlbumPreviewActivity.java

示例2: setupViewPager

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
public static void setupViewPager(final ViewPager viewPager) {
        ViewGroup.LayoutParams layoutParams = viewPager.getLayoutParams();
        layoutParams.width = ((Activity) viewPager.getContext()).getWindowManager().getDefaultDisplay().getWidth() / 7 * 5;
        layoutParams.height = (int) ((layoutParams.width / 0.75));

        viewPager.setOffscreenPageLimit(2);

        if (viewPager.getParent() instanceof ViewGroup) {
            ViewGroup viewParent = ((ViewGroup) viewPager.getParent());
            viewParent.setClipChildren(false);
            viewPager.setClipChildren(false);
        }

        viewPager.setPageTransformer(true, new ExpandingViewPagerTransformer());

//        viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
//            @Override
//            public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
//                ExpandingFragment expandingFragment = getCurrentFragment(viewPager);
//                if(expandingFragment != null && expandingFragment.isOpenend()){
//                    expandingFragment.close();
//                }
//            }
//
//            @Override
//            public void onPageSelected(int position) {
//
//            }
//
//            @Override
//            public void onPageScrollStateChanged(int state) {
//
//            }
//        });
    }
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:36,代碼來源:ExpandingPagerFactory.java

示例3: onCreateView

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  Log.d("onCreateView " + this);
  View rod = inflater.inflate(R.layout.drama_og_bog_frag, container, false);
  karruselAdapter = new KarruselAdapter(getChildFragmentManager());
  viewPager = (ViewPager) rod.findViewById(R.id.pager);
  viewPager.setAdapter(karruselAdapter);
  viewPager.getLayoutParams().height = billedeHø; // Viewpageren skal fylde præcist ét billede i højden
  karruselIndikator = (CirclePageIndicator)rod.findViewById(R.id.indicator);
  karruselIndikator.setViewPager(viewPager);
  final float density = getResources().getDisplayMetrics().density;
  karruselIndikator.setRadius(5 * density);
  karruselIndikator.setPageColor(Color.BLACK);
  karruselIndikator.setFillColor(App.color.blå);
  karruselIndikator.setStrokeColor(0);
  karruselIndikator.setStrokeWidth(0);
  App.data.dramaOgBog.observatører.add(this);
  run();
  viewPager.setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
      if (event.getAction()==MotionEvent.ACTION_DOWN || event.getAction()==MotionEvent.ACTION_UP) {
        App.forgrundstråd.removeCallbacks(skiftTilNæsteIKarrusellen);
        App.forgrundstråd.postDelayed(skiftTilNæsteIKarrusellen, 10000);
      }
      return false;
    }
  });
  App.forgrundstråd.postDelayed(skiftTilNæsteIKarrusellen, 10000);

  AQuery aq = new AQuery(rod);
  listView = (PinnedSectionListView) aq.id(R.id.listView).adapter(listeAdapter).getListView();
  listView.setEmptyView(aq.id(R.id.tom).typeface(App.skrift_gibson).getView());
  listView.setOnItemClickListener(this);
  return rod;
}
 
開發者ID:nordfalk,項目名稱:EsperantoRadio,代碼行數:37,代碼來源:DramaOgBog_frag.java

示例4: setPagerProperties

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
public void setPagerProperties(final ViewPager vp) {
    final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) vp.getLayoutParams();
    lp.height = mEmojiKeyboardHeight;
    lp.bottomMargin = mEmojiPagerBottomMargin;
    vp.setLayoutParams(lp);
}
 
開發者ID:sergeychilingaryan,項目名稱:AOSP-Kayboard-7.1.2,代碼行數:7,代碼來源:EmojiLayoutParams.java


注:本文中的android.support.v4.view.ViewPager.getLayoutParams方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。