package kr.co.hanwha.hifive.screen.common;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import kr.co.hanwha.hifive.R;
import kr.co.hanwha.hifive.base.BaseActivity;
import kr.co.hanwha.hifive.data.model.NotificationData;
import kr.co.hanwha.hifive.enums.BaseAnimationType;
import kr.co.hanwha.hifive.enums.BaseToolbarType;
import kr.co.hanwha.hifive.util.HFInfoUtil;
import kr.co.hanwha.hifive.util.HFNotiUtil;

/**
 * Created by sanghoonkwon on 2018. 2. 9..
 */

public class NotificationActivity extends BaseActivity {
    private NotificationData mData;

    @Override
    protected int getContentViewResource() {
        return R.layout.activity_notification;
    }

    @Override
    protected BaseToolbarType isToolbarStyle() {
        return null;
    }

    @Override
    protected BaseAnimationType isShowActivityAnimation() {
        return BaseAnimationType.FADE;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        TextView textViewTitle = (TextView) findViewById(R.id.title_textView);
        TextView textViewMessage = (TextView) findViewById(R.id.message_textView);

        mData = HFInfoUtil.getNotificationData(this);

        if (mData != null) {
            textViewTitle.setText(mData.getTitle());
            textViewMessage.setText(mData.getMessage());
        }

        findViewById(R.id.negative_textView).setOnClickListener(onClickListener);
        findViewById(R.id.positive_textView).setOnClickListener(onClickListener);
        findViewById(R.id.close_imageButton).setOnClickListener(onClickListener);
    }

    /**************************************************
     * Callback
     **************************************************/
    View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            {
                switch (v.getId()) {
                    case R.id.positive_textView:
                        HFNotiUtil.pendingNotification(NotificationActivity.this, mData);
                        break;
                    case R.id.negative_textView:
                        break;
                    case R.id.close_imageButton:
                        break;
                }
                finish();
            }
        }
    };
}
