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


Java BoxInsetLayout类代码示例

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


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

示例1: onCreate

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

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();

    containerView = (BoxInsetLayout) findViewById(R.id.container);

    inputImageButton = (ImageButton) findViewById(R.id.inputImageButton);
    inputImageButton.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            try {
                promptSpeechInput();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    });
}
 
开发者ID:MycroftAI,项目名称:Mycroft-Android,代码行数:26,代码来源:MainActivity.java

示例2: setupUi

import android.support.wearable.view.BoxInsetLayout; //导入依赖的package包/类
private void setupUi() {
    setContentView(R.layout.main_activity_wear);
    setAmbientEnabled();

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
    mainTextView = (TextView) findViewById(R.id.mainText);
    preTextView = (TextView) findViewById(R.id.preText);
    postTextView = (TextView) findViewById(R.id.postText);
    logTextView = (TextView) findViewById(R.id.logText);

    mContainerView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            updateStatusTexts();
        }
    });

    updateDisplay();
}
 
开发者ID:Steppschuh,项目名称:Sensor-Data-Logger,代码行数:20,代码来源:WearActivity.java

示例3: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);

    radioGroup = (RadioGroup) findViewById(R.id.radioGroupLabels);
    radioBtns[0] = (RadioButton) findViewById(R.id.radioStanding);
    radioBtns[1] = (RadioButton) findViewById(R.id.radioWalking);
    radioBtns[2] = (RadioButton) findViewById(R.id.radioRunning);
    radioBtns[3] = (RadioButton) findViewById(R.id.radioOther);

    btnDelete = (Button) findViewById(R.id.btnDeleteData);

    mState = State.IDLE;
    mFeatureFile = new File(getExternalFilesDir(null),
            Globals.FEATURE_FILE_NAME);
    mServiceIntent = new Intent(this, SensorsService.class);
}
 
开发者ID:dev-vishalgaurav,项目名称:wearable-computing,代码行数:22,代码来源:MainActivity.java

示例4: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
    mTextView = (TextView) findViewById(R.id.text);
    mClockView = (Button) findViewById(R.id.clock);
    mClockView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            sendMessage(PHONE_MESSAGE_PATH, "b " +  mTextView.getText());
        }
    });
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    initGoogleApiClient();
}
 
开发者ID:mariopce,项目名称:android-wear-bilateral-communication,代码行数:20,代码来源:WearActivity.java

示例5: onCreate

import android.support.wearable.view.BoxInsetLayout; //导入依赖的package包/类
@Override
public void onCreate(Bundle bundle) {
	super.onCreate(bundle);
	setContentView(R.layout.activity_picture_show);

	mRootView = (BoxInsetLayout) findViewById(R.id.root_layout);
	mImageView = (ImageView) findViewById(R.id.image_view);

	Intent intent = getIntent();
	if (intent.hasExtra("id")) {
		mImageView.setImageResource(intent.getIntExtra("id", -1));
	} else if (intent.hasExtra("uri")) {
		mImageView.setImageURI(Uri.parse(intent.getStringExtra("uri")));
	}
	if (intent.hasExtra("background")) {
		mRootView.setBackgroundColor(intent.getIntExtra("background", Color.WHITE));
	}
}
 
开发者ID:fython,项目名称:LuSpeed,代码行数:19,代码来源:PictureShowActivity.java

示例6: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
    mTextView = (TextView) findViewById(R.id.text);
    mClockView = (TextView) findViewById(R.id.clock);
}
 
开发者ID:Durian-Inc,项目名称:SwolyV2,代码行数:11,代码来源:MainActivity.java

示例7: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
    mTextView = (CircularSeekBar) findViewById(R.id.text);
    mClockView = (TextView) findViewById(R.id.clock);
}
 
开发者ID:akaita,项目名称:CircularSeekBar,代码行数:11,代码来源:MainActivity.java

示例8: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);

    mClockView = (TextView) findViewById(R.id.clock);

    if (askForPermission(Manifest.permission.BODY_SENSORS,1))
        initSensors();

}
 
开发者ID:cleaninsights,项目名称:cleaninsights-android-sdk,代码行数:15,代码来源:MainActivity.java

示例9: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
    mTextView = (TextView) findViewById(R.id.text);
    mClockView = (TextView) findViewById(R.id.clock);

}
 
开发者ID:ibm-wearables-sdk-for-mobile,项目名称:ibm-wearables-android-sdk,代码行数:12,代码来源:MainActivity.java

示例10: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
    mTextView = (TextView) findViewById(R.id.text);
    mClockView = (TextView) findViewById(R.id.clock);
}
 
开发者ID:PacktPublishing,项目名称:Android-High-Performance-Programming,代码行数:11,代码来源:BuildingLayoutActivity.java

示例11: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);

    // Init files
    mRawAccFile = new File(Environment.getExternalStorageDirectory(), "acc_raw.csv");
    Log.d("ACC_DATA_PATH", mRawAccFile.getAbsolutePath());
    try {
        mRawAccOutputStream = new FileOutputStream(mRawAccFile);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }

    mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
    mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_LINEAR_ACCELERATION);

    stepsView = (TextView) findViewById(R.id.stepCount);
    calorieView = (TextView) findViewById(R.id.calorieCount);
    //Set the buttons and the text accordingly
    accelButton = (ToggleButton) findViewById(R.id.StartButton);
    accelButton.setChecked(isAccelRunning);
    accelButton.setOnCheckedChangeListener(
            new CompoundButton.OnCheckedChangeListener() {
                public void onCheckedChanged(CompoundButton btn, boolean isChecked) {
                    if (!isAccelRunning) {
                        startAccelerometer();
                        accelButton.setChecked(true);
                    } else {
                        stopAccelerometer();
                        accelButton.setChecked(false);
                    }
                }
            }
    );
}
 
开发者ID:dev-vishalgaurav,项目名称:wearable-computing,代码行数:40,代码来源:MainActivity.java

示例12: onCreate

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

    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
    mTxtAudio = (TextView)findViewById(R.id.textView);

    //Set the buttons and the text accordingly
    recordButton = (Button) findViewById(R.id.RecordButton);

    recordButton.setText(MicrophoneRecorder.getInstance().isRecording() ? R.string.stop : R.string.record);
    recordButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            MicrophoneRecorder recorder = MicrophoneRecorder.getInstance();
            if (recorder.isRecording()) {
                Log.d(TAG, "stopping recording");
                recorder.stopRecording();
                recordButton.setText(R.string.record);
                mTxtAudio.setText("");
                //closeOutAudioFile();
            } else {
                Log.d(TAG, "starting recording");
                recorder.registerListener(MainActivity.this);
                recorder.startRecording();
                recordButton.setText(R.string.stop);
            }
        }
    });
}
 
开发者ID:dev-vishalgaurav,项目名称:wearable-computing,代码行数:33,代码来源:MainActivity.java

示例13: onCreate

import android.support.wearable.view.BoxInsetLayout; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    button = (ImageButton) findViewById(R.id.start_button);
    listener = new GuardDogSensorListener(this);
    listening = false;
    setAmbientEnabled();
    googleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Wearable.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();
    mContainerView = (BoxInsetLayout) findViewById(R.id.container);
}
 
开发者ID:stevex86,项目名称:HackAZ-2016,代码行数:16,代码来源:MainActivity.java

示例14: onCreate

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

    setContentView(R.layout.activity_background_selector);

    mImageResourceList = getResources().obtainTypedArray( R.array.background_resource_ids );
    mHeader = (TextView) findViewById( R.id.header );

    WearableListView listView = (WearableListView) findViewById( R.id.background_picker );
    BoxInsetLayout content = (BoxInsetLayout) findViewById( R.id.content );

    content.setOnApplyWindowInsetsListener( new View.OnApplyWindowInsetsListener() {
        @Override
        public WindowInsets onApplyWindowInsets(View v, WindowInsets insets) {
            if( !insets.isRound() ) {
                v.setPaddingRelative( (getResources().getDimensionPixelSize( R.dimen.content_padding_start ) ),
                        v.getPaddingTop(),
                        v.getPaddingEnd(),
                        v.getPaddingBottom() );
            }

            return v.onApplyWindowInsets( insets );
        }
    });

    listView.setHasFixedSize( true );
    listView.setClickListener( this );
    listView.addOnScrollListener( this );

    String[] backgrounds = getResources().getStringArray( R.array.background_array );
    listView.setAdapter( new BackgroundListAdapter( backgrounds ) );


}
 
开发者ID:Lakkichand,项目名称:AndroidDemoProjects,代码行数:36,代码来源:WatchFaceConfigActivity.java

示例15: onCreateView

import android.support.wearable.view.BoxInsetLayout; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View rootView = inflater.inflate(R.layout.heart_rate_fragment, container, false);


    heartbeat = (HeartBeatView)rootView.findViewById(R.id.heartbeat);

    mContainerView = (BoxInsetLayout)rootView.findViewById(R.id.container);
    mTextView = (TextView)rootView.findViewById(R.id.heart_rate);
    mSensorManager = ((SensorManager)getActivity().getSystemService(SENSOR_SERVICE));
    mHeartRateSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE);


    mGoogleApiClient = new GoogleApiClient.Builder(getActivity()).addApi(Wearable.API).build();
    mGoogleApiClient.connect();


    requestSensorPermission();

    return rootView;
}
 
开发者ID:PacktPublishing,项目名称:Android-Wear-Projects,代码行数:24,代码来源:HeartRateFragment.java


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