Search in sources :

Example 56 with RelativeLayout

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);
}
Also used : Context(android.content.Context) IntentFilter(android.content.IntentFilter) Button(android.widget.Button) RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) LineChartView(lecho.lib.hellocharts.view.LineChartView) WatchViewStub(android.support.wearable.view.WatchViewStub) LinearLayout(android.widget.LinearLayout)

Example 57 with RelativeLayout

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);
}
Also used : Context(android.content.Context) IntentFilter(android.content.IntentFilter) Button(android.widget.Button) RelativeLayout(android.widget.RelativeLayout) TextView(android.widget.TextView) LineChartView(lecho.lib.hellocharts.view.LineChartView) WatchViewStub(android.support.wearable.view.WatchViewStub) LinearLayout(android.widget.LinearLayout)

Example 58 with RelativeLayout

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);
    }
}
Also used : RelativeLayout(android.widget.RelativeLayout) RadioButton(android.widget.RadioButton) View(android.view.View)

Example 59 with RelativeLayout

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);
    }
}
Also used : RelativeLayout(android.widget.RelativeLayout) RadioButton(android.widget.RadioButton) View(android.view.View)

Example 60 with RelativeLayout

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);
    }
}
Also used : RelativeLayout(android.widget.RelativeLayout) RadioButton(android.widget.RadioButton) View(android.view.View)

Aggregations

RelativeLayout (android.widget.RelativeLayout)396 TextView (android.widget.TextView)180 View (android.view.View)164 ImageView (android.widget.ImageView)109 LinearLayout (android.widget.LinearLayout)67 ViewGroup (android.view.ViewGroup)61 Intent (android.content.Intent)31 AdapterView (android.widget.AdapterView)29 Button (android.widget.Button)29 FrameLayout (android.widget.FrameLayout)28 SuppressLint (android.annotation.SuppressLint)26 LayoutInflater (android.view.LayoutInflater)22 OnClickListener (android.view.View.OnClickListener)22 ScrollView (android.widget.ScrollView)22 Paint (android.graphics.Paint)20 CardView (android.support.v7.widget.CardView)19 Context (android.content.Context)18 Point (android.graphics.Point)18 ListView (android.widget.ListView)18 RadioButton (android.widget.RadioButton)17