package learn.navdrawbase;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.SeekBar;
import android.widget.TextView;

public class Activity_Tag extends BaseActivity {

    private TextView textTag;
    private TextView titre;
    private SeekBar yourSeekBar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tag);

        Intent intent = getIntent();

        long id = intent.getLongExtra("id", -1);
        int position = intent.getIntExtra("position", -1);
        String titreLieu = intent.getStringExtra("titreLieu");

        titre = (TextView) findViewById(R.id.presentation);
        titre.setText(titreLieu);

        textTag = (TextView) findViewById(R.id.textTag);
        textTag.setText("Lieu moyennement fréquenté");

        yourSeekBar = (SeekBar) findViewById(R.id.seekBar);
        yourSeekBar.setOnSeekBarChangeListener(new yourListener());
    }

    private class yourListener implements SeekBar.OnSeekBarChangeListener {

        public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
            // Log the progress
            Log.d("DEBUG", "Progress is: " + progress);
            //set textView's text
            if (progress==0){
                textTag.setText("Lieu peu fréquenté");
            }
            if (progress == 1){
                textTag.setText("Lieu moyennement fréquenté");
            }
            if (progress == 2){
                textTag.setText("Lieu très fréquenté");
            }
            //textTag.setText("" + progress);
        }

        public void onStartTrackingTouch(SeekBar seekBar) {}

        public void onStopTrackingTouch(SeekBar seekBar) {}

    }

    public void taguerLieu(View v){
        //fonction pour taguer un lieu
    }

}
