package cc.winboll.studio.webpagesources.activities;

/**
 * @Author ZhanGSKen@QQ.COM
 * @Date 2024/07/14 13:20:33
 * @Describe AboutFragment Test
 */
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;
import cc.winboll.studio.webpagesources.R;
import com.hjq.toast.ToastUtils;

final public class AboutActivity extends AppCompatActivity implements IWinBoLLActivity {

    public static final String TAG = "AboutActivity";

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

    @Override
    public Activity getActivity() {
        return this;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about);
    }

    @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) {
            GlobalApplication.getWinBoLLActivityManager().getInstance().finish(this);
        }
        return super.onOptionsItemSelected(item);
    }
}
