use of android.widget.RelativeLayout in project xDrip by NightscoutFoundation.
the class BaseWatchFace method performViewSetup.
public void performViewSetup() {
final WatchViewStub stub = (WatchViewStub) layoutView.findViewById(R.id.watch_view_stub);
IntentFilter messageFilter = new IntentFilter(Intent.ACTION_SEND);
messageReceiver = new MessageReceiver();
localBroadcastManager = LocalBroadcastManager.getInstance(this);
localBroadcastManager.registerReceiver(messageReceiver, messageFilter);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
mTime = (TextView) stub.findViewById(R.id.watch_time);
mDate = (TextView) stub.findViewById(R.id.watch_date);
mSgv = (TextView) stub.findViewById(R.id.sgv);
mDirection = (TextView) stub.findViewById(R.id.direction);
mTimestamp = (TextView) stub.findViewById(R.id.timestamp);
mStatus = (TextView) stub.findViewById(R.id.externaltstatus);
mRaw = (TextView) stub.findViewById(R.id.raw);
mUploaderBattery = (TextView) stub.findViewById(R.id.uploader_battery);
mUploaderXBattery = (TextView) stub.findViewById(R.id.uploader_xbattery);
mDelta = (TextView) stub.findViewById(R.id.delta);
stepsButton = (Button) stub.findViewById(R.id.walkButton);
try {
heartButton = (Button) stub.findViewById(R.id.heartButton);
} catch (Exception e) {
//
}
mStepsLinearLayout = (LinearLayout) stub.findViewById(R.id.steps_layout);
menuButton = (Button) stub.findViewById(R.id.menuButton);
mMenuLinearLayout = (LinearLayout) stub.findViewById(R.id.menu_layout);
mRelativeLayout = (RelativeLayout) stub.findViewById(R.id.main_layout);
mLinearLayout = (LinearLayout) stub.findViewById(R.id.secondary_layout);
mDirectionDelta = (LinearLayout) stub.findViewById(R.id.directiondelta_layout);
setSmallFontsize(false);
chart = (LineChartView) stub.findViewById(R.id.chart);
layoutSet = true;
Context context = xdrip.getAppContext();
if (Home.get_forced_wear()) {
if (d)
Log.d(TAG, "performViewSetup FORCE WEAR init BGs for graph");
BgSendQueue.resendData(context);
}
if ((chart != null) && sharedPrefs.getBoolean("show_wear_treatments", false)) {
if (d)
Log.d(TAG, "performViewSetup init Treatments for graph");
ListenerService.showTreatments(context, "all");
}
showAgoRawBattStatus();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), mRelativeLayout.getMeasuredHeight());
showSteps();
showHeartRate();
}
});
Log.d(TAG, "performViewSetup requestData");
ListenerService.requestData(this);
wakeLock.acquire(50);
}
use of android.widget.RelativeLayout in project xDrip-plus by jamorham.
the class BIGChart method performViewSetup.
public void performViewSetup() {
final WatchViewStub stub = (WatchViewStub) layoutView.findViewById(R.id.watch_view_stub);
IntentFilter messageFilter = new IntentFilter(Intent.ACTION_SEND);
messageReceiver = new MessageReceiver();
localBroadcastManager = LocalBroadcastManager.getInstance(this);
localBroadcastManager.registerReceiver(messageReceiver, messageFilter);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
mTime = (TextView) stub.findViewById(R.id.watch_time);
mDate = (TextView) stub.findViewById(R.id.watch_date);
mSgv = (TextView) stub.findViewById(R.id.sgv);
mTimestamp = (TextView) stub.findViewById(R.id.timestamp);
mDelta = (TextView) stub.findViewById(R.id.delta);
mRelativeLayout = (RelativeLayout) stub.findViewById(R.id.main_layout);
chart = (LineChartView) stub.findViewById(R.id.chart);
statusView = (TextView) stub.findViewById(R.id.aps_status);
stepsButton = (Button) stub.findViewById(R.id.walkButton);
mStepsLinearLayout = (LinearLayout) stub.findViewById(R.id.steps_layout);
menuButton = (Button) stub.findViewById(R.id.menuButton);
mMenuLinearLayout = (LinearLayout) stub.findViewById(R.id.menu_layout);
mDirectionDelta = (LinearLayout) stub.findViewById(R.id.directiondelta_layout);
layoutSet = true;
Context context = xdrip.getAppContext();
if (Home.get_forced_wear()) {
if (d)
Log.d(TAG, "performViewSetup FORCE WEAR init BGs for graph");
BgSendQueue.resendData(context);
}
if ((chart != null) && sharedPrefs.getBoolean("show_wear_treatments", false)) {
if (d)
Log.d(TAG, "performViewSetup init Treatments for graph");
ListenerService.showTreatments(context, "all");
}
showAgeAndStatus();
mRelativeLayout.measure(specW, specH);
mRelativeLayout.layout(0, 0, mRelativeLayout.getMeasuredWidth(), mRelativeLayout.getMeasuredHeight());
}
});
Log.d(TAG, "performViewSetup requestData");
ListenerService.requestData(this);
wakeLock.acquire(50);
}
use of android.widget.RelativeLayout in project android_packages_apps_Settings by omnirom.
the class ApnPreference method onBindViewHolder.
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
View widget = view.findViewById(R.id.apn_radiobutton);
if ((widget != null) && widget instanceof RadioButton) {
RadioButton rb = (RadioButton) widget;
if (mSelectable) {
rb.setOnCheckedChangeListener(this);
boolean isChecked = getKey().equals(mSelectedKey);
if (isChecked) {
mCurrentChecked = rb;
mSelectedKey = getKey();
}
mProtectFromCheckedChange = true;
rb.setChecked(isChecked);
mProtectFromCheckedChange = false;
rb.setVisibility(View.VISIBLE);
} else {
rb.setVisibility(View.GONE);
}
}
View textLayout = view.findViewById(R.id.text_layout);
if ((textLayout != null) && textLayout instanceof RelativeLayout) {
textLayout.setOnClickListener(this);
}
}
use of android.widget.RelativeLayout in project android_packages_apps_Settings by crdroidandroid.
the class ApnPreference method onBindViewHolder.
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
View widget = view.findViewById(R.id.apn_radiobutton);
if ((widget != null) && widget instanceof RadioButton) {
RadioButton rb = (RadioButton) widget;
if (mSelectable) {
rb.setOnCheckedChangeListener(this);
boolean isChecked = getKey().equals(mSelectedKey);
if (isChecked) {
mCurrentChecked = rb;
mSelectedKey = getKey();
}
mProtectFromCheckedChange = true;
rb.setChecked(isChecked);
mProtectFromCheckedChange = false;
rb.setVisibility(View.VISIBLE);
} else {
rb.setVisibility(View.GONE);
}
}
View textLayout = view.findViewById(R.id.text_layout);
if ((textLayout != null) && textLayout instanceof RelativeLayout) {
textLayout.setOnClickListener(this);
}
}
use of android.widget.RelativeLayout in project android_packages_apps_Settings by SudaMod.
the class ApnPreference method onBindViewHolder.
@Override
public void onBindViewHolder(PreferenceViewHolder view) {
super.onBindViewHolder(view);
View widget = view.findViewById(R.id.apn_radiobutton);
if ((widget != null) && widget instanceof RadioButton) {
RadioButton rb = (RadioButton) widget;
if (mSelectable) {
rb.setOnCheckedChangeListener(this);
boolean isChecked = getKey().equals(mSelectedKey);
if (isChecked) {
mCurrentChecked = rb;
mSelectedKey = getKey();
}
mProtectFromCheckedChange = true;
rb.setChecked(isChecked);
mProtectFromCheckedChange = false;
rb.setVisibility(View.VISIBLE);
} else {
rb.setVisibility(View.GONE);
}
}
View textLayout = view.findViewById(R.id.text_layout);
if ((textLayout != null) && textLayout instanceof RelativeLayout) {
textLayout.setOnClickListener(this);
}
}
Aggregations