當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。