正在查看: Brevistay v5.8.2 应用的 ProfileFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Brevistay v5.8.2 应用的 ProfileFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.brevistay.app.view.main.fragments;
import android.content.ActivityNotFoundException;
import android.content.ComponentCallbacks;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.CookieManager;
import android.webkit.WebStorage;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.activity.ComponentActivity;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.ViewModelStore;
import androidx.lifecycle.ViewModelStoreOwner;
import androidx.lifecycle.viewmodel.CreationExtras;
import androidx.navigation.NavDirections;
import androidx.navigation.fragment.FragmentKt;
import androidx.preference.PreferenceManager;
import com.brevistay.app.databinding.FragmentProfileBinding;
import com.brevistay.app.models.app_home.AppHomeTokenRes;
import com.brevistay.app.models.login_model.login.LoginResFromPass;
import com.brevistay.app.models.user_profile.UserProfileRes;
import com.brevistay.app.view.login.LoginActivity;
import com.brevistay.app.view.main.fragments.ProfileFragmentDirections;
import com.brevistay.app.viewmodels.main_viewmodel.MainViewModel;
import com.facebook.appevents.AppEventsConstants;
import com.facebook.appevents.internal.ViewHierarchyConstants;
import com.facebook.internal.ServerProtocol;
import com.facebook.share.internal.ShareConstants;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.android.play.core.appupdate.AppUpdateInfo;
import com.google.android.play.core.appupdate.AppUpdateManager;
import com.google.android.play.core.appupdate.AppUpdateManagerFactory;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.LazyThreadSafetyMode;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlinx.coroutines.BuildersKt;
import kotlinx.coroutines.CoroutineScopeKt;
import kotlinx.coroutines.CoroutineStart;
import kotlinx.coroutines.Dispatchers;
import org.koin.android.ext.android.AndroidKoinScopeExtKt;
import org.koin.core.qualifier.Qualifier;
import org.koin.viewmodel.GetViewModelKt;
@Metadata(d1 = {"\u0000X\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0011\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\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001B\u0007¢\u0006\u0004\b\u0002\u0010\u0003J$\u0010+\u001a\u00020,2\u0006\u0010-\u001a\u00020.2\b\u0010/\u001a\u0004\u0018\u0001002\b\u00101\u001a\u0004\u0018\u000102H\u0016J\b\u00103\u001a\u000204H\u0016J\u001a\u00105\u001a\u0002042\u0006\u00106\u001a\u00020,2\b\u00101\u001a\u0004\u0018\u000102H\u0017J\b\u00107\u001a\u000204H\u0016R\u0010\u0010\u0004\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0006\u001a\u00020\u00058BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0007\u0010\bR\u000e\u0010\t\u001a\u00020\nX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082.¢\u0006\u0002\n\u0000R\u001a\u0010\r\u001a\u00020\u000eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000f\u0010\u0010\"\u0004\b\u0011\u0010\u0012R\u001b\u0010\u0013\u001a\u00020\u00148BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0017\u0010\u0018\u001a\u0004\b\u0015\u0010\u0016R\u0014\u0010\u0019\u001a\u00020\u000eX\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\u001a\u0010\u0010R\u0014\u0010\u001b\u001a\u00020\u000eX\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\u001c\u0010\u0010R\u0014\u0010\u001d\u001a\u00020\u000eX\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\u001e\u0010\u0010R\u0014\u0010\u001f\u001a\u00020\u000eX\u0086D¢\u0006\b\n\u0000\u001a\u0004\b \u0010\u0010R\u0014\u0010!\u001a\u00020\u000eX\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\"\u0010\u0010R\u0014\u0010#\u001a\u00020\u000eX\u0086D¢\u0006\b\n\u0000\u001a\u0004\b$\u0010\u0010R\u001c\u0010%\u001a\u0004\u0018\u00010&X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b'\u0010(\"\u0004\b)\u0010*¨\u00068"}, d2 = {"Lcom/brevistay/app/view/main/fragments/ProfileFragment;", "Landroidx/fragment/app/Fragment;", "<init>", "()V", "_binding", "Lcom/brevistay/app/databinding/FragmentProfileBinding;", "binding", "getBinding", "()Lcom/brevistay/app/databinding/FragmentProfileBinding;", "sharedPreferences", "Landroid/content/SharedPreferences;", "editor", "Landroid/content/SharedPreferences$Editor;", "avatar", "", "getAvatar", "()Ljava/lang/String;", "setAvatar", "(Ljava/lang/String;)V", "viewmodel", "Lcom/brevistay/app/viewmodels/main_viewmodel/MainViewModel;", "getViewmodel", "()Lcom/brevistay/app/viewmodels/main_viewmodel/MainViewModel;", "viewmodel$delegate", "Lkotlin/Lazy;", "faq", "getFaq", "support", "getSupport", "offers", "getOffers", "tnc", "getTnc", ShareConstants.WEB_DIALOG_PARAM_PRIVACY, "getPrivacy", "about", "getAbout", "userProfile", "Lcom/brevistay/app/models/user_profile/UserProfileRes;", "getUserProfile", "()Lcom/brevistay/app/models/user_profile/UserProfileRes;", "setUserProfile", "(Lcom/brevistay/app/models/user_profile/UserProfileRes;)V", "onCreateView", "Landroid/view/View;", "inflater", "Landroid/view/LayoutInflater;", "container", "Landroid/view/ViewGroup;", "savedInstanceState", "Landroid/os/Bundle;", "onResume", "", "onViewCreated", ViewHierarchyConstants.VIEW_KEY, "onDestroyView", "app_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class ProfileFragment extends Fragment {
private FragmentProfileBinding _binding;
private final String about;
private String avatar;
private SharedPreferences.Editor editor;
private final String faq;
private final String offers;
private final String privacy;
private SharedPreferences sharedPreferences;
private final String support;
private final String tnc;
private UserProfileRes userProfile;
private final Lazy viewmodel;
public ProfileFragment() {
super(2131558544);
this.avatar = "4";
final ProfileFragment profileFragment = this;
final Function0<FragmentActivity> function0 = new Function0<FragmentActivity>() {
public final FragmentActivity m264invoke() {
return profileFragment.requireActivity();
}
};
final Qualifier qualifier = null;
final Function0 function02 = null;
final Function0 function03 = null;
this.viewmodel = LazyKt.lazy(LazyThreadSafetyMode.NONE, new Function0<MainViewModel>() {
public final MainViewModel m265invoke() {
CreationExtras defaultViewModelCreationExtras;
ComponentCallbacks componentCallbacks = profileFragment;
Qualifier qualifier2 = qualifier;
Function0 function04 = function0;
Function0 function05 = function02;
Function0 function06 = function03;
ComponentActivity componentActivity = (ViewModelStoreOwner) function04.invoke();
ViewModelStore viewModelStore = componentActivity.getViewModelStore();
if (function05 == null || (defaultViewModelCreationExtras = (CreationExtras) function05.invoke()) == null) {
ComponentActivity componentActivity2 = componentActivity instanceof ComponentActivity ? componentActivity : null;
if (componentActivity2 != null) {
defaultViewModelCreationExtras = componentActivity2.getDefaultViewModelCreationExtras();
} else {
defaultViewModelCreationExtras = componentCallbacks.getDefaultViewModelCreationExtras();
Intrinsics.checkNotNullExpressionValue(defaultViewModelCreationExtras, "<get-defaultViewModelCreationExtras>(...)");
}
}
return GetViewModelKt.resolveViewModel$default(Reflection.getOrCreateKotlinClass(MainViewModel.class), viewModelStore, (String) null, defaultViewModelCreationExtras, qualifier2, AndroidKoinScopeExtKt.getKoinScope(componentCallbacks), function06, 4, (Object) null);
}
});
this.faq = "https://www.brevistay.com/faqs-app-load";
this.support = "https://www.brevistay.com/contact-app-load";
this.offers = "https://www.brevistay.com/offers-app-load";
this.tnc = "https://www.brevistay.com/terms-app-load";
this.privacy = "https://www.brevistay.com/privacy-app-load";
this.about = "https://www.brevistay.com/about-app-load";
}
private final FragmentProfileBinding getBinding() {
FragmentProfileBinding fragmentProfileBinding = this._binding;
Intrinsics.checkNotNull(fragmentProfileBinding);
return fragmentProfileBinding;
}
public final String getAvatar() {
return this.avatar;
}
public final void setAvatar(String str) {
Intrinsics.checkNotNullParameter(str, "<set-?>");
this.avatar = str;
}
public final MainViewModel getViewmodel() {
return (MainViewModel) this.viewmodel.getValue();
}
public final String getFaq() {
return this.faq;
}
public final String getSupport() {
return this.support;
}
public final String getOffers() {
return this.offers;
}
public final String getTnc() {
return this.tnc;
}
public final String getPrivacy() {
return this.privacy;
}
public final String getAbout() {
return this.about;
}
public final UserProfileRes getUserProfile() {
return this.userProfile;
}
public final void setUserProfile(UserProfileRes userProfileRes) {
this.userProfile = userProfileRes;
}
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
ImageView imageView;
ImageView imageView2;
ImageView imageView3;
ImageView imageView4;
ImageView imageView5;
ImageView imageView6;
Intrinsics.checkNotNullParameter(inflater, "inflater");
this._binding = FragmentProfileBinding.inflate(inflater, container, false);
getBinding().appVersionTxt.setText("Brevistay App v5.8.2");
String valueOf = String.valueOf(PreferenceManager.getDefaultSharedPreferences(requireContext().getApplicationContext()).getString("avatar", "4"));
this.avatar = valueOf;
switch (valueOf.hashCode()) {
case 49:
if (valueOf.equals(AppEventsConstants.EVENT_PARAM_VALUE_YES) && (imageView = getBinding().profileAvatarIcon) != null) {
imageView.setImageResource(2131230899);
break;
}
break;
case 50:
if (valueOf.equals("2") && (imageView2 = getBinding().profileAvatarIcon) != null) {
imageView2.setImageResource(2131230900);
break;
}
break;
case 51:
if (valueOf.equals("3") && (imageView3 = getBinding().profileAvatarIcon) != null) {
imageView3.setImageResource(2131230904);
break;
}
break;
case 52:
if (valueOf.equals("4") && (imageView4 = getBinding().profileAvatarIcon) != null) {
imageView4.setImageResource(2131230905);
break;
}
break;
case 53:
if (valueOf.equals("5") && (imageView5 = getBinding().profileAvatarIcon) != null) {
imageView5.setImageResource(2131230906);
break;
}
break;
case 54:
if (valueOf.equals("6") && (imageView6 = getBinding().profileAvatarIcon) != null) {
imageView6.setImageResource(2131230907);
break;
}
break;
}
View root = getBinding().getRoot();
Intrinsics.checkNotNullExpressionValue(root, "getRoot(...)");
return root;
}
public void onResume() {
super.onResume();
}
public void onViewCreated(View view, Bundle savedInstanceState) {
Intrinsics.checkNotNullParameter(view, ViewHierarchyConstants.VIEW_KEY);
super.onViewCreated(view, savedInstanceState);
if (isAdded()) {
CardView cardView = getBinding().profileRate;
if (cardView != null) {
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$0(ProfileFragment.this, view2);
}
});
}
SharedPreferences defaultSharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext().getApplicationContext());
this.sharedPreferences = defaultSharedPreferences;
if (defaultSharedPreferences == null) {
Intrinsics.throwUninitializedPropertyAccessException("sharedPreferences");
defaultSharedPreferences = null;
}
this.editor = defaultSharedPreferences.edit();
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) this), Dispatchers.getIO(), (CoroutineStart) null, new ProfileFragment$onViewCreated$2(this, null), 2, (Object) null);
ImageView imageView = getBinding().profileEditAvatarBtn;
if (imageView != null) {
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$1(ProfileFragment.this, view2);
}
});
}
ConstraintLayout constraintLayout = getBinding().downloadAppLayout;
if (constraintLayout != null) {
constraintLayout.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$2(ProfileFragment.this, view2);
}
});
}
AppUpdateManager create = AppUpdateManagerFactory.create(requireContext());
Intrinsics.checkNotNullExpressionValue(create, "create(...)");
Task appUpdateInfo = create.getAppUpdateInfo();
Intrinsics.checkNotNullExpressionValue(appUpdateInfo, "getAppUpdateInfo(...)");
final Function1 function1 = new Function1() {
public final Object invoke(Object obj) {
Unit onViewCreated$lambda$3;
onViewCreated$lambda$3 = ProfileFragment.onViewCreated$lambda$3(ProfileFragment.this, (AppUpdateInfo) obj);
return onViewCreated$lambda$3;
}
};
appUpdateInfo.addOnSuccessListener(new OnSuccessListener() {
@Override
public final void onSuccess(Object obj) {
function1.invoke(obj);
}
});
TextView textView = getBinding().walletBalTxt;
if (textView != null) {
UserProfileRes userProfileRes = (UserProfileRes) getViewmodel().getUserProfile().getValue();
textView.setText((userProfileRes != null ? userProfileRes.getUsr_wallet_bal() : 0) + " wallet credits");
}
getViewmodel().getUserProfile().observe(requireActivity(), new ProfileFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
public final Object invoke(Object obj) {
Unit onViewCreated$lambda$5;
onViewCreated$lambda$5 = ProfileFragment.onViewCreated$lambda$5(ProfileFragment.this, (UserProfileRes) obj);
return onViewCreated$lambda$5;
}
}));
getViewmodel().getAppHomeRes().observe(requireActivity(), new ProfileFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
public final Object invoke(Object obj) {
Unit onViewCreated$lambda$6;
onViewCreated$lambda$6 = ProfileFragment.onViewCreated$lambda$6(ProfileFragment.this, (AppHomeTokenRes) obj);
return onViewCreated$lambda$6;
}
}));
getViewmodel().getUserDetails().observe(requireActivity(), new ProfileFragment$sam$androidx_lifecycle_Observer$0(new Function1() {
public final Object invoke(Object obj) {
Unit onViewCreated$lambda$8;
onViewCreated$lambda$8 = ProfileFragment.onViewCreated$lambda$8(ProfileFragment.this, (LoginResFromPass) obj);
return onViewCreated$lambda$8;
}
}));
getBinding().settings.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$9(ProfileFragment.this, view2);
}
});
getBinding().faqs.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$10(ProfileFragment.this, view2);
}
});
ConstraintLayout constraintLayout2 = getBinding().support;
if (constraintLayout2 != null) {
constraintLayout2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$11(ProfileFragment.this, view2);
}
});
}
ConstraintLayout constraintLayout3 = getBinding().tnc;
if (constraintLayout3 != null) {
constraintLayout3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$12(ProfileFragment.this, view2);
}
});
}
ConstraintLayout constraintLayout4 = getBinding().policy;
if (constraintLayout4 != null) {
constraintLayout4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$13(ProfileFragment.this, view2);
}
});
}
ConstraintLayout constraintLayout5 = getBinding().about;
if (constraintLayout5 != null) {
constraintLayout5.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$14(ProfileFragment.this, view2);
}
});
}
ConstraintLayout constraintLayout6 = getBinding().walletLayout;
if (constraintLayout6 != null) {
constraintLayout6.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$15(ProfileFragment.this, view2);
}
});
}
getBinding().share.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$16(ProfileFragment.this, view2);
}
});
ConstraintLayout constraintLayout7 = getBinding().editProfile;
if (constraintLayout7 != null) {
constraintLayout7.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view2) {
ProfileFragment.onViewCreated$lambda$17(ProfileFragment.this, view2);
}
});
}
}
}
public static final void onViewCreated$lambda$0(ProfileFragment profileFragment, View view) {
try {
profileFragment.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=com.brevistay.customer")));
} catch (ActivityNotFoundException unused) {
profileFragment.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=com.brevistay.customer")));
}
}
public static final void onViewCreated$lambda$1(ProfileFragment profileFragment, View view) {
try {
NavDirections actionProfileFragmentToAvatarFragment = ProfileFragmentDirections.actionProfileFragmentToAvatarFragment();
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToAvatarFragment, "actionProfileFragmentToAvatarFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToAvatarFragment);
} catch (Exception unused) {
}
}
public static final void onViewCreated$lambda$2(ProfileFragment profileFragment, View view) {
try {
profileFragment.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=com.brevistay.customer")));
} catch (ActivityNotFoundException | Exception unused) {
}
}
public static final Unit onViewCreated$lambda$3(ProfileFragment profileFragment, AppUpdateInfo appUpdateInfo) {
if (appUpdateInfo.updateAvailability() == 2) {
profileFragment.getBinding().downloadAppLayout.setVisibility(0);
profileFragment.getBinding().viewUpdate.setVisibility(0);
}
return Unit.INSTANCE;
}
public static final Unit onViewCreated$lambda$5(ProfileFragment profileFragment, UserProfileRes userProfileRes) {
if (userProfileRes != null) {
Log.d("user-profile#####", userProfileRes.toString());
if (Intrinsics.areEqual(userProfileRes.getStatus(), "SUCCESS")) {
profileFragment.userProfile = userProfileRes;
TextView textView = profileFragment.getBinding().refCodeTxt;
if (textView != null) {
textView.setText(userProfileRes.getUsr_referral_code());
}
} else if (Intrinsics.areEqual(userProfileRes.getStatus(), "ERROR")) {
WebStorage.getInstance().deleteAllData();
CookieManager.getInstance().removeAllCookies(null);
CookieManager.getInstance().flush();
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) profileFragment), (CoroutineContext) null, (CoroutineStart) null, new ProfileFragment$onViewCreated$6$1(profileFragment, null), 3, (Object) null);
}
}
return Unit.INSTANCE;
}
public static final Unit onViewCreated$lambda$6(ProfileFragment profileFragment, AppHomeTokenRes appHomeTokenRes) {
if (profileFragment.isAdded()) {
if (appHomeTokenRes != null) {
LoginResFromPass loginResFromPass = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
String token = loginResFromPass != null ? loginResFromPass.getToken() : null;
if (token != null) {
BuildersKt.launch$default(CoroutineScopeKt.CoroutineScope(Dispatchers.getIO()), (CoroutineContext) null, (CoroutineStart) null, new ProfileFragment$onViewCreated$7$1(profileFragment, token, null), 3, (Object) null);
}
} else {
Log.d("user_profile", "user is logged out / error");
}
}
return Unit.INSTANCE;
}
public static final Unit onViewCreated$lambda$8(final ProfileFragment profileFragment, LoginResFromPass loginResFromPass) {
Log.d("log in?", "change in userDetails");
if (profileFragment.isAdded()) {
if (loginResFromPass != null) {
Log.d("log in?", "user is logged in");
BuildersKt.launch$default(LifecycleOwnerKt.getLifecycleScope((LifecycleOwner) profileFragment), Dispatchers.getIO(), (CoroutineStart) null, new ProfileFragment$onViewCreated$8$1(loginResFromPass, profileFragment, null), 2, (Object) null);
String valueOf = String.valueOf(loginResFromPass.getUser_first_name());
if (valueOf.length() > 20) {
String substring = valueOf.substring(0, 20);
Intrinsics.checkNotNullExpressionValue(substring, "substring(...)");
valueOf = substring + "...";
}
profileFragment.getBinding().usernameProfile.setText(valueOf);
profileFragment.getBinding().walletLayout.setVisibility(0);
profileFragment.getBinding().share.setVisibility(0);
profileFragment.getBinding().editProfile.setVisibility(0);
ImageView imageView = profileFragment.getBinding().profileEditAvatarBtn;
if (imageView != null) {
imageView.setVisibility(0);
}
profileFragment.getBinding().myBookingsLayout.setVisibility(8);
profileFragment.getBinding().view15.setVisibility(0);
profileFragment.getBinding().logOut.setVisibility(8);
profileFragment.getBinding().view17.setVisibility(8);
ConstraintLayout constraintLayout = profileFragment.getBinding().settings;
if (constraintLayout != null) {
constraintLayout.setVisibility(0);
}
} else {
Log.d("log in?", "user is logged out");
profileFragment.getBinding().usernameProfile.setText("GUEST");
profileFragment.getBinding().walletLayout.setVisibility(8);
profileFragment.getBinding().share.setVisibility(8);
profileFragment.getBinding().editProfile.setVisibility(8);
profileFragment.getBinding().walletBalTxt.setVisibility(8);
profileFragment.getBinding().myBookingsLayout.setVisibility(8);
ImageView imageView2 = profileFragment.getBinding().profileEditAvatarBtn;
if (imageView2 != null) {
imageView2.setVisibility(8);
}
profileFragment.getBinding().view15.setVisibility(8);
profileFragment.getBinding().signinoutTxt.setText("Log In");
ConstraintLayout constraintLayout2 = profileFragment.getBinding().settings;
if (constraintLayout2 != null) {
constraintLayout2.setVisibility(8);
}
profileFragment.getBinding().logOut.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
ProfileFragment.onViewCreated$lambda$8$lambda$7(ProfileFragment.this, view);
}
});
}
}
return Unit.INSTANCE;
}
public static final void onViewCreated$lambda$8$lambda$7(ProfileFragment profileFragment, View view) {
profileFragment.startActivity(new Intent(profileFragment.requireContext(), (Class<?>) LoginActivity.class));
}
public static final void onViewCreated$lambda$9(ProfileFragment profileFragment, View view) {
try {
LoginResFromPass loginResFromPass = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
String token = loginResFromPass != null ? loginResFromPass.getToken() : null;
if (token != null) {
UserProfileRes userProfileRes = profileFragment.userProfile;
ProfileFragmentDirections.ActionProfileFragmentToSettingsFragment actionProfileFragmentToSettingsFragment = ProfileFragmentDirections.actionProfileFragmentToSettingsFragment(token, userProfileRes != null ? userProfileRes.getHide_all_booking_flag() : false);
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToSettingsFragment, "actionProfileFragmentToSettingsFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToSettingsFragment);
}
} catch (Exception unused) {
}
}
public static final void onViewCreated$lambda$10(ProfileFragment profileFragment, View view) {
try {
ProfileFragmentDirections.ActionProfileFragmentToWebFragment actionProfileFragmentToWebFragment = ProfileFragmentDirections.actionProfileFragmentToWebFragment(profileFragment.faq, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToWebFragment, "actionProfileFragmentToWebFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToWebFragment);
} catch (Exception unused) {
}
}
public static final void onViewCreated$lambda$11(ProfileFragment profileFragment, View view) {
try {
ProfileFragmentDirections.ActionProfileFragmentToWebFragment actionProfileFragmentToWebFragment = ProfileFragmentDirections.actionProfileFragmentToWebFragment(profileFragment.support, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToWebFragment, "actionProfileFragmentToWebFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToWebFragment);
} catch (Exception unused) {
}
}
public static final void onViewCreated$lambda$12(ProfileFragment profileFragment, View view) {
try {
ProfileFragmentDirections.ActionProfileFragmentToWebFragment actionProfileFragmentToWebFragment = ProfileFragmentDirections.actionProfileFragmentToWebFragment(profileFragment.tnc, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToWebFragment, "actionProfileFragmentToWebFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToWebFragment);
} catch (Exception unused) {
}
}
public static final void onViewCreated$lambda$13(ProfileFragment profileFragment, View view) {
try {
ProfileFragmentDirections.ActionProfileFragmentToWebFragment actionProfileFragmentToWebFragment = ProfileFragmentDirections.actionProfileFragmentToWebFragment(profileFragment.privacy, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToWebFragment, "actionProfileFragmentToWebFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToWebFragment);
} catch (Exception unused) {
}
}
public static final void onViewCreated$lambda$14(ProfileFragment profileFragment, View view) {
try {
ProfileFragmentDirections.ActionProfileFragmentToWebFragment actionProfileFragmentToWebFragment = ProfileFragmentDirections.actionProfileFragmentToWebFragment(profileFragment.about, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToWebFragment, "actionProfileFragmentToWebFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToWebFragment);
} catch (Exception unused) {
}
}
public static final void onViewCreated$lambda$15(ProfileFragment profileFragment, View view) {
LoginResFromPass loginResFromPass = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
String token = loginResFromPass != null ? loginResFromPass.getToken() : null;
LoginResFromPass loginResFromPass2 = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
if (loginResFromPass2 != null) {
loginResFromPass2.getUser_first_name();
}
LoginResFromPass loginResFromPass3 = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
if (loginResFromPass3 != null) {
loginResFromPass3.getUser_last_name();
}
if (token != null) {
try {
NavDirections actionProfileFragmentToWalletActivity = ProfileFragmentDirections.actionProfileFragmentToWalletActivity();
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToWalletActivity, "actionProfileFragmentToWalletActivity(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToWalletActivity);
} catch (Exception unused) {
}
}
}
public static final void onViewCreated$lambda$16(ProfileFragment profileFragment, View view) {
if (profileFragment.userProfile != null) {
try {
LoginResFromPass loginResFromPass = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
String token = loginResFromPass != null ? loginResFromPass.getToken() : null;
LoginResFromPass loginResFromPass2 = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
if (loginResFromPass2 != null) {
loginResFromPass2.getUser_first_name();
}
LoginResFromPass loginResFromPass3 = (LoginResFromPass) profileFragment.getViewmodel().getUserDetails().getValue();
if (loginResFromPass3 != null) {
loginResFromPass3.getUser_last_name();
}
if (token != null) {
NavDirections actionProfileFragmentToReferAndEarnFragment = ProfileFragmentDirections.actionProfileFragmentToReferAndEarnFragment();
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToReferAndEarnFragment, "actionProfileFragmentToReferAndEarnFragment(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToReferAndEarnFragment);
}
} catch (Exception unused) {
}
}
}
public static final void onViewCreated$lambda$17(ProfileFragment profileFragment, View view) {
try {
NavDirections actionProfileFragmentToEditDetailsFragment2 = ProfileFragmentDirections.actionProfileFragmentToEditDetailsFragment2();
Intrinsics.checkNotNullExpressionValue(actionProfileFragmentToEditDetailsFragment2, "actionProfileFragmentToEditDetailsFragment2(...)");
FragmentKt.findNavController(profileFragment).navigate(actionProfileFragmentToEditDetailsFragment2);
} catch (Exception unused) {
}
}
public void onDestroyView() {
super.onDestroyView();
getViewmodel().getForgotPassRes().removeObservers(requireActivity());
getViewmodel().getChangePassViaOtpRes().removeObservers(requireActivity());
getViewmodel().getChangePassRes().removeObservers(requireActivity());
}
}