package com.sliit.smartserviceassistant;

import android.content.Intent;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;

public class Prediction extends AppCompatActivity {

    private ProgressBar progressBar;
    private TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_prediction);



        View test1View = findViewById(R.id.includepredictedSugestions);
        test1View.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                startActivityForResult(new Intent(Prediction.this,predicted_suggestions.class), 0);
            }
        });

        View test2View = findViewById(R.id.includepredicted_mileage);
        test2View.setOnClickListener(new View.OnClickListener(){
            @Override
            public void onClick(View v){
                startActivityForResult(new Intent(Prediction.this,PredictedMileage.class), 0);
            }
        });


        int cal=10000;
        PredictedMileage classc = new PredictedMileage();
        int cal2=classc.cal2;
        System.out.println(cal2);

        float calfinal=((float)cal2/(float)cal);
        System.out.println(calfinal);
         float calfinal1=  (float)calfinal*(float)100;
        System.out.println(calfinal1);
         int calfinal3=Math.round(calfinal1);
        System.out.println(calfinal3);
        progressBar=findViewById(R.id.progress_bar);
        textView=findViewById(R.id.textView2);
        progressBar.setProgress(calfinal3);
        textView.setText(calfinal3+"%");



    }
}