本文整理匯總了Java中android.support.wearable.view.WatchViewStub.setOnLayoutInflatedListener方法的典型用法代碼示例。如果您正苦於以下問題:Java WatchViewStub.setOnLayoutInflatedListener方法的具體用法?Java WatchViewStub.setOnLayoutInflatedListener怎麽用?Java WatchViewStub.setOnLayoutInflatedListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.wearable.view.WatchViewStub
的用法示例。
在下文中一共展示了WatchViewStub.setOnLayoutInflatedListener方法的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();
}
示例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();
}
示例3: 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);
}
示例4: 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);
}
示例5: 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();
}
});
}
示例6: 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);
}
示例7: 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();
}
示例8: 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;
}
示例9: 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_about, container, false);
mContext = getActivity().getApplicationContext();
mViewStub = (WatchViewStub) root.findViewById(R.id.watch_view_stub);
mViewStub.setOnLayoutInflatedListener(this);
return root;
}
示例10: setContentViews
import android.support.wearable.view.WatchViewStub; //導入方法依賴的package包/類
@DebugLog
public void setContentViews(int rectLayoutResId, int roundLayoutResId) {
WatchViewStub watchViewStub = new WatchViewStub(this);
watchViewStub.setLayoutParams(new WatchViewStub.LayoutParams(WatchViewStub.LayoutParams.MATCH_PARENT, WatchViewStub.LayoutParams.MATCH_PARENT));
watchViewStub.setRectLayout(rectLayoutResId);
watchViewStub.setRoundLayout(roundLayoutResId);
watchViewStub.setOnLayoutInflatedListener(this);
setContentView(watchViewStub);
}
示例11: onCreate
import android.support.wearable.view.WatchViewStub; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_annotate_smoking);
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);
final Annotate me = this;
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub watchViewStub) {
delayedConfirmationView = (DelayedConfirmationView) findViewById(R.id.delayed_confirmation);
delayedConfirmationView.setListener(me);
delayedConfirmationView.setTotalTimeMs(NUM_SECONDS * 1000);
delayedConfirmationView.start();
}
});
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addOnConnectionFailedListener(this)
.build();
}
示例12: onCreate
import android.support.wearable.view.WatchViewStub; //導入方法依賴的package包/類
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initApiClient();
WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override public void onLayoutInflated(WatchViewStub watchViewStub) {
ButterKnife.inject(MainActivity.this);
}
});
}
示例13: onCreate
import android.support.wearable.view.WatchViewStub; //導入方法依賴的package包/類
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cookie);
WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override public void onLayoutInflated(WatchViewStub watchViewStub) {
ButterKnife.inject(CookieActivity.this);
tvCookie.setText(getIntent().getStringExtra(EXTRA_COOKIE));
}
});
}
示例14: onCreate
import android.support.wearable.view.WatchViewStub; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addConnectionCallbacks(this)
.build();
mGoogleApiClient.connect();
setContentView(R.layout.activity_main);
mWatchViewStub = (WatchViewStub) findViewById(R.id.watch_view_stub);
mWatchViewStub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
mBtnCameraMode = (ImageButton)findViewById(R.id.btnCameraMode);
mBtnReconnect = (ImageButton)findViewById(R.id.btnReconnect);
mBtnVideoMode = (Button)findViewById(R.id.btnVideoMode);
mTxtBatteryLevel = (TextView)findViewById(R.id.txtBatteryLevel);
mImgBatteryLevel = (ImageView)findViewById(R.id.imgBatteryLevel);
mBtnShutter = (Button)findViewById(R.id.btnShutter);
mTxtStatus = (TextView)findViewById(R.id.txtStatus);
mLayoutControls = (RelativeLayout)findViewById(R.id.layoutControls);
mLayoutStatus = (FrameLayout)findViewById(R.id.layoutStatus);
mLoadingPanel = (RelativeLayout)findViewById(R.id.loadingPanel);
mProgressBarConnecting = (ProgressBar)findViewById(R.id.progressBarConnecting);
}
});
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
mSettings = new WearSettings();
mSettings.loadFromPreferences(this, PreferenceManager.getDefaultSharedPreferences(this));
mThumbsCacheDirectory = ThumbCache.getThumbCacheFolderFile(this);
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
WatchDataLayerListenerService.disable(getApplicationContext());
}
示例15: onCreate
import android.support.wearable.view.WatchViewStub; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_favourites);
initGoogleApiClient();
/* Add the MessageListener. */
Wearable.MessageApi.addListener(googleApiClient, this);
retrieveDeviceNodeAndSendRequestToHost(REQUEST_FETCH_FAVOURITES);
/* Load the screen shape from shared preferences. */
shape = Preferences.loadScreenShape(getApplicationContext());
stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub watchViewStub) {
ImageButton imageButtonFavouritesNoneSelected =
(ImageButton) findViewById(R.id.imagebutton_favourites_none_selected);
imageButtonFavouritesNoneSelected.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
/*
* When the user taps the button, request the host device to open its app.
*/
retrieveDeviceNodeAndSendRequestToHost(REQUEST_OPEN_MOBILE_APP);
/* Inform the user the mobile app is opening. */
Toast.makeText(
getApplicationContext(),
getResources().getString(
R.string.favourites_opening_mobile
),
Toast.LENGTH_LONG
).show();
/* No point in leaving this Activity open. Finish up. */
finish();
}
});
}
});
}