aboutsummaryrefslogtreecommitdiff
path: root/apps/tv/SetupValidation/app/src/main/java/com/google/android/tv/setup/BaseActivity.java
blob: d369192de730a678f86ad15d10dcae299757c0f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.google.android.tv.setup;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.google.android.tv.setup.validation.R;

import java.text.SimpleDateFormat;
import java.util.Date;

public abstract class BaseActivity extends Activity {

    protected ImageView iv0;
    protected Button btn0;
    protected TextView tv0;
    protected TextView tv1;
    protected TextView tv2;
    protected TextView tv3;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base_layout);

        iv0 = (ImageView)findViewById(R.id.image0);
        btn0 = (Button)findViewById(R.id.btn0);
        tv0 = (TextView)findViewById(R.id.tv0);
        tv1 = (TextView)findViewById(R.id.tv1);
        tv2 = (TextView)findViewById(R.id.tv2);
        tv3 = (TextView)findViewById(R.id.tv3);

        tv0.setText(getTitle());

        SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
        Date now = new Date();
        String strDate = sdf.format(now);
        tv1.setText(strDate);

        boolean movingForward = getIntent().getBooleanExtra("movingForward", true);
        tv2.setText("movingForward: " + movingForward);
    }

    protected void log(String message) {
        Log.d(getPackageName(), message);
    }
}