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


Java DismissOverlayView.setIntroText方法代码示例

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


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

示例1: onCreate

import android.support.wearable.view.DismissOverlayView; //导入方法依赖的package包/类
public void onCreate(Bundle savedState) {
    super.onCreate(savedState);

    // Set the layout. It only contains a SupportMapFragment and a DismissOverlay.
    setContentView(R.layout.activity_map);

    // Obtain the Attraction that we need to display.
    mAttraction = getIntent().getParcelableExtra(Constants.EXTRA_ATTRACTION);

    // Obtain the DismissOverlayView and display the intro help text.
    mDismissOverlay = (DismissOverlayView) findViewById(R.id.map_dismiss_overlay);
    mDismissOverlay.setIntroText(R.string.exit_intro_text);
    mDismissOverlay.showIntroIfNecessary();

    // Obtain the MapFragment and set the async listener to be notified when the map is ready.
    MapFragment mapFragment = (MapFragment) getFragmentManager()
                    .findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
}
 
开发者ID:googlesamples,项目名称:io2015-codelabs,代码行数:20,代码来源:MapActivity.java

示例2: onCreate

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

    final DismissOverlayView dov = (DismissOverlayView) findViewById(R.id.dismiss);
    dov.setIntroText(R.string.long_press_intro);
    dov.showIntroIfNecessary();

    GestureDetector gd = new GestureDetector(this,
            new GestureDetector.SimpleOnGestureListener() {
        public void onLongPress(MotionEvent ev) {
            dov.show();
        }
    });

    TouchTimeView ttv = (TouchTimeView) findViewById(R.id.touch_time);
    ttv.setGestureDetector (gd);

    mVibrator = (Vibrator) getSystemService(VIBRATOR_SERVICE);
}
 
开发者ID:google,项目名称:TouchTime,代码行数:22,代码来源:TouchTimeActivity.java

示例3: onCreate

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

    int notifyId = getIntent().getIntExtra(WearRSSDataListenerService.NOTIFICATION_ID_EXTRA, -1);
    if (notifyId > 0) {
        NotificationManagerCompat.from(this).cancel(notifyId);
    }

    mHeadlinesPager = (GridViewPager)findViewById(R.id.headlines_pager);

    mDismissOverlay = (DismissOverlayView) findViewById(R.id.dismiss_overlay);
    mDismissOverlay.setIntroText(R.string.close_instructions);
    mDismissOverlay.showIntroIfNecessary();

    mGestureDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
        public void onLongPress(MotionEvent ev) {
            mDismissOverlay.show();
        }
    });

    mHeadlinesPager.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            return mGestureDetector.onTouchEvent(event);
        }
    });
}
 
开发者ID:creativedrewy,项目名称:WeaRSS,代码行数:30,代码来源:ViewHeadlinesActivity.java

示例4: onCreate

import android.support.wearable.view.DismissOverlayView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle b) {
    super.onCreate(b);
    setContentView(R.layout.main_activity);

    mDismissOverlayView = (DismissOverlayView) findViewById(R.id.dismiss_overlay);
    mDismissOverlayView.setIntroText(R.string.intro_text);
    mDismissOverlayView.showIntroIfNecessary();
    mGestureDetector = new GestureDetectorCompat(this, new LongPressListener());
}
 
开发者ID:mauimauer,项目名称:AndroidWearable-Samples,代码行数:11,代码来源:MainActivity.java

示例5: onCreate

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

    setContentView(R.layout.activity_view_image);

    mPanView = (PanView) findViewById(R.id.view_image_panview);
    mProgressBar = (ProgressBar) findViewById(R.id.view_image_progressbar);

    mDismissOverlay = (DismissOverlayView) findViewById(R.id.view_image_dismiss_overlay);
    mDismissOverlay.setIntroText(R.string.long_press_information);
    mDismissOverlay.showIntroIfNecessary();

    mPanView.setOnTouchListener(new View.OnTouchListener() {
        @Override public boolean onTouch(View v, MotionEvent event) {
            return mDetector.onTouchEvent(event);
        }
    });

    mDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
        @Override public void onLongPress(MotionEvent ev) {
            mDismissOverlay.show();
        }
    });

    mImageName = getIntent().getStringExtra(Constants.KEY_HIGHRES_IMAGE_NAME);

    getLoaderManager().initLoader(0, null, this);
}
 
开发者ID:emmaguy,项目名称:wear-notify-for-reddit,代码行数:29,代码来源:ViewImageActivity.java

示例6: onCreate

import android.support.wearable.view.DismissOverlayView; //导入方法依赖的package包/类
public void onCreate(Bundle savedState) {
    super.onCreate(savedState);

    // Set the layout. It only contains a MapFragment and a DismissOverlay.
    setContentView(R.layout.activity_maps);

    // Retrieve the containers for the root of the layout and the map. Margins will need to be
    // set on them to account for the system window insets.
    final FrameLayout topFrameLayout = (FrameLayout) findViewById(R.id.root_container);
    final FrameLayout mapFrameLayout = (FrameLayout) findViewById(R.id.map_container);

    // Set the system view insets on the containers when they become available.
    topFrameLayout.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
        @Override
        public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
            // Call through to super implementation and apply insets
            insets = topFrameLayout.onApplyWindowInsets(insets);

            FrameLayout.LayoutParams params =
                    (FrameLayout.LayoutParams) mapFrameLayout.getLayoutParams();

            // Add Wearable insets to FrameLayout container holding map as margins
            params.setMargins(
                    insets.getSystemWindowInsetLeft(),
                    insets.getSystemWindowInsetTop(),
                    insets.getSystemWindowInsetRight(),
                    insets.getSystemWindowInsetBottom());
            mapFrameLayout.setLayoutParams(params);

            return insets;
        }
    });

    // Obtain the DismissOverlayView and display the introductory help text.
    mDismissOverlay = (DismissOverlayView) findViewById(R.id.dismiss_overlay);
    mDismissOverlay.setIntroText(R.string.intro_text);
    mDismissOverlay.showIntroIfNecessary();

    // Obtain the MapFragment and set the async listener to be notified when the map is ready.
    // Obtain the MapFragment and set the async listener to be notified when the map is ready.
    mMapFragment = (MapFragment) getFragmentManager()
            .findFragmentById(R.id.map);
    mMapFragment.getMapAsync(this);

    if (!hasGps()) {
        Log.d(TAG, "This hardware doesn't have GPS.");
        // Fall back to functionality that does not use location or
        // warn the user that location function is not available.
    }

    mDataSource = new MemoriesDataSource(this);
    getLoaderManager().initLoader(0,null,this);
}
 
开发者ID:PacktPublishing,项目名称:Android-Wear-Projects,代码行数:54,代码来源:MapsActivity.java

示例7: onCreate

import android.support.wearable.view.DismissOverlayView; //导入方法依赖的package包/类
public void onCreate(Bundle savedState) {
    super.onCreate(savedState);

    // Set the layout. It only contains a MapFragment and a DismissOverlay.
    setContentView(R.layout.activity_maps);

    // Retrieve the containers for the root of the layout and the map. Margins will need to be
    // set on them to account for the system window insets.
    final FrameLayout topFrameLayout = (FrameLayout) findViewById(R.id.root_container);
    final FrameLayout mapFrameLayout = (FrameLayout) findViewById(R.id.map_container);

    // Set the system view insets on the containers when they become available.
    topFrameLayout.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
        @Override
        public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
            // Call through to super implementation and apply insets
            insets = topFrameLayout.onApplyWindowInsets(insets);

            FrameLayout.LayoutParams params =
                    (FrameLayout.LayoutParams) mapFrameLayout.getLayoutParams();

            // Add Wearable insets to FrameLayout container holding map as margins
            params.setMargins(
                    insets.getSystemWindowInsetLeft(),
                    insets.getSystemWindowInsetTop(),
                    insets.getSystemWindowInsetRight(),
                    insets.getSystemWindowInsetBottom());
            mapFrameLayout.setLayoutParams(params);

            return insets;
        }
    });

    // Obtain the DismissOverlayView and display the introductory help text.
    mDismissOverlay = (DismissOverlayView) findViewById(R.id.dismiss_overlay);
    mDismissOverlay.setIntroText(R.string.intro_text);
    mDismissOverlay.showIntroIfNecessary();

    // Obtain the MapFragment and set the async listener to be notified when the map is ready.
    // Obtain the MapFragment and set the async listener to be notified when the map is ready.
    mMapFragment = (MapFragment) getFragmentManager()
            .findFragmentById(map);
    mMapFragment.getMapAsync(this);

    if (!hasGps()) {
        Log.d(TAG, "This hardware doesn't have GPS.");
        // Fall back to functionality that does not use location or
        // warn the user that location function is not available.
    }

    mDataSource = new MemoriesDataSource(this);
    getLoaderManager().initLoader(0, null, this);
}
 
开发者ID:PacktPublishing,项目名称:Android-Wear-Projects,代码行数:54,代码来源:MapsActivity.java

示例8: onCreate

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

    setContentView(R.layout.activity_main);
    final FrameLayout topFrameLayout = (FrameLayout) findViewById(R.id.topFrameLayout);
    mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
    mGridViewPager = (GridViewPager) findViewById(R.id.gridViewPager);
    mDotsPageIndicator = (DotsPageIndicator) findViewById(R.id.dotsPageIndicator);
    mAdapter = new AttractionsGridPagerAdapter(this, mAttractions);
    mAdapter.setOnChromeFadeListener(this);
    mGridViewPager.setAdapter(mAdapter);

    topFrameLayout.setOnApplyWindowInsetsListener(new View.OnApplyWindowInsetsListener() {
        @Override
        public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
            // Call through to super implementation
            insets = topFrameLayout.onApplyWindowInsets(insets);

            boolean round = insets.isRound();

            // Store system window insets regardless of screen shape
            mInsets.set(insets.getSystemWindowInsetLeft(),
                    insets.getSystemWindowInsetTop(),
                    insets.getSystemWindowInsetRight(),
                    insets.getSystemWindowInsetBottom());

            if (round) {
                // On a round screen calculate the square inset to use.
                // Alternatively could use BoxInsetLayout, although calculating
                // the inset ourselves lets us position views outside the center
                // box. For example, slightly lower on the round screen (by giving
                // up some horizontal space).
                mInsets = Utils.calculateBottomInsetsOnRoundDevice(
                        getWindowManager().getDefaultDisplay(), mInsets);

                // Boost the dots indicator up by the bottom inset
                FrameLayout.LayoutParams params =
                        (FrameLayout.LayoutParams) mDotsPageIndicator.getLayoutParams();
                params.bottomMargin = mInsets.bottom;
                mDotsPageIndicator.setLayoutParams(params);
            }

            mAdapter.setInsets(mInsets);
            return insets;
        }
    });

    // Set up the DismissOverlayView
    mDismissOverlayView = (DismissOverlayView) findViewById(R.id.dismiss_overlay);
    mDismissOverlayView.setIntroText(getString(R.string.exit_intro_text));
    mDismissOverlayView.showIntroIfNecessary();
    mGestureDetector = new GestureDetectorCompat(this, new LongPressListener());

    Uri attractionsUri = getIntent().getParcelableExtra(Constants.EXTRA_ATTRACTIONS_URI);
    if (attractionsUri != null) {
        new FetchDataAsyncTask(this).execute(attractionsUri);
        UtilityService.clearNotification(this);
        UtilityService.clearRemoteNotifications(this);
    } else {
        finish();
    }
}
 
开发者ID:googlesamples,项目名称:io2015-codelabs,代码行数:64,代码来源:AttractionsActivity.java


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