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


Java DotsPageIndicator.setPager方法代码示例

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


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

示例1: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Bundle extras = getIntent().getExtras();
    percentage = extras.getInt("percentage", -1);
    timeshift = extras.getInt("timeshift", -1);

    if (percentage ==-1 || timeshift ==-1){
        finish(); return;
    }

    setContentView(R.layout.grid_layout);
    final Resources res = getResources();
    final GridViewPager pager = (GridViewPager) findViewById(R.id.pager);

    pager.setAdapter(new MyGridViewPagerAdapter());
    DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:21,代码来源:CPPActivity.java

示例2: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    pager = (GridViewPager) findViewById(R.id.pager);
    dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);

    //initialise Emmet
    emmet = new Emmet();
    emmet.onCreate(this);

    emmet.registerReceiver(WearProtocol.class, this);
    SmartphoneProtocol smartphoneProtocol = emmet.createSender(SmartphoneProtocol.class);

    smartphoneProtocol.hello(); //envoie le message hello smartphone
}
 
开发者ID:florent37,项目名称:TutosAndroidFrance,代码行数:19,代码来源:MainActivity.java

示例3: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    //initialise Emmet
    Emmet.onCreate(this);

    pager = (GridViewPager) findViewById(R.id.pager);
    dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);

    Emmet.registerReceiver(WearProtocol.class, this);
    SmartphoneProtocol smartphoneProtocol = Emmet.createSender(SmartphoneProtocol.class);

    smartphoneProtocol.pleaseSendMeVersions(); //envoie le message pleaseSendMeVersions smartphone
}
 
开发者ID:florent37,项目名称:MeetupWear_EmmetDavinci,代码行数:18,代码来源:MainActivity.java

示例4: setupViews

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
private void setupViews() {
    mPager = (GridViewPager) findViewById(R.id.pager);
    mPager.setOffscreenPageCount(2);
    DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setDotSpacing((int) getResources().getDimension(R.dimen.dots_spacing));
    dotsPageIndicator.setPager(mPager);
    mDataFragment = new DataFragment();
    mAssetFragment = new AssetFragment();
    DiscoveryFragment discoveryFragment = new DiscoveryFragment();
    List<Fragment> pages = new ArrayList<>();
    pages.add(mDataFragment);
    pages.add(mAssetFragment);
    pages.add(discoveryFragment);
    final MyPagerAdapter adapter = new MyPagerAdapter(getFragmentManager(), pages);
    mPager.setAdapter(adapter);
}
 
开发者ID:googlesamples,项目名称:android-DataLayer,代码行数:17,代码来源:MainActivity.java

示例5: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_books);
    // Getting UI references
    mPageIndicator = (DotsPageIndicator) findViewById(R.id.pager_indicator);
    mViewPager = (GridViewPager) findViewById(R.id.pager);
    // Drawable used to make the UI more captivating
    mCrossfadeDrawable = new CrossfadeDrawable();
    mCrossfadeDrawable.setFading(getResources().getDrawable(R.drawable.fading_background));
    findViewById(android.R.id.content).setBackground(mCrossfadeDrawable);
    // Creating and Setting the Pager adapter
    mAdapter = new BooksGridPagerAdapter(this);
    mViewPager.setAdapter(mAdapter);
    // Connecting the GridViewPager to the indicator
    mPageIndicator.setPager(mViewPager);
    // Adding the page change listener
    mViewPager.setOnPageChangeListener(this);
    // Creating the GoogleApiClient for the Wearable api (if available)
    if (GooglePlayServicesUtil.isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS) {
        mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addApi(Wearable.API).build();
    }
    // Initializing the loader
    getLoaderManager().initLoader(LOADER_ID_SUGGESTIONS, null, this);
}
 
开发者ID:SimoneCasagranda,项目名称:android-wear-tutorial,代码行数:26,代码来源:BooksActivity.java

示例6: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_grid_pager);

	final Intent intent = getIntent();
	final UartConfiguration configuration = intent.getParcelableExtra(CONFIGURATION);
	mConfigurationId = configuration.getId();

	// Check if the WEAR device is connected to the UART device itself, or by the phone.
	// Binding will fail if we are using phone as proxy as the service has not been started before.
	final Intent service = new Intent(this, BleProfileService.class);
	bindService(service, mServiceConnection, 0);

	// Set up tht grid
	final GridViewPager pager = (GridViewPager) findViewById(R.id.pager);
	pager.setAdapter(mAdapter = new UARTCommandsAdapter(configuration, this));

	final DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
	dotsPageIndicator.setPager(pager);

	// Configure Google API client
	mGoogleApiClient = new GoogleApiClient.Builder(this)
			.addApi(Wearable.API)
			.addConnectionCallbacks(this)
			.addOnConnectionFailedListener(this)
			.build();

	// Register the broadcast receiver that will listen for events from the device
	final IntentFilter filter = new IntentFilter();
	filter.addAction(BleProfileService.BROADCAST_CONNECTION_STATE);
	filter.addAction(BleProfileService.BROADCAST_ERROR);
	filter.addAction(UARTProfile.BROADCAST_DATA_RECEIVED);
	LocalBroadcastManager.getInstance(this).registerReceiver(mServiceBroadcastReceiver, filter);
}
 
开发者ID:runtimeco,项目名称:Android-DFU-App,代码行数:36,代码来源:UARTCommandsActivity.java

示例7: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.grid_layout);
    final Resources res = getResources();
    final GridViewPager pager = (GridViewPager) findViewById(R.id.pager);

    pager.setAdapter(new MyGridViewPagerAdapter());
    DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);

    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
    isMGDL = sp.getBoolean("units_mgdl", true);
    isSingleTarget =  sp.getBoolean("singletarget", true);
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:16,代码来源:TempTargetActivity.java

示例8: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.grid_layout);
    final Resources res = getResources();
    final GridViewPager pager = (GridViewPager) findViewById(R.id.pager);

    pager.setAdapter(new MyGridViewPagerAdapter());
    DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);
    SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
    hasPercentage =  sp.getBoolean("wizardpercentage", false);
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:14,代码来源:WizardActivity.java

示例9: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.grid_layout);
    final Resources res = getResources();
    final GridViewPager pager = (GridViewPager) findViewById(R.id.pager);

    pager.setAdapter(new MyGridViewPagerAdapter());
    DotsPageIndicator dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);
}
 
开发者ID:MilosKozak,项目名称:AndroidAPS,代码行数:12,代码来源:BolusActivity.java

示例10: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    pager = (GridViewPager) findViewById(R.id.pager);
    dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);

    //elementList = creerListElements();
    //pager.setAdapter(new ElementGridPagerAdapter(elementList,getFragmentManager()));
}
 
开发者ID:florent37,项目名称:TutosAndroidFrance,代码行数:13,代码来源:MainActivity.java

示例11: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.aty_detail);
    pager = (GridViewPager) findViewById(R.id.pager);
    pageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    pageIndicator.setPager(pager);

    List<Fragment> fragments = new ArrayList<>();
    fragments.add(new FmSwitch());
    pager.setAdapter(new MyAdapter(getFragmentManager(), fragments));
}
 
开发者ID:liangchenhe55,项目名称:konkeWatch,代码行数:13,代码来源:AtyDetail.java

示例12: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    pager = (GridViewPager) findViewById(R.id.pager);
    dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);

    elementList = creerListElements();
    pager.setAdapter(new ElementGridPagerAdapter(this,elementList,getFragmentManager()));

    final WearMenu wearMenu = (WearMenu) findViewById(R.id.wear_menu);
    wearMenu.setMenuElements(
            new String[]{
                    "title 1",
                    "title 2",
                    "title 3",
                    "title 4"
            },
            new Drawable[]{
                    getResources().getDrawable(R.drawable.ic_car,null),
                    getResources().getDrawable(R.drawable.ic_notif,null),
                    getResources().getDrawable(R.drawable.ic_picture,null),
                    getResources().getDrawable(R.drawable.ic_speak,null)
            }
    );
    wearMenu.setWearMenuListener(new WearMenu.WearMenuListener() {
        @Override
        public void onWearMenuListClicked(int position) {

        }
    });
}
 
开发者ID:florent37,项目名称:WearMenu,代码行数:35,代码来源:MainActivity.java

示例13: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_grid_pager);

	final Intent intent = getIntent();
	final UartConfiguration configuration = intent.getParcelableExtra(CONFIGURATION);
	mConfigurationId = configuration.getId();

	// Check if the WEAR device is connected to the UART device itself, or by the phone.
	// Binding will fail if we are using phone as proxy as the service has not been started before.
	final Intent service = new Intent(this, BleProfileService.class);
	bindService(service, mServiceConnection, 0);

	// Set up tht grid
	final GridViewPager pager = findViewById(R.id.pager);
	pager.setAdapter(mAdapter = new UARTCommandsAdapter(configuration, this));

	final DotsPageIndicator dotsPageIndicator = findViewById(R.id.page_indicator);
	dotsPageIndicator.setPager(pager);

	// Configure Google API client
	mGoogleApiClient = new GoogleApiClient.Builder(this)
			.addApi(Wearable.API)
			.addConnectionCallbacks(this)
			.addOnConnectionFailedListener(this)
			.build();

	// Register the broadcast receiver that will listen for events from the device
	final IntentFilter filter = new IntentFilter();
	filter.addAction(BleProfileService.BROADCAST_CONNECTION_STATE);
	filter.addAction(BleProfileService.BROADCAST_ERROR);
	filter.addAction(UARTProfile.BROADCAST_DATA_RECEIVED);
	LocalBroadcastManager.getInstance(this).registerReceiver(mServiceBroadcastReceiver, filter);
}
 
开发者ID:NordicSemiconductor,项目名称:Android-nRF-Toolbox,代码行数:36,代码来源:UARTCommandsActivity.java

示例14: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    pager = (GridViewPager) findViewById(R.id.pager);
    dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);

    elementList = creerListElements();
    pager.setAdapter(new ElementGridPagerAdapter(elementList,getFragmentManager()));
}
 
开发者ID:florent37,项目名称:WearViewStub,代码行数:13,代码来源:MainActivity.java

示例15: onCreate

import android.support.wearable.view.DotsPageIndicator; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    pager = (GridViewPager) findViewById(R.id.pager);
    dotsPageIndicator = (DotsPageIndicator) findViewById(R.id.page_indicator);
    dotsPageIndicator.setPager(pager);

    mImageView = (ImageView) findViewById(R.id.imageWithTransparency);

    DaVinci.with(this).load("http://www.seomofo.com/downloads/new-google-logo-knockoff.png").into(mImageView);
}
 
开发者ID:florent37,项目名称:DaVinci,代码行数:14,代码来源:MainActivity.java


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