package com.inred.match;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.SeekBar;

import com.inred.library.utils.MatchTextView;
import com.inred.matchview.R;

/**
 * <p>Title: MainActivity.java</p>
 * @author inred
 * @version 1.0 创建时间：2015-1-4 下午4:18:49
 */
public class MainActivity extends FragmentActivity{
	private SeekBar mSeekBar;
    private MatchTextView mMatchTextView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		 mMatchTextView = (MatchTextView) findViewById(R.id.mMatchTextView);
	        mSeekBar = (SeekBar) findViewById(R.id.mSeekBar);
	        mSeekBar.setProgress(100);
	        mSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
	            @Override
	            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
	                mMatchTextView.setProgress(progress * 1f / 100);
	            }

	            @Override
	            public void onStartTrackingTouch(SeekBar seekBar) {

	            }

	            @Override
	            public void onStopTrackingTouch(SeekBar seekBar) {

	            }
	        });

	        findViewById(R.id.mButton).setOnClickListener(new View.OnClickListener() {
	            @Override
	            public void onClick(View v) {
	                MatchDialog matchDialog = new MatchDialog();
	                getSupportFragmentManager().beginTransaction().add(matchDialog, "matchDialog").commit();
	            }
	        });
	    }
	}
	
