导航菜单

页面标题

页面副标题

Cashalo v2.25.0.0 - NotificationSettingsActivity.java 源代码

正在查看: Cashalo v2.25.0.0 应用的 NotificationSettingsActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package finance.empower.android.app.notifications;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import finance.empower.android.app.BaseActivity;
import finance.empower.android.app.NavButton;
import finance.empower.android.app.notifications.NotificationSettingsPresenter;
import finance.empower.android.core.ui.view.ViewExtKt;
import finance.empower.android.core.ui.view.loading.FetchErrorView;
import finance.empower.android.core.ui.view.loading.FetchLoadingView;
import finance.empower.android.kotlin.extensions.content.Internals;
import finance.empower.android.view.LoadingBehavior;
import finance.empower.android.view.Presenter;
import finance.empower.ph.R;
import finance.empower.ph.databinding.ActivityNotificationSettingsBinding;
import javax.inject.Inject;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;

@Metadata(d1 = {"\u0000P\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0007\u0018\u0000 (2\u00020\u00012\u00020\u0002:\u0001(B\u0005¢\u0006\u0002\u0010\u0003J\u0012\u0010\u001d\u001a\u00020\u001e2\b\u0010\u001f\u001a\u0004\u0018\u00010 H\u0014J\b\u0010!\u001a\u00020\u001eH\u0014J\b\u0010\"\u001a\u00020\u001eH\u0014J\u0016\u0010#\u001a\u00020\u001e2\f\u0010$\u001a\b\u0012\u0004\u0012\u00020\f0%H\u0016J\u0010\u0010&\u001a\u00020\u001e2\u0006\u0010'\u001a\u00020\fH\u0002R\u001b\u0010\u0004\u001a\u00020\u00058BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\b\u0010\t\u001a\u0004\b\u0006\u0010\u0007R!\u0010\n\u001a\b\u0012\u0004\u0012\u00020\f0\u000b8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u000f\u0010\t\u001a\u0004\b\r\u0010\u000eR\u000e\u0010\u0010\u001a\u00020\u0011X\u0082\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\u0012\u001a\u00020\u0013X\u0094D¢\u0006\b\n\u0000\u001a\u0004\b\u0014\u0010\u0015R$\u0010\u0018\u001a\u00020\u00172\u0006\u0010\u0016\u001a\u00020\u0017@GX\u0086.¢\u0006\u000e\n\u0000\u001a\u0004\b\u0019\u0010\u001a\"\u0004\b\u001b\u0010\u001c¨\u0006)"}, d2 = {"Lfinance/empower/android/app/notifications/NotificationSettingsActivity;", "Lfinance/empower/android/app/BaseActivity;", "Lfinance/empower/android/app/notifications/NotificationSettingsPresenter$ViewContract;", "()V", "binding", "Lfinance/empower/ph/databinding/ActivityNotificationSettingsBinding;", "getBinding", "()Lfinance/empower/ph/databinding/ActivityNotificationSettingsBinding;", "binding$delegate", "Lkotlin/Lazy;", "loadingBehavior", "Lfinance/empower/android/view/LoadingBehavior;", "Lfinance/empower/android/app/notifications/NotificationSettingsPresenter$ViewContract$Content;", "getLoadingBehavior", "()Lfinance/empower/android/view/LoadingBehavior;", "loadingBehavior$delegate", "notificationSettingsAdapter", "Lfinance/empower/android/app/notifications/NotificationSettingsAdapter;", "pageName", "", "getPageName", "()Ljava/lang/String;", "<set-?>", "Lfinance/empower/android/app/notifications/NotificationSettingsPresenter;", "presenter", "getPresenter", "()Lfinance/empower/android/app/notifications/NotificationSettingsPresenter;", "setPresenter", "(Lfinance/empower/android/app/notifications/NotificationSettingsPresenter;)V", "onCreate", "", "savedInstanceState", "Landroid/os/Bundle;", "onStart", "onStop", "render", "viewState", "Lfinance/empower/android/view/Presenter$LoadingViewState;", "renderContent", "content", "Companion", "empower-app_release"}, k = 1, mv = {1, 9, 0}, xi = 48)
public final class NotificationSettingsActivity extends BaseActivity implements NotificationSettingsPresenter.ViewContract {
    public NotificationSettingsPresenter presenter;

    public static final Companion INSTANCE = new Companion(null);
    public static final int $stable = 8;

    private final Lazy binding = LazyKt.lazy(new Function0<ActivityNotificationSettingsBinding>() {
        {
            super(0);
        }

        public final ActivityNotificationSettingsBinding m787invoke() {
            return ActivityNotificationSettingsBinding.inflate(NotificationSettingsActivity.this.getLayoutInflater());
        }
    });
    private final NotificationSettingsAdapter notificationSettingsAdapter = new NotificationSettingsAdapter();

    private final Lazy loadingBehavior = LazyKt.lazy(new Function0<LoadingBehavior<NotificationSettingsPresenter.ViewContract.Content>>() {
        {
            super(0);
        }

        public final LoadingBehavior<NotificationSettingsPresenter.ViewContract.Content> m788invoke() {
            ActivityNotificationSettingsBinding binding;
            binding = NotificationSettingsActivity.this.getBinding();
            NotificationSettingsActivity notificationSettingsActivity = NotificationSettingsActivity.this;
            View view = binding.recyclerNotificationSettings;
            Intrinsics.checkNotNullExpressionValue(view, "recyclerNotificationSettings");
            View view2 = view;
            FetchLoadingView fetchLoadingView = binding.fetchLoadingView;
            Intrinsics.checkNotNullExpressionValue(fetchLoadingView, "fetchLoadingView");
            FetchErrorView fetchErrorView = binding.fetchErrorView;
            Intrinsics.checkNotNullExpressionValue(fetchErrorView, "fetchErrorView");
            return new LoadingBehavior<>(view2, fetchLoadingView, fetchErrorView, binding.blockingLoadingModal, binding.includeAppbar.progressBanner.progressBanner, new NotificationSettingsActivity$loadingBehavior$2$1$1(notificationSettingsActivity), new Function0<Unit>() {
                public final void m789invoke() {
                }

                public Object invoke() {
                    m789invoke();
                    return Unit.INSTANCE;
                }
            });
        }
    });
    private final String pageName = "NotificationSettings";

    @Metadata(d1 = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u000e\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006¨\u0006\u0007"}, d2 = {"Lfinance/empower/android/app/notifications/NotificationSettingsActivity$Companion;", "", "()V", "newIntent", "Landroid/content/Intent;", "context", "Landroid/content/Context;", "empower-app_release"}, k = 1, mv = {1, 9, 0}, xi = 48)
    public static final class Companion {
        public Companion(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private Companion() {
        }

        public final Intent newIntent(Context context) {
            Intrinsics.checkNotNullParameter(context, "context");
            return Internals.createIntent(context, NotificationSettingsActivity.class, new Pair[0]);
        }
    }

    public final NotificationSettingsPresenter getPresenter() {
        NotificationSettingsPresenter notificationSettingsPresenter = this.presenter;
        if (notificationSettingsPresenter != null) {
            return notificationSettingsPresenter;
        }
        Intrinsics.throwUninitializedPropertyAccessException("presenter");
        return null;
    }

    @Inject
    public final void setPresenter(NotificationSettingsPresenter notificationSettingsPresenter) {
        Intrinsics.checkNotNullParameter(notificationSettingsPresenter, "<set-?>");
        this.presenter = notificationSettingsPresenter;
    }

    public final ActivityNotificationSettingsBinding getBinding() {
        return (ActivityNotificationSettingsBinding) this.binding.getValue();
    }

    private final LoadingBehavior<NotificationSettingsPresenter.ViewContract.Content> getLoadingBehavior() {
        return (LoadingBehavior) this.loadingBehavior.getValue();
    }

    @Override
    protected String getPageName() {
        return this.pageName;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityNotificationSettingsBinding binding = getBinding();
        setContentView((View) binding.getRoot());
        String string = getString(R.string.text_notifications_title);
        Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
        BaseActivity.setupToolbar$default(this, string, "", NavButton.UP, null, false, null, 56, null);
        RecyclerView recyclerView = binding.recyclerNotificationSettings;
        recyclerView.setAdapter(this.notificationSettingsAdapter);
        recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext()));
    }

    @Override
    protected void onStart() {
        super.onStart();
        getPresenter().onStart();
    }

    protected void onStop() {
        getPresenter().onStop();
        super.onStop();
    }

    @Override
    public void render(Presenter.LoadingViewState<NotificationSettingsPresenter.ViewContract.Content> viewState) {
        Intrinsics.checkNotNullParameter(viewState, "viewState");
        getLoadingBehavior().apply(viewState);
    }

    public final void renderContent(NotificationSettingsPresenter.ViewContract.Content content) {
        this.notificationSettingsAdapter.submitList(content.getSettingGroups());
        View root = getBinding().notificationBannerView.getRoot();
        Intrinsics.checkNotNullExpressionValue(root, "getRoot(...)");
        ViewExtKt.applyActionOrCollapse(root, content.getNotificationBannerConfig());
    }
}