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


Java WatchViewStub.setOnLayoutInflatedListener方法代码示例

本文整理汇总了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();
}
 
开发者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_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

示例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);
}
 
开发者ID:MatejVancik,项目名称:amaroKontrol,代码行数:10,代码来源:ControlActivity.java

示例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();
        }
    });

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

示例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);
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:13,代码来源:MainWearActivity.java

示例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();
}
 
开发者ID:jordond,项目名称:powerhour,代码行数:29,代码来源:GameActivity.java

示例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;
}
 
开发者ID:fython,项目名称:LuSpeed,代码行数:10,代码来源:MainFragment.java

示例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;
}
 
开发者ID:fython,项目名称:LuSpeed,代码行数:12,代码来源:AboutFragment.java

示例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);
}
 
开发者ID:AlexKorovyansky,项目名称:WearPomodoro,代码行数:10,代码来源:BasePomodoroActivity.java

示例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();
}
 
开发者ID:m-philipp,项目名称:AndroidSensorLogger,代码行数:29,代码来源:Annotate.java

示例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);
    }
  });
}
 
开发者ID:contentful-graveyard,项目名称:cma-cookies-demo,代码行数:14,代码来源:MainActivity.java

示例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));
    }
  });
}
 
开发者ID:contentful-graveyard,项目名称:cma-cookies-demo,代码行数:14,代码来源:CookieActivity.java

示例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());
}
 
开发者ID:hmrs-cr,项目名称:android-wear-gopro-remote,代码行数:38,代码来源:WatchMainActivity.java

示例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();
                }
            });
        }
    });
}
 
开发者ID:thecosmicfrog,项目名称:LuasataGlance,代码行数:48,代码来源:FavouritesActivity.java


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