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


Java WatchViewStub类代码示例

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


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

示例1: onCreate

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

    //Set this to allow activity to enable the ambient mode
    setAmbientEnabled();

    //Get the watch view stub
    mWatchViewStub = (WatchViewStub) findViewById(R.id.watch_view_stub);
    mWatchViewStub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
        @Override
        public void onLayoutInflated(WatchViewStub watchViewStub) {
            init(watchViewStub);
        }
    });

    //Connect Google api client to communicate with phone
    connectGoogleApiClient();
}
 
开发者ID:kevalpatel2106,项目名称:android-samples,代码行数:21,代码来源:TrackActivity.java

示例2: onCreate

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

    final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
    stub.setOnLayoutInflatedListener(s -> {
        mButtonToggle = (Button) s.findViewById(R.id.button_toggle_link);
        mButtonToggle.setOnClickListener(
                v -> sendMessageToAllNodes(PageControlMessage.TOGGLE_LINK));

        mButtonPrev = (Button) s.findViewById(R.id.button_prev);
        mButtonPrev.setOnClickListener(
                v -> sendMessageToAllNodes(PageControlMessage.PREV_PAGE));

        mButtonNext = (Button) s.findViewById(R.id.button_next);
        mButtonNext.setOnClickListener(
                v -> sendMessageToAllNodes(PageControlMessage.NEXT_PAGE));
    });

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
}
 
开发者ID:vanadium-archive,项目名称:reader,代码行数:27,代码来源:PageControlActivity.java

示例3: onCreate

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    //setContentView(R.layout.activity_souliss_main);
    Log.i("SoulissWear", "onCreate");
    notfHelper = new NotificationPresets();
    // buildWearableOnlyNotification("Massimo", "casino", true);
    Notification brick = notfHelper.buildPagedNotification(this);

    NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);


    notificationManager.notify(Constants.NOTIFICATION_ID, brick);
    displaySpeechRecognizer();

    final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
   /* stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
        @Override
        public void onLayoutInflated(WatchViewStub stub) {
            mTextView = (TextView) stub.findViewById(R.id.text);
            //displaySpeechRecognizer();
            //displaySpeechRecognizer();
        }
    });*/
}
 
开发者ID:souliss,项目名称:soulissapp,代码行数:26,代码来源:SoulissWearActivity.java

示例4: onLayoutInflated

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
@Override
public void onLayoutInflated(WatchViewStub watchViewStub) {
    Log.e("control stub inflated");
    background = (ImageView) findViewById(R.id.watchBackground);

    mVolUpButton = watchViewStub.findViewById(R.id.vol_up);
    mVolDownButton = watchViewStub.findViewById(R.id.vol_down);
    mPrevButton = watchViewStub.findViewById(R.id.prev);
    mNextButotn = watchViewStub.findViewById(R.id.next);
    mPlayButton = (ImageButton) watchViewStub.findViewById(R.id.playPause);

    mVolUpButton.setOnClickListener(this);
    mVolDownButton.setOnClickListener(this);
    mPrevButton.setOnClickListener(this);
    mNextButotn.setOnClickListener(this);
    mPlayButton.setOnClickListener(this);

    updateBackground(getIntent().<Bitmap>getParcelableExtra(DataLayerListenerService.DATA_COVER_BLURED));
}
 
开发者ID:MatejVancik,项目名称:amaroKontrol,代码行数:20,代码来源:ControlActivity.java

示例5: onLayoutInflated

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
@Override
public void onLayoutInflated(WatchViewStub watchViewStub) {
	mTextView = (TextView) watchViewStub.findViewById(R.id.text);

	CircledImageView mCircleBtn = (CircledImageView) watchViewStub.findViewById(R.id.btn_circle);
	mCircleBtn.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View view) {
			if (!isStart) {
				startGame();
			} else {
				if (mGame != null) {
					endGame();
				}
			}
		}
	});
}
 
开发者ID:fython,项目名称:LuSpeed,代码行数:19,代码来源:MainFragment.java

示例6: onCreate

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

      stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
      /*
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);

      stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
          @Override
          public void onLayoutInflated(WatchViewStub stub) {
              mTextView = (TextView) stub.findViewById(R.id.text);
          }
      });

     */
      mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);

      this.accTimestamps = new LinkedList<Long>();
      this.gyroTimestamps = new LinkedList<Long>();
      this.magTimestamps = new LinkedList<Long>();
  }
 
开发者ID:m-philipp,项目名称:AndroidSensorLogger,代码行数:24,代码来源:ImuLiveScreen.java

示例7: init

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
/**
 * Initialize the UI.
 */
private void init(WatchViewStub watchViewStub) {
    mHeaderIv = (ImageView) watchViewStub.findViewById(R.id.header_icon);
    mHeaderIv.setColorFilter(ContextCompat.getColor(this, R.color.icon_red));

    mStepCountTv = (TextView) watchViewStub.findViewById(R.id.step_count_tv);
}
 
开发者ID:kevalpatel2106,项目名称:android-samples,代码行数:10,代码来源:TrackActivity.java

示例8: onCreate

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

    mGoogleApiClient = WearApp.getInstance().getGoogleApiClient();
    mGoogleApiClient.connect();

    final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
    stub.setOnLayoutInflatedListener(this);
}
 
开发者ID:MatejVancik,项目名称:amaroKontrol,代码行数:12,代码来源:PlayNowWearActivity.java

示例9: onLayoutInflated

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
@Override
public void onLayoutInflated(WatchViewStub stub) {
    mPlayButton = (ImageButton) stub.findViewById(R.id.playPause);
    mNextButton = (ImageButton) stub.findViewById(R.id.next);
    mPrevButton = (ImageButton) stub.findViewById(R.id.prev);

    mArtistText = (TextView) stub.findViewById(R.id.artist_text);
    mSongText = (TextView) stub.findViewById(R.id.song_text);

    coverView = (ImageView) findViewById(R.id.watchBackground);

    mPlayButton.setOnClickListener(this);
    mNextButton.setOnClickListener(this);
    mPrevButton.setOnClickListener(this);

    String artistData = getIntent().getStringExtra(DataLayerListenerService.DATA_ARTIST);
    String songData = getIntent().getStringExtra(DataLayerListenerService.DATA_SONG);

    if (artistData != null) mArtistText.setText(artistData);
    if(songData != null) mSongText.setText(songData);

    Bitmap cover = getIntent().getParcelableExtra(DataLayerListenerService.DATA_COVER_BLURED);
    if(cover == null) {
        coverView.setImageResource(R.drawable.albumblured);
    } else {
        coverView.setImageBitmap(cover);
    }
}
 
开发者ID:MatejVancik,项目名称:amaroKontrol,代码行数:29,代码来源:PlayNowWearActivity.java

示例10: onCreate

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_control);
    Log.e("On create control acitivty");

    final WatchViewStub stub = (WatchViewStub) findViewById(R.id.activity_control_stub);
    stub.setOnLayoutInflatedListener(this);
}
 
开发者ID:MatejVancik,项目名称:amaroKontrol,代码行数:10,代码来源:ControlActivity.java

示例11: initView

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
private void initView() {
    WatchViewStub stub = (WatchViewStub) findViewById(R.id.stub);
    stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
        @Override
        public void onLayoutInflated(WatchViewStub watchViewStub) {
            lv = (WearableListView) findViewById(R.id.listView);
            llLoading = findViewById(R.id.llLoading);
            tv = (TextView) findViewById(R.id.tv);
            initEvent();
        }
    });

}
 
开发者ID:liangchenhe55,项目名称:konkeWatch,代码行数:14,代码来源:MainActivity.java

示例12: onCreate

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

    mData = "0.0";
    mWatchInflatedListener = new WatchInflatedListener();

    final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
    stub.setOnLayoutInflatedListener(mWatchInflatedListener);
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:13,代码来源:MainWearActivity.java

示例13: onLayoutInflated

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
@Override
public void onLayoutInflated(WatchViewStub watchViewStub) {
    mTextView = (TextView) watchViewStub.findViewById(R.id.text);
    mBackground = (RelativeLayout) watchViewStub.findViewById(R.id.background);

    mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
    mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE);
    mSensorManager.registerListener(this, mSensor, SensorManager.SENSOR_DELAY_NORMAL);

    connect();
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:12,代码来源:MainWearActivity.java

示例14: onCreate

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

    final WatchViewStub viewStub = (WatchViewStub) findViewById(R.id.watch_view_stub);
    viewStub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
        @Override
        public void onLayoutInflated(WatchViewStub stub) {
            mContainer = (RelativeLayout) stub.findViewById(R.id.container_game_screen);
            mGameScreen = (GameScreen) stub.findViewById(R.id.game_screen_view);

            updateDisplay();
        }
    });

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(new GoogleApiClient.OnConnectionFailedListener() {
                @Override
                public void onConnectionFailed(@NonNull ConnectionResult result) {
                    Log.e(TAG, "onConnectionFailed " + result.toString());
                }
            })
            .build();
}
 
开发者ID:jordond,项目名称:powerhour,代码行数:29,代码来源:GameActivity.java

示例15: onCreateView

import android.support.wearable.view.WatchViewStub; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View root = inflater.inflate(R.layout.fragment_main, container, false);

	mViewStub = (WatchViewStub) root.findViewById(R.id.watch_view_stub);
	mViewStub.setOnLayoutInflatedListener(this);

	return root;
}
 
开发者ID:fython,项目名称:LuSpeed,代码行数:10,代码来源:MainFragment.java


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