package cc.winboll.studio.midiplayer;

/**
 * @Author ZhanGSKen<zhangsken@qq.com>
 * @Date 2025/06/29 10:40
 * @Describe WinBoLLActivity
 */
import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import androidx.appcompat.app.AppCompatActivity;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.winboll.IWinBoLLActivity;

public class WinBoLLActivity extends AppCompatActivity implements IWinBoLLActivity {

    public static final String TAG = "WinBoLLActivity";

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

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

    @Override
    protected void onResume() {
        super.onResume();
        LogUtils.d(TAG, String.format("onResume %s", getTag()));
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        /*if (item.getItemId() == R.id.item_log) {
		 GlobalApplication.getWinBoLLActivityManager().startLogActivity(this);
		 return true;
		 } else if (item.getItemId() == R.id.item_home) {
		 GlobalApplication.getWinBoLLActivityManager().startWinBoLLActivity(getApplicationContext(), MainActivity.class);
		 return true;
		 }*/
        // 在switch语句中处理每个ID，并在处理完后返回true，未处理的情况返回false。
        return super.onOptionsItemSelected(item);
    }

    @Override
    protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        GlobalApplication.getWinBoLLActivityManager().add(this);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        GlobalApplication.getWinBoLLActivityManager().registeRemove(this);
    }
}
