package cc.winboll.studio.mymessagemanager.activitys;

/**
 * @Author ZhanGSKen@QQ.COM
 * @Date 2024/07/14 13:20:33
 * @Describe 应用关于对话窗口
 */
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import androidx.appcompat.widget.Toolbar;
import cc.winboll.studio.mymessagemanager.R;
import cc.winboll.studio.shared.app.WinBollActivity;
import cc.winboll.studio.shared.app.WinBollActivityManager;
import com.hjq.toast.ToastUtils;
import cc.winboll.studio.libaes.utils.AESThemeUtil;
import android.content.Context;

final public class AboutActivity extends WinBollActivity {

    public static final String TAG = "AboutActivity";

    Context mContext;
    
    @Override
    public String getTag() {
        return TAG;
    }

    @Override
    protected boolean isEnableDisplayHomeAsUp() {
        return false;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setTheme(AESThemeUtil.getThemeTypeID(getApplicationContext()));
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
        mContext = getApplicationContext();
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        setTitle(mContext.getString(R.string.text_about) + mContext.getString(R.string.app_name));
    }

    @Override
    protected boolean isAddWinBollToolBar() {
        return false;
    }

    @Override
    protected Toolbar initToolBar() {
        return findViewById(R.id.activityaboutASupportToolbar1);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.toolbar_about, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        /*if (item.getItemId() == R.id.item_help) {
            ToastUtils.show("R.id.item_help");
        } else */if (item.getItemId() == android.R.id.home) {
            WinBollActivityManager.getInstance(getApplicationContext()).finish(this);
        }
        return super.onOptionsItemSelected(item);
    }
}
