导航菜单

页面标题

页面副标题

Brevistay v5.8.2 - CreatedBookingActivityBACKSTACK.java 源代码

正在查看: Brevistay v5.8.2 应用的 CreatedBookingActivityBACKSTACK.java JAVA 源代码文件

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


package com.brevistay.app.view.booking;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.navigation.NavArgsLazy;
import androidx.navigation.NavController;
import androidx.navigation.fragment.FragmentKt;
import androidx.navigation.fragment.NavHostFragment;
import androidx.preference.PreferenceManager;
import com.brevistay.app.models.Apis;
import com.brevistay.app.models.Retrofithelper;
import com.brevistay.app.repositories.CreatedBookingRepo;
import com.brevistay.app.viewmodels.booking_viewmodel.CreatedBookingVMF;
import com.brevistay.app.viewmodels.booking_viewmodel.CreatedBookingViewModel;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import org.imaginativeworld.oopsnointernet.callbacks.ConnectionCallback;
import org.imaginativeworld.oopsnointernet.snackbars.fire.NoInternetSnackbarFire;
import org.imaginativeworld.oopsnointernet.snackbars.fire.SnackbarPropertiesFire;

@Metadata(d1 = {"\u00004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J\u0012\u0010\u0010\u001a\u00020\u00112\b\u0010\u0012\u001a\u0004\u0018\u00010\u0013H\u0014J\b\u0010\u0014\u001a\u00020\u0011H\u0016R\u001b\u0010\u0004\u001a\u00020\u00058FX\u0086\u0084\u0002¢\u0006\f\n\u0004\b\b\u0010\t\u001a\u0004\b\u0006\u0010\u0007R\u000e\u0010\n\u001a\u00020\u000bX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\rX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082.¢\u0006\u0002\n\u0000¨\u0006\u0015"}, d2 = {"Lcom/brevistay/app/view/booking/CreatedBookingActivityBACKSTACK;", "Landroidx/appcompat/app/AppCompatActivity;", "<init>", "()V", "args", "Lcom/brevistay/app/view/booking/CreatedBookingActivityBACKSTACKArgs;", "getArgs", "()Lcom/brevistay/app/view/booking/CreatedBookingActivityBACKSTACKArgs;", "args$delegate", "Landroidx/navigation/NavArgsLazy;", "viewmodel", "Lcom/brevistay/app/viewmodels/booking_viewmodel/CreatedBookingViewModel;", "sharedPreferences", "Landroid/content/SharedPreferences;", "navController", "Landroidx/navigation/NavController;", "onCreate", "", "savedInstanceState", "Landroid/os/Bundle;", "onBackPressed", "app_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class CreatedBookingActivityBACKSTACK extends AppCompatActivity {

    private final NavArgsLazy args;
    private NavController navController;
    private SharedPreferences sharedPreferences;
    private CreatedBookingViewModel viewmodel;

    public CreatedBookingActivityBACKSTACK() {
        final Activity activity = (Activity) this;
        this.args = new NavArgsLazy(Reflection.getOrCreateKotlinClass(CreatedBookingActivityBACKSTACKArgs.class), new Function0<Bundle>() {
            {
                super(0);
            }

            public final Bundle m12invoke() {
                Bundle bundle;
                Intent intent = activity.getIntent();
                if (intent != null) {
                    Activity activity2 = activity;
                    bundle = intent.getExtras();
                    if (bundle == null) {
                        throw new IllegalStateException("Activity " + activity2 + " has null extras in " + intent);
                    }
                } else {
                    bundle = null;
                }
                if (bundle != null) {
                    return bundle;
                }
                throw new IllegalStateException("Activity " + activity + " has a null Intent");
            }
        });
    }

    public final CreatedBookingActivityBACKSTACKArgs getArgs() {
        return (CreatedBookingActivityBACKSTACKArgs) this.args.getValue();
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(2131558428);
        if (getBaseContext() != null) {
            this.sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            CreatedBookingViewModel createdBookingViewModel = null;
            Apis apis = (Apis) Retrofithelper.getInstance$default(Retrofithelper.INSTANCE, (String) null, 1, (Object) null).create(Apis.class);
            Intrinsics.checkNotNull(apis);
            this.viewmodel = (CreatedBookingViewModel) new ViewModelProvider((ViewModelStoreOwner) this, new CreatedBookingVMF(new CreatedBookingRepo(apis))).get(CreatedBookingViewModel.class);
            Fragment findFragmentById = getSupportFragmentManager().findFragmentById(2131363279);
            Intrinsics.checkNotNull(findFragmentById, "null cannot be cast to non-null type androidx.navigation.fragment.NavHostFragment");
            this.navController = FragmentKt.findNavController((NavHostFragment) findFragmentById);
            String stringExtra = getIntent().getStringExtra("jwtId");
            String stringExtra2 = getIntent().getStringExtra("userToken");
            Log.d("booking_his", getArgs().getJwtId() + " ---------------- " + getArgs().getUserToken());
            CreatedBookingViewModel createdBookingViewModel2 = this.viewmodel;
            if (createdBookingViewModel2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("viewmodel");
                createdBookingViewModel2 = null;
            }
            MutableLiveData<String> jwt_id = createdBookingViewModel2.getJwt_id();
            String jwtId = getArgs().getJwtId();
            if (jwtId != null) {
                stringExtra = jwtId;
            }
            jwt_id.setValue(stringExtra);
            CreatedBookingViewModel createdBookingViewModel3 = this.viewmodel;
            if (createdBookingViewModel3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("viewmodel");
            } else {
                createdBookingViewModel = createdBookingViewModel3;
            }
            MutableLiveData<String> userToken = createdBookingViewModel.getUserToken();
            String userToken2 = getArgs().getUserToken();
            if (userToken2 != null) {
                stringExtra2 = userToken2;
            }
            userToken.setValue(stringExtra2);
            View findViewById = findViewById(2131362550);
            Intrinsics.checkNotNullExpressionValue(findViewById, "findViewById(...)");
            NoInternetSnackbarFire.Builder builder = new NoInternetSnackbarFire.Builder((ViewGroup) findViewById, getLifecycle());
            SnackbarPropertiesFire snackbarProperties = builder.getSnackbarProperties();
            snackbarProperties.setConnectionCallback(new ConnectionCallback() {
                public void hasActiveConnection(boolean hasActiveConnection) {
                }
            });
            snackbarProperties.setDuration(-2);
            snackbarProperties.setNoInternetConnectionMessage("No active Internet connection!");
            snackbarProperties.setOnAirplaneModeMessage("You have turned on the airplane mode!");
            snackbarProperties.setSnackbarActionText("Settings");
            snackbarProperties.setShowActionToDismiss(false);
            snackbarProperties.setSnackbarDismissActionText("OK");
            builder.build();
        }
    }

    public void onBackPressed() {
        try {
            NavController navController = this.navController;
            if (navController == null) {
                Intrinsics.throwUninitializedPropertyAccessException("navController");
                navController = null;
            }
            if (navController.navigateUp()) {
                return;
            }
            super.onBackPressed();
        } catch (Exception unused) {
            super.onBackPressed();
        }
    }
}