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


Java ViewPager.findViewById方法代碼示例

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


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

示例1: TrackViewHolder

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
public TrackViewHolder(View view) {
    super(view);

    index = (CircularProgressButton) view.findViewById(R.id.cell_index);
    artist = (TextView) view.findViewById(R.id.cell_artist);
    title = (TextView) view.findViewById(R.id.cell_title);
    duration = (TextView) view.findViewById(R.id.cell_duration);
    textSearchAuthor = (TextView) view.findViewById(R.id.textSearchAuthor);
    actionSetRingtone = view.findViewById(R.id.actionSetRingtone);
    actionShare = view.findViewById(R.id.actionShare);
    actionSearchArtist = view.findViewById(R.id.actionSearchAuthor);
    actionDownload = view.findViewById(R.id.actionDownload);
    actionToPlaylist = view.findViewById(R.id.actionToPlaylist);
    actionFromPlaylist = view.findViewById(R.id.actionFromPlaylist);
    artwork = (ImageView) view.findViewById(R.id.cell_artwork);
    downloadProgress = (CircularProgressButton) view.findViewById(R.id.track_cell_progress_download);

    viewPager = (ViewPager) view.findViewById(R.id.viewPager);
    mainView = viewPager.findViewById(R.id.item_page_0);
}
 
開發者ID:dmllr,項目名稱:IdealMedia,代碼行數:21,代碼來源:PlayerAdapter.java

示例2: PlaylistViewHolder

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
public PlaylistViewHolder(View view) {
    super(view);

    title = (TextView)view.findViewById(android.R.id.text1);
    icon = view.findViewById(android.R.id.icon);
    actionSetPlaylistAsWorking = view.findViewById(R.id.actionSetPlaylistAsWorking);
    actionEditPlaylist = view.findViewById(R.id.actionEditPlaylist);
    actionDropPlaylist = view.findViewById(R.id.actionDropPlaylist);

    viewPager = (ViewPager)view.findViewById(R.id.viewPager);
    mainView = viewPager.findViewById(R.id.item_page_0);
}
 
開發者ID:dmllr,項目名稱:IdealMedia,代碼行數:13,代碼來源:PlaylistsFragment.java

示例3: FoldersViewHolder

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
public FoldersViewHolder(View view) {
    super(view);

    section = (TextView)view.findViewById(R.id.section);
    title = (TextView)view.findViewById(R.id.textView);
    actionToPlaylist = view.findViewById(R.id.actionToPlaylist);

    viewPager = (ViewPager)view.findViewById(R.id.viewPager);
    mainView = viewPager.findViewById(R.id.item_page_0);
}
 
開發者ID:dmllr,項目名稱:IdealMedia,代碼行數:11,代碼來源:FoldersAdapter.java

示例4: onCreate

import android.support.v4.view.ViewPager; //導入方法依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        mMainView = findViewById(R.id.pager);
        mProgress = findViewById(R.id.main_progress);

        mViewPager = (ViewPager) mMainView;
        mTitleStrip = (PagerTitleStrip) mViewPager.findViewById(R.id.pager_title_strip);
        mArrayPager = new ArrayPagerAdapter(getSupportFragmentManager());
        mViewPager.setAdapter(mArrayPager);

        self = this;

        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
                        .setAction("Action", null).show();
            }
        });

        if (savedInstanceState != null) {
            restoreSavedState(savedInstanceState);
        }

        DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
            public void onDrawerOpened(View drawerView) {
//                TextView mServerUrl = (TextView) findViewById(R.id.nav_serverurl);
//                if ((Me != null) && (mServerUrl != null))
//                    mServerUrl.setText(Me.getName());
            }
        };
        drawer.addDrawerListener(toggle);

        toggle.syncState();

        NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);

    }
 
開發者ID:andresth,項目名稱:Kandroid,代碼行數:48,代碼來源:MainActivity.java


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