Search in sources :

Example 1 with LineChartView

use of lecho.lib.hellocharts.view.LineChartView in project CoCoin by Nightonke.

the class ShowActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_show);
    mContext = this;
    title = (TextView) findViewById(R.id.title);
    CoCoinUtil.init(mContext);
    title.setTypeface(CoCoinUtil.typefaceLatoLight);
    title.setText(mContext.getResources().getString(R.string.app_name));
    mViewPager = (SCViewPager) findViewById(R.id.viewpager_main_activity);
    mDotsView = (DotsView) findViewById(R.id.dotsview_main);
    mDotsView.setDotRessource(R.drawable.dot_selected, R.drawable.dot_unselected);
    mDotsView.setNumberOfPage(NUM_PAGES);
    mPageAdapter = new SCViewPagerAdapter(getSupportFragmentManager());
    mPageAdapter.setNumberOfPage(NUM_PAGES);
    mPageAdapter.setFragmentBackgroundColor(R.color.my_blue);
    mViewPager.setAdapter(mPageAdapter);
    mViewPager.setOverScrollMode(View.OVER_SCROLL_NEVER);
    mViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {

        @Override
        public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        }

        @Override
        public void onPageSelected(int position) {
            mDotsView.selectDot(position);
        }

        @Override
        public void onPageScrollStateChanged(int state) {
        }
    });
    final Point size = SCViewAnimationUtil.getDisplaySize(this);
    int iconOffsetX = CoCoinUtil.getInstance().dpToPx(28);
    int iconOffsetY = CoCoinUtil.getInstance().dpToPx(28);
    SCViewAnimation sc0 = new SCViewAnimation(findViewById(R.id.icon_4));
    sc0.startToPosition(size.x / 4 - iconOffsetX, size.y * 2 / 7 - iconOffsetY);
    sc0.addPageAnimation(new SCPositionAnimation(this, 0, 0, size.y));
    mViewPager.addAnimation(sc0);
    SCViewAnimation sc1 = new SCViewAnimation(findViewById(R.id.icon_11));
    sc1.startToPosition(size.x * 3 / 4 - iconOffsetX, size.y * 3 / 7 - iconOffsetY);
    sc1.addPageAnimation(new SCPositionAnimation(this, 0, -size.x, 0));
    mViewPager.addAnimation(sc1);
    SCViewAnimation sc2 = new SCViewAnimation(findViewById(R.id.icon_12));
    sc2.startToPosition(size.x / 4 - iconOffsetX, size.y * 4 / 7 - iconOffsetY);
    sc2.addPageAnimation(new SCPositionAnimation(this, 0, size.x, 0));
    mViewPager.addAnimation(sc2);
    SCViewAnimation sc3 = new SCViewAnimation(findViewById(R.id.icon_19));
    sc3.startToPosition(size.x * 3 / 4 - iconOffsetX, size.y * 5 / 7 - iconOffsetY);
    sc3.addPageAnimation(new SCPositionAnimation(this, 0, 0, -size.y));
    mViewPager.addAnimation(sc3);
    ((TextView) findViewById(R.id.text_0)).setTypeface(CoCoinUtil.getInstance().typefaceLatoLight);
    SCViewAnimation sc4 = new SCViewAnimation(findViewById(R.id.text_0));
    sc4.addPageAnimation(new SCPositionAnimation(this, 0, -size.x, 0));
    mViewPager.addAnimation(sc4);
    PieChartView pie = (PieChartView) findViewById(R.id.pie);
    List<SliceValue> values = new ArrayList<SliceValue>();
    for (int i = 0; i < 5; ++i) {
        SliceValue sliceValue = new SliceValue((float) Math.random() * 30 + 15, ContextCompat.getColor(CoCoinApplication.getAppContext(), R.color.white));
        values.add(sliceValue);
    }
    PieChartData pieData = new PieChartData(values);
    pieData.setHasLabels(false);
    pieData.setHasLabelsOnlyForSelected(false);
    pieData.setHasLabelsOutside(false);
    pieData.setHasCenterCircle(true);
    pie.setPieChartData(pieData);
    pie.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    SCViewAnimation sc5 = new SCViewAnimation(pie);
    sc5.startToPosition(size.x / 2, size.y / 9 - size.y);
    sc5.addPageAnimation(new SCPositionAnimation(this, 0, 0, size.y));
    sc5.addPageAnimation(new SCPositionAnimation(this, 1, 0, size.y));
    mViewPager.addAnimation(sc5);
    LineChartView line = (LineChartView) findViewById(R.id.line);
    List<Line> lines = new ArrayList<Line>();
    for (int i = 0; i < 1; ++i) {
        List<PointValue> pointValues = new ArrayList<PointValue>();
        pointValues.add(new PointValue(0, 50));
        pointValues.add(new PointValue(1, 100));
        pointValues.add(new PointValue(2, 20));
        pointValues.add(new PointValue(3, 0));
        pointValues.add(new PointValue(4, 10));
        pointValues.add(new PointValue(5, 15));
        pointValues.add(new PointValue(6, 40));
        pointValues.add(new PointValue(7, 60));
        pointValues.add(new PointValue(8, 100));
        Line aLine = new Line(pointValues);
        aLine.setColor(ContextCompat.getColor(CoCoinApplication.getAppContext(), R.color.white));
        aLine.setShape(ValueShape.CIRCLE);
        aLine.setCubic(false);
        aLine.setFilled(false);
        aLine.setHasLabels(false);
        aLine.setHasLabelsOnlyForSelected(false);
        aLine.setHasLines(true);
        aLine.setHasPoints(true);
        lines.add(aLine);
    }
    LineChartData linedata = new LineChartData(lines);
    linedata.setBaseValue(Float.NEGATIVE_INFINITY);
    line.setLineChartData(linedata);
    line.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    SCViewAnimation sc6 = new SCViewAnimation(line);
    sc6.startToPosition(-size.x, null);
    sc6.addPageAnimation(new SCPositionAnimation(this, 0, size.x, 0));
    sc6.addPageAnimation(new SCPositionAnimation(this, 1, size.x, 0));
    mViewPager.addAnimation(sc6);
    ColumnChartView histogram = (ColumnChartView) findViewById(R.id.histogram);
    List<Column> columns = new ArrayList<Column>();
    List<SubcolumnValue> subcolumnValues;
    for (int i = 0; i < 5; ++i) {
        subcolumnValues = new ArrayList<SubcolumnValue>();
        for (int j = 0; j < 1; ++j) {
            subcolumnValues.add(new SubcolumnValue((float) Math.random() * 50f + 5, ContextCompat.getColor(CoCoinApplication.getAppContext(), R.color.white)));
        }
        Column column = new Column(subcolumnValues);
        column.setHasLabels(false);
        column.setHasLabelsOnlyForSelected(false);
        columns.add(column);
    }
    ColumnChartData histogramData = new ColumnChartData(columns);
    histogram.setColumnChartData(histogramData);
    histogram.setContainerScrollEnabled(true, ContainerScrollType.HORIZONTAL);
    SCViewAnimation sc7 = new SCViewAnimation(histogram);
    sc7.startToPosition(size.x / 2 - CoCoinUtil.getInstance().dpToPx(140), size.y * 8 / 9 - CoCoinUtil.getInstance().dpToPx(140) + size.y);
    sc7.addPageAnimation(new SCPositionAnimation(this, 0, 0, -size.y));
    sc7.addPageAnimation(new SCPositionAnimation(this, 1, 0, size.y));
    mViewPager.addAnimation(sc7);
    ((TextView) findViewById(R.id.text_1)).setTypeface(CoCoinUtil.getInstance().typefaceLatoLight);
    SCViewAnimation sc8 = new SCViewAnimation(findViewById(R.id.text_1));
    sc8.startToPosition(size.x, null);
    sc8.addPageAnimation(new SCPositionAnimation(this, 0, -size.x, 0));
    sc8.addPageAnimation(new SCPositionAnimation(this, 1, -size.x, 0));
    mViewPager.addAnimation(sc8);
    SCViewAnimation sc9 = new SCViewAnimation(findViewById(R.id.cloud));
    sc9.startToPosition(size.x / 2 - CoCoinUtil.getInstance().dpToPx(100) + size.x, size.y / 7);
    sc9.addPageAnimation(new SCPositionAnimation(this, 1, -size.x, 0));
    sc9.addPageAnimation(new SCPositionAnimation(this, 2, 0, size.y));
    mViewPager.addAnimation(sc9);
    SCViewAnimation sc10 = new SCViewAnimation(findViewById(R.id.mobile));
    sc10.startToPosition(size.x / 2 - size.x, size.y * 6 / 7 - CoCoinUtil.getInstance().dpToPx(100));
    sc10.addPageAnimation(new SCPositionAnimation(this, 1, size.x, 0));
    sc10.addPageAnimation(new SCPositionAnimation(this, 2, 0, -size.y));
    mViewPager.addAnimation(sc10);
    ((TextView) findViewById(R.id.text_2)).setTypeface(CoCoinUtil.getInstance().typefaceLatoLight);
    SCViewAnimation sc11 = new SCViewAnimation(findViewById(R.id.text_2));
    sc11.startToPosition(size.x, null);
    sc11.addPageAnimation(new SCPositionAnimation(this, 1, -size.x, 0));
    sc11.addPageAnimation(new SCPositionAnimation(this, 2, -size.x, 0));
    mViewPager.addAnimation(sc11);
    ImageView remind1 = (ImageView) findViewById(R.id.remind_1);
    remind1.getLayoutParams().width = size.x / 3;
    remind1.getLayoutParams().height = size.x / 3 * 653 / 320;
    SCViewAnimation sc12 = new SCViewAnimation(findViewById(R.id.remind_1));
    sc12.startToPosition(size.x / 2 - size.x, size.y / 11);
    sc12.addPageAnimation(new SCPositionAnimation(this, 2, size.x, 0));
    sc12.addPageAnimation(new SCPositionAnimation(this, 3, size.x, 0));
    mViewPager.addAnimation(sc12);
    ImageView remind2 = (ImageView) findViewById(R.id.remind_2);
    remind2.getLayoutParams().width = size.x / 3;
    remind2.getLayoutParams().height = size.x / 3 * 653 / 320;
    SCViewAnimation sc13 = new SCViewAnimation(findViewById(R.id.remind_2));
    sc13.startToPosition(size.x / 2 + size.x - size.x / 3, size.y * 10 / 11 - remind1.getLayoutParams().height);
    sc13.addPageAnimation(new SCPositionAnimation(this, 2, -size.x, 0));
    sc13.addPageAnimation(new SCPositionAnimation(this, 3, -size.x, 0));
    mViewPager.addAnimation(sc13);
    ((TextView) findViewById(R.id.text_3)).setTypeface(CoCoinUtil.getInstance().typefaceLatoLight);
    SCViewAnimation sc14 = new SCViewAnimation(findViewById(R.id.text_3));
    sc14.startToPosition(size.x, null);
    sc14.addPageAnimation(new SCPositionAnimation(this, 2, -size.x, 0));
    sc14.addPageAnimation(new SCPositionAnimation(this, 3, -size.x, 0));
    mViewPager.addAnimation(sc14);
    View statusBar = findViewById(R.id.status_bar);
    statusBar.setLayoutParams(new RelativeLayout.LayoutParams(statusBar.getLayoutParams().width, getStatusBarHeight()));
    SCViewAnimation statusBarAnimation = new SCViewAnimation(statusBar);
    statusBarAnimation.startToPosition(null, -getStatusBarHeight());
    statusBarAnimation.addPageAnimation(new SCPositionAnimation(this, 3, 0, getStatusBarHeight()));
    mViewPager.addAnimation(statusBarAnimation);
    toolbarLayout = findViewById(R.id.toolbar_layout);
    SCViewAnimation toolbarLayoutAnimation = new SCViewAnimation(toolbarLayout);
    toolbarLayoutAnimation.startToPosition(null, -size.y / 2);
    toolbarLayoutAnimation.addPageAnimation(new SCPositionAnimation(this, 3, 0, size.y / 2));
    mViewPager.addAnimation(toolbarLayoutAnimation);
    passwordAdapter = new PasswordChangeFragmentAdapter(getSupportFragmentManager());
    viewPager = (ViewPager) findViewById(R.id.viewpager);
    viewPager.setScrollBarFadeDuration(700);
    viewPager.setAdapter(passwordAdapter);
    myGridView = (MyGridView) findViewById(R.id.gridview);
    myGridViewAdapter = new PasswordChangeButtonGridViewAdapter(this);
    myGridView.setAdapter(myGridViewAdapter);
    myGridView.setOnItemClickListener(gridViewClickListener);
    myGridView.setOnItemLongClickListener(gridViewLongClickListener);
    myGridView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {

        @Override
        public void onGlobalLayout() {
            myGridView.getViewTreeObserver().removeGlobalOnLayoutListener(this);
            View lastChild = myGridView.getChildAt(myGridView.getChildCount() - 1);
            RelativeLayout.LayoutParams relativeLayout = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, lastChild.getBottom());
            relativeLayout.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
            myGridView.setLayoutParams(relativeLayout);
            DisplayMetrics displaymetrics = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
            int height = displaymetrics.heightPixels;
            RelativeLayout.LayoutParams viewPagerLayoutParams = new RelativeLayout.LayoutParams(viewPager.getLayoutParams().width, 800);
            viewPagerLayoutParams.topMargin = getStatusBarHeight() + CoCoinUtil.getToolBarHeight(mContext) / 2;
            viewPager.setLayoutParams(viewPagerLayoutParams);
        }
    });
    superToast = new SuperToast(this);
    SCViewAnimation gridViewAnimation = new SCViewAnimation(myGridView);
    gridViewAnimation.startToPosition(null, size.y);
    gridViewAnimation.addPageAnimation(new SCPositionAnimation(this, 3, 0, -size.y));
    mViewPager.addAnimation(gridViewAnimation);
    SCViewAnimation viewpagerAnimation = new SCViewAnimation(viewPager);
    viewpagerAnimation.startToPosition(null, -size.y);
    viewpagerAnimation.addPageAnimation(new SCPositionAnimation(this, 3, 0, size.y));
    mViewPager.addAnimation(viewpagerAnimation);
    View background = findViewById(R.id.background);
    SCViewAnimation backgroundAnimation = new SCViewAnimation(background);
    backgroundAnimation.startToPosition(null, -size.y - 100);
    backgroundAnimation.addPageAnimation(new SCPositionAnimation(this, 3, 0, size.y + 100));
    mViewPager.addAnimation(backgroundAnimation);
}
Also used : SuperToast(com.github.johnpersano.supertoasts.SuperToast) ArrayList(java.util.ArrayList) SliceValue(lecho.lib.hellocharts.model.SliceValue) SCViewPagerAdapter(com.dev.sacot41.scviewpager.SCViewPagerAdapter) DisplayMetrics(android.util.DisplayMetrics) PasswordChangeButtonGridViewAdapter(com.nightonke.saver.adapter.PasswordChangeButtonGridViewAdapter) Column(lecho.lib.hellocharts.model.Column) LineChartData(lecho.lib.hellocharts.model.LineChartData) SubcolumnValue(lecho.lib.hellocharts.model.SubcolumnValue) TextView(android.widget.TextView) LineChartView(lecho.lib.hellocharts.view.LineChartView) ImageView(android.widget.ImageView) ViewTreeObserver(android.view.ViewTreeObserver) SCViewAnimation(com.dev.sacot41.scviewpager.SCViewAnimation) PointValue(lecho.lib.hellocharts.model.PointValue) PieChartView(lecho.lib.hellocharts.view.PieChartView) PieChartData(lecho.lib.hellocharts.model.PieChartData) Point(android.graphics.Point) SCViewPager(com.dev.sacot41.scviewpager.SCViewPager) ViewPager(android.support.v4.view.ViewPager) ImageView(android.widget.ImageView) View(android.view.View) MyGridView(com.nightonke.saver.ui.MyGridView) PieChartView(lecho.lib.hellocharts.view.PieChartView) AdapterView(android.widget.AdapterView) DotsView(com.dev.sacot41.scviewpager.DotsView) TextView(android.widget.TextView) LineChartView(lecho.lib.hellocharts.view.LineChartView) ColumnChartView(lecho.lib.hellocharts.view.ColumnChartView) Point(android.graphics.Point) Line(lecho.lib.hellocharts.model.Line) PasswordChangeFragmentAdapter(com.nightonke.saver.adapter.PasswordChangeFragmentAdapter) SCPositionAnimation(com.dev.sacot41.scviewpager.SCPositionAnimation) RelativeLayout(android.widget.RelativeLayout) ColumnChartData(lecho.lib.hellocharts.model.ColumnChartData) ColumnChartView(lecho.lib.hellocharts.view.ColumnChartView)

Example 2 with LineChartView

use of lecho.lib.hellocharts.view.LineChartView 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 3 with LineChartView

use of lecho.lib.hellocharts.view.LineChartView in project xDrip by NightscoutFoundation.

the class ExampleChartPreferenceView method refreshView.

protected void refreshView(View view) {
    LineChartView chart = (LineChartView) view.findViewById(R.id.example_linechart);
    BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getContext());
    chart.setLineChartData(bgGraphBuilder.lineData());
    Viewport viewport = chart.getMaximumViewport();
    chart.setViewportCalculationEnabled(false);
    chart.setInteractive(false);
    chart.setCurrentViewport(viewport);
    chart.setPadding(0, 0, 0, 0);
    chart.setLeft(0);
    chart.setTop(0);
    Log.d(TAG, "onBindExampleChart: refreshview " + chart.getHeight());
}
Also used : Viewport(lecho.lib.hellocharts.model.Viewport) LineChartView(lecho.lib.hellocharts.view.LineChartView) BgGraphBuilder(com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder)

Example 4 with LineChartView

use of lecho.lib.hellocharts.view.LineChartView in project xDrip-plus by jamorham.

the class ExampleChartPreferenceView method refreshView.

protected void refreshView(View view) {
    LineChartView chart = (LineChartView) view.findViewById(R.id.example_linechart);
    BgGraphBuilder bgGraphBuilder = new BgGraphBuilder(getContext());
    chart.setLineChartData(bgGraphBuilder.lineData());
    Viewport viewport = chart.getMaximumViewport();
    chart.setViewportCalculationEnabled(false);
    chart.setInteractive(false);
    chart.setCurrentViewport(viewport);
    chart.setPadding(0, 0, 0, 0);
    chart.setLeft(0);
    chart.setTop(0);
    Log.d(TAG, "onBindExampleChart: refreshview " + chart.getHeight());
}
Also used : Viewport(lecho.lib.hellocharts.model.Viewport) LineChartView(lecho.lib.hellocharts.view.LineChartView) BgGraphBuilder(com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder)

Example 5 with LineChartView

use of lecho.lib.hellocharts.view.LineChartView 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)

Aggregations

LineChartView (lecho.lib.hellocharts.view.LineChartView)8 TextView (android.widget.TextView)6 RelativeLayout (android.widget.RelativeLayout)5 Context (android.content.Context)4 IntentFilter (android.content.IntentFilter)4 WatchViewStub (android.support.wearable.view.WatchViewStub)4 Button (android.widget.Button)4 LinearLayout (android.widget.LinearLayout)4 View (android.view.View)2 ImageView (android.widget.ImageView)2 BgGraphBuilder (com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder)2 ArrayList (java.util.ArrayList)2 Viewport (lecho.lib.hellocharts.model.Viewport)2 ColumnChartView (lecho.lib.hellocharts.view.ColumnChartView)2 ColorStateList (android.content.res.ColorStateList)1 Point (android.graphics.Point)1 ViewPager (android.support.v4.view.ViewPager)1 DisplayMetrics (android.util.DisplayMetrics)1 MenuItem (android.view.MenuItem)1 ViewTreeObserver (android.view.ViewTreeObserver)1