package com.mobile.constellations.ui;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mobile.constellations.R;
import com.mobile.constellations.util.CommUtils;
import com.zdp.aseo.content.AseoZdpAseo;

public class ConsContentActivity extends Activity {

	public static String CONS_TXT = "consTxt";

	public static void intentConsContentActivity(Context context, String cons) {
		Intent intent = new Intent(context, ConsContentActivity.class);
		intent.putExtra(CONS_TXT, cons);
		context.startActivity(intent);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		super.onCreate(savedInstanceState);
		String cons = getIntent().getStringExtra(CONS_TXT);
		setContentView(R.layout.activity_cons_content);
		resetTitlebar();
		showAd();
		AseoZdpAseo.initType(this, AseoZdpAseo.SCREEN_TYPE);
		TextView text = (TextView) findViewById(R.id.textView1);
		text.setText(CommUtils.getFromAssets(this, cons));
	}

	private void showAd() {

	}

	private void resetTitlebar() {
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.view_comm_titlebar);
		TextView title = (TextView) findViewById(R.id.titlebar_title);
		LinearLayout back = (LinearLayout) findViewById(R.id.titlebar_left_layout);
		title.setText("星座故事会");
		back.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}

}
